Access to hou.ParmTemplate.conditionals() result
1595
2
1
romawind
Member
2 posts
Joined: April 2017
Offline
May 24, 2022 7:33 p.m.
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)
romawind
Member
2 posts
Joined: April 2017
Offline
May 25, 2022 11:45 a.m.
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.
tamte
Member
8449 posts
Joined: July 2007
Online
May 27, 2022 12:33 a.m.
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