With Parameter Visibility Expressions (short VisEx), you can automatically reconfigure the UI based on the configuration of a node, this applies to both Elements and Atoms. For example you can hide parameters that are not relevant to the current configuration and remove clutter, e.g. based on the value enum or boolean (or any other parameter).
VisEx are supported for all Input and Output parameters and will be reflected in the Graph Object Editor as well as the Canvas.
The VisEx can be displayed in Graph Variable Editor once a parameter has been selected in the Graph Object Editor.
The VisEx syntax supports complex expressions chained by logical operators and advanced features such accessing vector components with a familiar C-field notation:
Resolution.X > 10 && StepCount == 5
Mode == 0 || Mode == 2
The following is a table of possible condition options:
Option | Description | Use |
---|---|---|
&& or AND | Both sides of the condition must be true | Chaining |
|| or OR | One of the sides of the condition must be true | Chaining |
> | Greater than | Condition |
< | Less than | Condition |
<= | Less than or equal to | Condition |
>= | Greater than or equal to | Condition |
!= | Not equal | Condition |
Important Remarks:
- For Enum values, the index number in the enum is used (from 0 to n-1).
- For Boolean values, the type is compared to an integer - e.g 1 for true and 0 for false
VisEx also support parenthesis to define the logical order of the condition
Mode == 0 || ( Mode == 1 && StepCount > 0 )
When using parenthesis make sure to have a space before and after the
(
and)
characters.
Besides querying graph parameter values, VisEx enables querying select properties of the graph itself:
.IsGrayscale
boolean.IsLayering
booleanTo be sure the expressions are valid you'll need to instantiate the atom/element, after it will show an error(s) in the console with what expressions are not valid:
The following example makes a paremeter that controls the water color visible if the WaterLevel
parameter is set to a value greater than 1:
WaterLevel > 0.00
This parameter will then stay invisible as long as the WaterLevel
parameter is set to 0%, but become visible as soon as the water level increases.
The next example makes a parameter that controls the opacity of a shore wetness mask visible if the WaterLevel
is greater than 0% AND the WaterLevelShoreWentess
parameter is greater than or equal to 50%.
WaterLevel > 0.00 && WaterLevelShoreWetness >= 0.50
This parameter will only be visible if both the water level is higher than 0 and the shore wetness is 50% or above.