Method to retrieve parm's 'control' parm?

   789   1   0
User Avatar
Member
235 posts
Joined: Oct. 2014
Offline
Is there a method to retrieve a given USD parm's "control" parm? Maybe I'm missing it, but not seeing anything specific in hou.Parm. I can try predicting the name of the control parm based on the name of the USD attribute, but that's hit or miss.

EDIT: Or must all control parm names end in "_control"?
Edited by Tim Crowson - Aug. 25, 2022 18:35:43
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
8513 posts
Joined: July 2007
Offline
I'd assume it's just the _control extension to the parm tuple name (since I don't know of any special relationships between parms and there seem to be no tags present that would establish that)
since you are dealing with lop property names with potential special characters don't forget to decode/encode

so naively I'd say something like this may work, but you'll have to test it

# if parm is original parm

node = parm.node()
parm_tuple = parm.tuple() if isinstance(parm, hou.Parm) else parm
control_parm_name = hou.text.encode(hou.text.decode(parm_tuple.name()) + "_control")
control_parm = node.parm(control_parm_name)
print(control_parm.path())
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links