changing HDA's parameter with Python

   4135   2   0
User Avatar
Member
12 posts
Joined: Nov. 2014
Offline
I have a HDA. In Python Module i put bellow code… It called as callback script when I change point counts in geometry and I want to update Max Value for HDA slider…

def updateMaxVal(kwargs):
# set new maxValue
hda = kwargs.type().definition()
t_group = hda.parmTemplateGroup()
t_parm = t_group.find(“frame_number”)
t_parm.setMaxValue(somevalue…)
t_group.replace(“frame_number”, t_parm)
hda.setParmTemplateGroup(t_group)

All work perfectly… But after setParmTemplateGroup(), another HDA parameter changes from ButtonStrip to Ordered menu. Why is this happening?
User Avatar
Member
12 posts
Joined: Nov. 2014
Offline
Update ..
Does not work the way I want.
The above code changes the hda file. But I want to change MaxValue only in the node instance.
User Avatar
Member
7801 posts
Joined: Sept. 2011
Offline
You don't want to change the hda definition parm template group for instance specific changes. Updating the definition modifies the file on disk, changing all instances of your asset. Local specific changes should be done to the node parm template group instead.

Dynamic parm templates generally are not recommended, especially not for changes to the input stream. The max value of a parameter is a convenience to make the slider easier to use most of the time, but it should not be a requirement to be mapped to a specific range.

As for the templates changing types when setting the parm template group, I believe this due to the python api for dialog scripts being incomplete. You should submit it as a bug to support.
  • Quick Links