Digital Asset Disable/Hide Property

   20102   10   4
User Avatar
Member
53 posts
Joined: July 2005
Offline
Hey guys quick question.

How do I use the hide or disable paramater properties under certain conditions.

I see that The Disable When and Hide When are there, but how do I use them? I wanted to use a toggle for a property, but also to disable a whole bunch of other properties when this toggle would be on, and to enable others.
-m-k-
User Avatar
Member
8532 posts
Joined: July 2007
Offline
here is the reference for syntax you need to use in Disable/Hide When
http://www.sidefx.com/docs/houdini13.0/ref/windows/optype#conditionals [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
53 posts
Joined: July 2005
Offline
Thank you very much
-m-k-
User Avatar
Member
3 posts
Joined: Nov. 2014
Offline
Sorry to rez, but I'd like to expand on the question. Under the “Hide When” on a property, can you put in a condition to hide a property when the digital asset's input is being used?

My digital asset has one input and if there is something plugged in to that input, I want to use the dimensions of the input's bounding box. If, however, there is nothing plugged in to the input, I want to show the user a Vector 3 for dimensions.
User Avatar
Member
1694 posts
Joined: March 2020
Offline
ConcernedCitizen
Sorry to rez, but I'd like to expand on the question. Under the “Hide When” on a property, can you put in a condition to hide a property when the digital asset's input is being used?

My digital asset has one input and if there is something plugged in to that input, I want to use the dimensions of the input's bounding box. If, however, there is nothing plugged in to the input, I want to show the user a Vector 3 for dimensions.

The way we do this in our assets is we create hidden (invisible) integer parameters (e.g. “_has_1st_input”) with a default expression that returns non-zero if the input is connected ( e.g. strcmp(opinputpath('.', 0), “”) ). Then we refer these parameters in the Disable When and/or Hide When fields (e.g. { _has_1st_input == 0 } ).

(I might remember the strcmp() results incorrectly, but the main idea is the same.) But I'm always open for better solutions

cheers
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX

qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
User Avatar
Member
678 posts
Joined: July 2005
Offline
riviera
The way we do this in our assets is we create hidden (invisible) integer parameters (e.g. “_has_1st_input”) with a default expression that returns non-zero if the input is connected ( e.g. strcmp(opinputpath('.', 0), “”) ). Then we refer these parameters in the Disable When and/or Hide When fields (e.g. { _has_1st_input == 0 } ).

(I might remember the strcmp() results incorrectly, but the main idea is the same.) But I'm always open for better solutions

I'm using toggle and I'm updating it in OnCreated and OnInputChanged. Both call function from PythonModule called CheckInputs(), which updates toggle. With Python I have a little more control on what input is connected and should it update or not.
User Avatar
Member
8532 posts
Joined: July 2007
Offline
I usually use hidden parm with expression too and it works pretty well unless the expression evaluates something expensive, but for checking connected input it's perfect

the problem with python callbacks is that it will not work if you nest your asset inside another locked asset since it will not have permission to change the parm value, and you don't want to be promoting these hidden parms just to be able to set it, so just keep that in mind
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
678 posts
Joined: July 2005
Offline
tamte
the problem with python callbacks is that it will not work if you nest your asset inside another locked asset since it will not have permission to change the parm value, and you don't want to be promoting these hidden parms just to be able to set it, so just keep that in mind

o_O

You cannot also disconnect asset if it's inside another locked asset, so why bother with adding functionality like this on it? Only parent can be disconnected, so whatever you do, you have to grab parent and while you are it, why not check parameter on it?
User Avatar
Member
8532 posts
Joined: July 2007
Offline
it was just generic warning about explicitly setting parameter values on assets using python callbacks

OnInputChanged() would still be triggered if the asset is inside of locked asset and connected directly to it's indirect input (even nested multiple levels), so it can still error out

it's just something to keep in mind while designing a flexible asset that someone may decide to use within another one
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
16 posts
Joined: March 2016
Offline
Apologies for the thread necromancy…

Been trying to figure out for a while now how to disable specific field(s) within a parameter. A great example of this already working in Houdini is the Time Shift SOP. When the Clamp menu is set to “Clamp to First”, the second field of the Start/End Frame parameter is disabled; when the Clamp menu is set to “Clamp to Last”, the first field is disabled.

How is this achieved?

As far as I tested, the help docs at http://www.sidefx.com/docs/houdini13.0/ref/windows/optype#conditionals [sidefx.com] allow you to disable the entire parameter based on one or more conditions, but I haven't seen how to disable just a specific field of a parameter, because I can only specify the conditional parameter, not the affected parameter.

What am I missing here?
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Unfortunately, there's currently no way to disable/enable or hide/unhide specific components of parameters outside of the HDK. Sorry! Feel free to submit an RFE for it, though.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
  • Quick Links