Jump to content

problem connecting to subnet indirect input using python


wolf_cub_one

Recommended Posts

I'm currently stuck. Here's my situation:

I have a foreach node and inside the foreach node I add a delete sop. Inside the foreach, there is the each sop, my newly added delete sop, and the 4 subnet indirect input connectors. The each sop is currently connected to the first indirect input connector. Usually, you would use a command like:

delete.setFirstInput(each)

to connect one node to another. However, what I need is for my delete sop to connect to the second indirect input connector. After searching the docs, I found the hou.SubnetIndirectInput class. However, I can't seem to understand how to use it, and it's probably due to the fact that subnetIndirectInputs has not been implemented yet. Does anyone know any way to connect to these indirect input connectors within a subnet using python?

Thanks for any help

Link to comment
Share on other sites

You can get the indirect inputs by calling hou.Node.indirectInputs(). This gives you a tuple of hou.SubNetIndirectInput objects. You can then just index into the tuple for the one you want.

inputs = subnet.indirectInputs()
delete.setNextInput(inputs[1])

Link to comment
Share on other sites

Graham,

Who are you? You must be Batman because you saved me again.

Twice this happens where I just missed getting it right and there you are. I'll probably have a few more issues before I become more comfortable with python in Houdini so I hope you don't mind if I ask for a little more help later on.

Thanks again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...