Jump to content

add Tag{} Parameter Interface with Python

Recommended Posts

couldn`t find a way to add "Something" Tag{} in the Parameter Interface by Python,Can Somebody help Please?:lol:


Share this post

Link to post
Share on other sites

You can do this by modifying the hou.ParmTemplate for a parameter.  Consider a Float parm named "parm" that already has a tag of foo:bar set from the interface:

>>> parm = hou.parm('/obj/geo1/null1/parm')
# Get the hou.ParmTemplate for your parameter
>>> pt = parm.parmTemplate()
>>> pt.tags()
{'foo': 'bar'}
>>> tags = pt.tags()
>>> tags["new"] = "value"
# Update the tags
>>> pt.setTags(tags)
>>> pt.tags()
{'new': 'value', 'foo': 'bar'}
# Replace the existing tuple/template with the modified one.
>>> hou.node('/obj/geo1/null1').replaceSpareParmTuple(pt.name(), pt)
<hou.ParmTuple parm in /obj/geo1/null1>
>>> p.parmTemplate().tags()
{'new': 'value', 'foo': 'bar'}


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now