Python: list outputs of a VOP.

   3631   0   0
User Avatar
Member
36 posts
Joined: 8月 2006
Offline
Hello,

I'm just starting out with python in general, and python in Houdini in particular.

We want to create a python function that will connect the outputs of one VOP node to the inputs of another if their names have the same suffix, and a specified prefix. So, this:
connectSameSuffix(“j_shadingModel1”, “out_”, “j_comp1”, “fg_”)

would result in this:

http://i.imgur.com/C9uuo.png [i.imgur.com]

(I couldn't upload this image for some reason.)

To achieve this, we want to list which parameters correspond to the output connectors of a VOP node, whether or not they are connected.

The closest I've been able to get is hou.node.outputConnectors, which returns a tuple of tuples of hou.NodeConnection objects, but these only exist where the outputs are connected, and even in that case, they appear to only show the index of the output, not the parameter.

Note that these nodes were created using “vcc -m” applied to a “surface” .vfl file, which I learned from this post:

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=22075&highlight= [sidefx.com]

I'm not sure if this is the best way to write custom VOPs (and I haven't yet looked at the tutorials mentioned in that post).

Related questions: I created outputs for these nodes by specifying parms as “export”, but although it does make them into outputs, it also leaves them as inputs. Is there a way of preventing this? The “invisible” and “hidden” pragma hints don't work.

Much thanks,

Jeremy.
  • Quick Links