May I ask how to get the index of the items created via a Multiparm Block (list)?
for example, in the image attached, how to use HScript/Python to get the “input index” associated with a “input file” item created in the Multiparm Block (list)?
Thanks!
how to get the index of the items in a Multiparm Block(list)
8522 1 2-
- oat
- Member
- 479 posts
- Joined: 12月 2009
- オフライン
-
- pezetko
- Member
- 392 posts
- Joined: 11月 2008
- オフライン
They are indexed from 1, so with python:
node = hou.pwd() #current node where is multiparam folder
numOfItems = node.parm('num_input_files').eval() #number of parameters in multiparam list
# iterate over all “index#” and “file_#” parameters in multiparam list
for i in range(1, numOfItems+1):
item = ‘index’+str(i)
file = ‘file_’+str(i)
print node.parm(item).eval()
print node.parm(file).eval()
node = hou.pwd() #current node where is multiparam folder
numOfItems = node.parm('num_input_files').eval() #number of parameters in multiparam list
# iterate over all “index#” and “file_#” parameters in multiparam list
for i in range(1, numOfItems+1):
item = ‘index’+str(i)
file = ‘file_’+str(i)
print node.parm(item).eval()
print node.parm(file).eval()
-
- Quick Links
