Jump to content

Multiparm (list) parameter linking


Recommended Posts

Hi, I'm losing my mind over how to link subnet parameters with the ones inside of it. I've got it to read the number of parameters and make that many, but can't make it read and populate the values accordingly. Super simple example hip down below. Basically the values on the subnet controls should correspond to the values on the wrangle inside.

Thanks

multiparmblocklist.hip

Link to comment
Share on other sites

Hey, you can setup a python callback script which dynamically reference the parameters from your hda to the wrangle.

Here's a quick example :

listparm_hda = kwargs["node"].parm("list")
list_hda = listparm_hda.multiParmInstances()
children = kwargs["node"].children()

for child in children:
  if "wrangle" in children:
    wrangle = children
  else:
    continue

listparm_wrangle = wrangle.parm("list")
list_wrangle = listparm_hda.multiParmInstances()
i = 0

for parm in list_hda:
  p1 = parm
  p2 = list_wrangle[i]
  
  p2.set(p1)
  p2.expression()
  
  i += 1
  

 

Cheers, 

Edited by DonRomano
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...