Jump to content

add Tag{} Parameter Interface with Python


vinshm

Recommended Posts

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'}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...