Search - User list
Full Version: get spare input with python
Root » Technical Discussion » get spare input with python
jkrein
hello,

is there a short way to get the node associated with a spare input?
in hscript you can access them via -1 etc.
the best way i found was evaluating the spare input as a parameter, which is a little to much code for simple expressions.
this is one of the reasons i still didn`t switch from hscript to python expressions.

if there is no such function already i would like to propose it as an added feature.

thanks
mearg
I run into a similar issue and for now, this seems to work.

myinput = hou.node('`chsop("../../spare_input0")`')

you probably might get a solution or workaround by now, but here is what I get.
EJaworenko
This works as a means of grabbing the iteration value of a spare input (in a for each loop with the metadata node connected to -1):

nodeParm = hou.pwd().evalParm("spare_input0")
node = hou.node(nodeParm)
num = node.geometry().intAttribValue('iteration')+1
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB