Disable When

   9283   2   0
User Avatar
Member
2182 posts
Joined: Sept. 2015
Offline
Hello,

I was hoping someone might be able to help me with the syntax of using the ‘Disable When’ component in the Edit Parameter Interface of the parameter name “disable_parm” that I put in the sphere1 node.

I've tried many different approaches after looking through a number of searches and still no luck.

The one I currently have is an extract of an expression that does work if I use it in a parameter, meaning I can return a value of the ‘test’:

if hou.node("../null1").isGenericFlagSet(hou.nodeFlag.Display) == 1:
return 1

However if I put the following in the Disable When, not only does it not work, but after clicking on ‘Accept’ it adds backspaces to the code.

Apply and Before Accept(does not work):

{ hou.node("../null1").isGenericFlagSet(hou.nodeFlag.Display) == 1 }

Apply and After Accept(does not work):

{ hou.node(\"../null1\").isGenericFlagSet(hou.nodeFlag.Display) == 1 }


Thanks for any insight
Edited by BabaJ - June 3, 2018 12:22:21

Attachments:
Disable Parm Ref Display Flag Status.hiplc (61.5 KB)

User Avatar
Member
8354 posts
Joined: Sept. 2011
Offline
you can't put expressions in a disable when. You can only use parameter names and literal values. So you can't directly tie a disablewhen to a flag state (why would you?) But you can indirectly by making the disable when reference a parameter whose value is the flag checking expression. You can then hide the parameter with the expression to make it less unsightly.

for example, put your expression on a parm called ‘flag_is_set_parm’ and set the disable when to:
{ flag_is_set_parm }
User Avatar
Member
2182 posts
Joined: Sept. 2015
Offline
Thanks jsmack,

Yeah, just working on an HDA which is working as what I wanted, but I saw it might be able to use it in other situations with some changes that I'm not ready to explore at the moment.

So, I'm leaving in my debug code for when I need to return and test.

But with my debug code I might get crazy cook and wait times for other situations: This seemed like an easy/quick way to implement something to remind me in case I forget.
Edited by BabaJ - June 3, 2018 22:40:59
  • Quick Links