how to get the index of the items in a Multiparm Block(list)

   8522   1   2
User Avatar
Member
479 posts
Joined: 12月 2009
オフライン
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!

Attachments:
Screen Shot 2014-07-06 at 6.43.26 pm.png (109.7 KB)

User Avatar
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()
  • Quick Links