Making temporary default value for a param in my HDA
1720 2 0-
- PrzemasCGBoi
- Member
- 3 posts
- Joined: Dec. 2018
- Offline
In my HDA I would like to have some dynamic default values for one parameter. I tested some approaches. I can change it's default value on HDA's definition object (using parmTemplateGroup). But there is also temporary default. I can set it up via UI by RMB --> Make Current Value Default. How do I create this temporary default via python?
-
- vikus
- Member
- 254 posts
- Joined: May 2017
- Offline
It seems there is no way to do it through python except to restore this to template defaults using parm [www.sidefx.com] or parmTuples [www.sidefx.com] methods.
Additionally you can define the default values using the node type events such as OnCreated and OnLoaded:

This also allows to set multi-parm defaults
Additionally you can define the default values using the node type events such as OnCreated and OnLoaded:
This also allows to set multi-parm defaults
Edited by vikus - Jan. 29, 2024 09:19:04
-
- rafaels
- Member
- 702 posts
- Joined: March 2009
- Offline
I tested this out in the python shell and it worked:
Basically you have to change the default of the parmTemplate that corresponds to your parameter, then replace it in the parmTemplateGroup, then replace your node's parmTemplateGroup with the modified one.
my_node = hou.node("path-to-your-node") my_parm_templ_grp = my_node.parmTemplateGroup() my_parm = my_node.parm("parm-name") my_parm_templ = my_parm.parmTemplate() my_parm_templ.setDefaultValue((12,)) # the new default has to be a tuple my_parm_tepl_grp.replace(my_parm.name(), my_parm_templ) my_node.setParmTemplateGroup(my_parm_templ_grp
Basically you have to change the default of the parmTemplate that corresponds to your parameter, then replace it in the parmTemplateGroup, then replace your node's parmTemplateGroup with the modified one.
Edited by rafaels - Jan. 30, 2024 01:07:05
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
-
- Quick Links


