[Sidefx-houdini-list] How to modify default value of parameter in HDA with hom

Lars van der Bijl com48com at gmail.com
Thu Nov 3 13:06:42 EDT 2016


have you tried setting it on the definition?

mn = hou.selectedNodes()[0]
deff = mn.type().definition()
parm_group = deff.parmTemplateGroup()
parm_template = parm_group.find('refl_brdf')
parm_template.setDefaultValue(('1',))
parm_group.replace(parm_template.name(), parm_template)
deff.setParmTemplateGroup(parm_group)


On Thu, Nov 3, 2016 at 4:56 PM, Sandy Sutherland <sandy.maillists at gmail.com>
wrote:

> Hi All,
>
> I have been trying to modify the default value of an existing parameter of
> an existing HDA using python - I have tried the following, which does not
> seem to work, even though it does seem to set it on the template, it is not
> written back to the parameter on the asset -
>
> import hou
>
> mn = hou.selectedNodes()[0]
> parm_group = mn.parmTemplateGroup()
> parm_template = parm_group.find('refl_brdf')
> parm_template.setDefaultValue(('1',))
> parm_group.replace(parm_template.name(), parm_template)
> mn.setParmTemplateGroup(parm_group)
>
>
> The default value is currently ('0',).
>
> Ideas?  Where am I going wrong?  I did start to investigate what the
> parm_group holds as basic, and seems to be a collection of folder
> templates, which you can grab, and in there are other folder
> templates........ in other words, diving into a rabbit warren.
>
> The simple method above, does find the correct parm template, I can print
> it and see everything, but it just does not set it back!
>
> Thanks
>
> S.
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list