Access to hou.ParmTemplate.conditionals() result

   1636   2   1
User Avatar
Member
2 posts
Joined: April 2017
Offline
Hello.

I am trying to modify the conditionals of the asset's parameters via Python.
The .conditionals()method returns a weird dictionary (set?).
How should I access the value using the key in such case?

Edited by romawind - May 25, 2022 11:37:54

Attachments:
shot_220525_022858.png (77.2 KB)

User Avatar
Member
2 posts
Joined: April 2017
Offline
Actually I've already found a solution. :S
Simple
for x, y in conditionals_dict.items():
    key = str(x)  # to compare with something like 'parmCondType.DisableWhen'
    value = y
works fine.

Hope this will be useful for someone someday.
User Avatar
Member
8539 posts
Joined: July 2007
Online
its a normal dictionary, just keys are not string, but instances of hou.EnumValue

so to get the value of you should do:
print(clr_type.conditionals()[hou.parmCondType.DisableWhen])
print(clr_type.conditionals()[hou.parmCondType.HideWhen])
Edited by tamte - May 27, 2022 00:34:01
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links