get spare input with python

   2907   2   0
User Avatar
Member
5 posts
Joined: Nov. 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: Feb. 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
52 posts
Joined: June 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