Jump to content

Set values of a multiparm folder


Johan

Recommended Posts

Hi all,

I have a hard time understanding how to programmatically add values to a multiparm folder.
I want to add new items to a multiparm I added on my HDA. I can see all sorts of code for multiparm template groups and how to construct and add them to a node, but hardly any code that actually adds data to the multiparm.

Any pointers are greatly appreciated!

Thanks,
-Johan

Link to comment
Share on other sites

Found it, the magic bullet was multiParmInstances and insertMultiParmInstance

    p = obj.parm('folders')
    instances = p.multiParmInstances()
    for i in range(9):
        num_instances = p.evalAsInt()
        p.insertMultiParmInstance(num_instances)

Adds 9 new entries to multiparm block. If you use the naming scheme on the parms like value_# each parm name will increment and you can set values on them like normal.

obj.parm('value_'+str(i)).set(yourval)

Or something similar.

Cheers,

-Johan

 

  • 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...