Conditional
Route data flow based on a boolean condition.
What it does
Conditional picks between two values based on a boolean condition, a graph-native if/then/else. The condition is evaluated once and applied the same way to every channel. Any non-zero number, non-empty string, non-empty list or true boolean counts as true; zero, empty or false counts as false.
One condition can drive up to 8 independent channels. Raise Channels to add more if-true / if-false pairs, each with its own result output. Each channel passes whatever it is fed through as-is: an image stays an image, a list of points stays a list of points, with no resampling or reshaping.
When to use it
One boolean steering several unrelated values together, such as a colour, a number and an image from the same toggle
A/B between two upstream branches, driven by a Compare or Logic result computed elsewhere
More than a single in/out swap. For one value in and one value out, a plain Router may be simpler
| Parameter | Type | Default |
|---|---|---|
condition | Any | — |
channels | Number | 1 |
if_true_0 | Any | — |
if_false_0 | Any | — |
if_true_1 | Any | — |
if_false_1 | Any | — |
if_true_2 | Any | — |
if_false_2 | Any | — |
if_true_3 | Any | — |
if_false_3 | Any | — |
if_true_4 | Any | — |
if_false_4 | Any | — |
if_true_5 | Any | — |
if_false_5 | Any | — |
if_true_6 | Any | — |
if_false_6 | Any | — |
if_true_7 | Any | — |
if_false_7 | Any | — |
Gotchas
Only the first channel's Result is always present. Result 1 and beyond appear once Channels is raised, so set it to the number of pairs in use.
An unconnected branch reads as 0, or the equivalent empty value for its type, not as unset. Wire both the true and false side of a channel to avoid a silent zero.
Both branches of a channel should carry the same kind of value. Where they differ, the true branch's type wins for the result.
Worked example
Add a Conditional node and wire a boolean or a Compare result into Condition.
Wire the two candidate values into If True and If False for channel 0.
Connect Result to whatever should receive the chosen value.
To switch more than one thing at once, raise Channels, fill in the new If True / If False pair(s) and take their Result output.