AnimGraphLab Alpha
Nodes Switch

Parameters

Select a node to edit its 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

ParameterDescription
LabelThe display name for the node.
GroupSubset of the input geometry to check against. Supports patterns.
LogicHow multiple conditions are combined.

Logic Flow

  1. Input 1 (False/Fallback): Connect your default geometry here (an error message via text node, a placeholder shape, or an empty stream).
  2. Input 2 (True/Target): Connect the main geometry you want to check.
  3. 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

TypeDescription
Geometry ExistsChecks 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 CountChecks 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 CountChecks the number of distinct shapes/paths in the stream.
AttributeInspects 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

OperatorDescription
Greater ThanStrictly greater than the value.
Greater Than or EqualGreater than or equal to the value.
Less ThanStrictly less than the value.
Less Than or EqualLess than or equal to the value.
Equal ToSoft equality check. Works with numbers 4 and strings "4"
Does Not EqualInverted equality check.
ContainsChecks 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.

RuleDescription
ANDReturns True only if all conditions are met.
ORReturns 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 Exists with inverted logic).
  • If shapes match, the logic runs only on the matching subset.

See also