Jump to content
hoodini

how to connect nodes inside geometry with python

Recommended Posts

I made sphere geo and a color node in a geometry. I want to connect that color node to sphere but from python shell .

Share this post


Link to post
Share on other sites

Look at hou.Node.setNextInput or hou.Node.setInput.

 

You can also use hou.Node.createOutputNode to directly create your Color node from the Sphere node.

Share this post


Link to post
Share on other sites

better to ask it here, i have similar question but a bit complex, how to create node between connection? is there a python command for it or i should create a tricky bunch of lines for this? 

NnEf

Share this post


Link to post
Share on other sites

The most simple thing to do would be the following:

hou.node('/obj/geo1/merge2').setInput(1, hou.node('/obj/geo1/transform4'))

If you wanted things to be a bit less hard coded/flexible you could also use hou.node('/obj/geo1/merge2').inputConnections() to get a list of connections and then figure out which one is the connection to tube1 and then use that to figure out the input index (1).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×