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?
changing HDA's parameter with Python
4135 2 0- Voldemar13
- Member
- 12 posts
- Joined: Nov. 2014
- Offline
- Voldemar13
- Member
- 12 posts
- Joined: Nov. 2014
- Offline
- jsmack
- 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.
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