Jump to content
davylew

Any one show example for multi input python sop?

Recommended Posts

I want my python sop has 4 inputs.

geo = hou.pwd().geometry()

this code gave me one instance object of first input geometry.

How do I get object to the second input?

Share this post


Link to post
Share on other sites
I want my python sop has 4 inputs.

geo = hou.pwd().geometry()

this code gave me one instance object of first input geometry.

How do I get object to the second input?

Hey,

assuming that in general 4-inputs operators change only first input, there is no magic here, you can get the read-only geometry from node's connectors like in any other place of Houdini:

geo2 = hou.pwd().inputs()[1].geometry()

Note that hou.Node.inputs() returns variable length tuple not empty reference, so you need a logic for that ( or smarter way doing this ;) ).

hth,

skk.

Share this post


Link to post
Share on other sites

hou.pwd.geometry() is the OUTPUT geometry. Initially, it is copied from the first input's geometry.

Share this post


Link to post
Share on other sites

Thx SYmek & edward !!!

Another question is how create Python sop node with mutil inputs unknow the inputs number (like merge sop node)?

I want to manage different data flow and using ADD OR MIX to process those like layer structure.

Share this post


Link to post
Share on other sites

I think that is done by setting your minimum inputs to 0 and maximum inputs to 9999.

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

×