Update Parameter label with python

   3110   3   1
User Avatar
Member
13 posts
Joined: Jan. 2013
Offline
Hi

I have been trying to update the label of a parameter using a button and python

Attachments:
image_00.jpg (49.8 KB)
image_01.jpg (84.7 KB)

User Avatar
Member
2536 posts
Joined: June 2008
Offline
Maybe you can use setLabel() after fetching the parameter template for that label?
https://www.sidefx.com/docs/houdini/hom/hou/FloatParmTemplate.html [www.sidefx.com]

For the button, you can try something like this...
exec(hou.node("/obj/geo1/pythonscript1").parm('python').eval());test_callback("passing some data")
If you're inside an HDA, try relative pathing instead.
Edited by Enivob - July 3, 2021 09:03:26
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
13 posts
Joined: Jan. 2013
Offline
@Enivob this is how Im testing right now

Attachments:
image_02.jpg (43.4 KB)
image_03.jpg (69.9 KB)

User Avatar
Member
13 posts
Joined: Jan. 2013
Offline
Im trying this I found in other post but not seem to work for me when calling with the buttom

def increment():
    node = hou.pwd()
    targetParm = node.parm("targetParm")    
    
    group = node.parmTemplateGroup()
    oldParm = targetParm.parmTemplate()
    newParm = targetParm.parmTemplate()
    newParm.setLabel("my new label")
    group.replace(oldParm, newParm)
    node.setParmTemplateGroup(group)



in the buttom callback im using this

hou.phm().increment()
Edited by sheep - July 3, 2021 22:00:26
  • Quick Links