Parameters
The Switch node acts as a logic gate for your nodegraph. It acts like a if statement and can be used for creating systems that can handle errors, empty shapes, dynamic logic based on attributes.
It inspects the data coming into its Input 2 (“True” or target input) and decides whether to let it pass through or swap it with the data from Input 1 (the “False” or fallback input).
Tip: You can chain switch nodes to act like if/else if/else statements
Parameters
| Parameter | Description |
|---|---|
Label | The display name for the node. |
Group | Subset of the input geometry to check against. Supports patterns. |
Logic | How multiple conditions are combined. |
Logic Flow
- Input 1 (False/Fallback): Connect your default geometry here (an error message via text node, a placeholder shape, or an empty stream).
- Input 2 (True/Target): Connect the main geometry you want to check.
- Evaluation: The node runs the configured Conditions against the geometry in Input 2.
- Pass: If the conditions are met, Input 2 is output.
- Fail: If the conditions are not met, Input 1 is output.
Conditions
The Switch node evaluates the geometry based on specific criteria. You can choose what aspect of the geometry to inspect.
Check Types
| Type | Description |
|---|---|
| Geometry Exists | Checks if there is any valid data in the input stream. Useful for handling cases where a previous operation (like a Boolean intersection) might result in nothing. |
| Point Count | Checks the total number of vertices in the input. Useful for Level of Detail (LOD) switching (e.g., "If point count > 1000, show low-poly version"). |
| Shape Count | Checks the number of distinct shapes/paths in the stream. |
| Attribute | Inspects properties of the shapes. This is the most powerful mode. You can check standard properties like id or opacity, or custom attributes added by other nodes (like color, weight, or type). |
Operators
| Operator | Description |
|---|---|
| Greater Than | Strictly greater than the value. |
| Greater Than or Equal | Greater than or equal to the value. |
| Less Than | Strictly less than the value. |
| Less Than or Equal | Less than or equal to the value. |
| Equal To | Soft equality check. Works with numbers 4 and strings "4" |
| Does Not Equal | Inverted equality check. |
| Contains | Checks if a string attribute contains a specific substring (checking if a shape name contains "wheel"). |
Logic Combination
You can add multiple conditions to a single Switch node. The Combine Rule determines how these conditions work together to produce a final True/False result.
| Rule | Description |
|---|---|
| AND | Returns True only if all conditions are met. |
| OR | Returns True if at least one condition is met. |
| Not All (NAND) | Returns True if at least one condition fails (opposite of AND). |
| Not Any (NOR) | Returns True only if all conditions fail (opposite of OR). |
Group Scope
The Group parameter acts as a pre-filter. If you specify a group pattern (like star*) coming from a Group node, the Switch node will only check the conditions against shapes that match that pattern.
- If no shapes match the group pattern, the condition is considered failed (unless using
Geometry Existswith inverted logic). - If shapes match, the logic runs only on the matching subset.