Jump to content
Juhani Karlsson

Rename label in multiparm list.

Recommended Posts

Yo,

I have perfectly working dynamic multiparm list. I get all the values and params ect. 
only thin I can`t find is how to rename the labels of the parameters!! I`m doing it in a python callback. Sounds so simple, but I`m new to Houdini(ex-softie) so simple things can be hard haha

Thanks a bunch,
- J

Share this post


Link to post
Share on other sites

All you have to do is open the Edit Parameter Interface, select the parameter inside your Multiparm Block and rename the label with a '#' suffix, which will result in appending a number starting from 1 to your parm labels.

 

Cheers,

Manu

Share this post


Link to post
Share on other sites

Hi,

 

https://www.dropbox.com/s/xwtpkqlksjusshe/multiparm.png?dl=0

Thanks for your answer! However it is not quite like I want it.
I need to make a character asset that loads them from file structure and updates multiparm list accordingly. At the moment though, I can`t rename the labels of the characters.
Should I use some other way to do "dynamic" lists?


Thanks a lot,
- J

Share this post


Link to post
Share on other sites

How am I supposed to use the setLabel in the ParmTemplate? I`m bit confused how this should be done http://www.sidefx.com/docs/houdini14.0/hom/hou/ParmTemplate#setLabel

I suppose I have to use the ParmTemplateGroup? for the edits? Hmmmm

>>> n = hou.node('/obj/geo2/null2')
>>> ptg = n.parmTemplateGroup()
>>> for i in ptg.entries():
...     print i
... 
<hou.ToggleParmTemplate name='copyinput' label='Copy Input' default_value=True>
<hou.ToggleParmTemplate name='cacheinput' label='Cache Input' default_value=False>
<hou.FolderParmTemplate name='folder0' label='Folder Name' folder_type=MultiparmBlock>
>>> ptg.find("folder0")
<hou.FolderParmTemplate name='folder0' label='Folder Name' folder_type=MultiparmBlock>
>>> f = ptg.find("folder0")
>>> f.parmTemplates()[0]
<hou.FloatParmTemplate name='parm#' label='Label' length=1 naming_scheme=Base1 look=Regular default_value=(0,)>
>>> me = f.parmTemplates()[0]
>>> me.setName("newTest#")
>>> me
<hou.FloatParmTemplate name='newTest#' label='Label' length=1 naming_scheme=Base1 look=Regular default_value=(0,)>
>>> f.setParmTemplates((me,))
>>> ptg.replace("folder0", f)
>>> n.setParmTemplateGroup(ptg)
>>> 

In order to change the name of the parm using Python, you'll have to use parmTemplates. This is a way to do it.

For some reason, a Multiparmblock can't be found via parmTemplateGroup().findFolder(), but you can access it with just find().

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×