get spare input with python

   3648   2   0
User Avatar
Member
5 posts
Joined: 11月 2018
Offline
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
User Avatar
Member
1 posts
Joined: 2月 2017
Offline
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.
User Avatar
Member
54 posts
Joined: 6月 2017
Offline
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
Houdini TD, I focus on tools for procedural asset creation.

www.jaworenko.design
  • Quick Links