When Exposing Parameters, you may want to hide or show parameters based on the status of other parameters. For example a slider only showing when a Button is turned on; it has no effect otherwise and might confuse user.
With Visible If you can add conditions to parameter visibility, keeping a clean, functional UI.Visible If works for Parameters as well as for Input and Output nodes (connections) on Graphs. Complex conditions are possible, but you need to write your own logical expressions for Visible If.
Visible If functionality works inside Substance Designer, Substance Painter, Substance Player and Substance Alchemist. Some Integrations such as Maya support it, others such as 3DS Max and Unity do not support it: parameters will simply always be visible.
Writing Visible If Expressions
Accessing Input Parameters
Any Visible If Expression will need to use at least one input, this can be done through the following syntax:
The "Visible if" fields accepts the following parameters:
- Boolean, Float and Integer inputs.
- true and false values (case sensitive, no caps!)
- .x : access the subparameter
- && : and
- || : or
- ! : not
- <, >, <=, >=, ==, != : comparison
- () : brackets
Must always evaluate to booleans
A Visible If Expression is used as the condition for an "IF" statement, that means it must always result in true or false. An Integer or Float value will result in an error.
- For a Boolean input, you can directly evaluate it as the condition. A simple button with a boolean value requires no more than this. See below examples, first case.
- For any parameter value other than booleans, you must add additional comparison operators. See above for comparison operators, below for examples.
|"MyInput" is set to True||MyInput is a boolean|
|"MyInput" is set to False||MyInput is a boolean|
|The value of "MyInput" is lower than 3||MyInput is a Float1 or Integer1|
|The value of "param1" is equal to 2||MyInput is a Float1 or Integer1|
|The Y value of "MyInput" is lower than 3||MyInput is a Floatx or Integerx where x>=1|
|"param1" OR "param2" is set to True||param1 and param2 are booleans|
|"param1" is higher than 0 AND "param2" is higher than 1||MyInput is a Float1 or Integer1|