Switch

Conditional branching node. Routes growth to different subgraphs based on attributes, thresholds, or mappings.

The Switch node gates growth flow, acting like an if / else statement for the graph. It chooses between input graphs based on conditions evaluated per internode, so the recipe can react to its own attributes or environment ("if age > 5, switch to flowering logic", say). Conditions are evaluated in order; the first to evaluate true determines which input graph runs for that internode, and if none match the default path is taken.

Inputs

InputDescription
Input 0 (Graph A)Executed if the switch evaluates to false (or matches condition 0).
Input 1 (Graph B)Executed if the switch evaluates to true (or matches condition 1).

Attributes

Switch consumes attributes for gating; common inputs are:

AttributeDescription
ageCommon gating input.
uCommon gating input.
generationCommon gating input.
heightCommon gating input.
randomCommon gating input.

Outputs

OutputDescription
Output: GraphThe merged graph.

Parameters

Condition

ParameterDescription
Graph OperationInteger-based mode selector that toggles between Threshold and Snippet operations.
Graph Threshold (A)The mode of input comparison for threshold conditions. Includes attribute-based and scalar values.
Value (A)Scalar threshold for decision-making.
Attribute (A)The attribute to read (age, say). Uses geometry attributes for evaluation in threshold operations.
Threshold OperationThe operator for comparison: equals (==), greater than (>), less than (<), and so on.
Graph Threshold (B)Similar to Graph A; used in conjunction with secondary input conditions.
Value (B)The value to compare against. Secondary scalar for decision-making.
Snippet ConditionInline VEX for complex logic ((@age > 5) && (@height < 2), say). A scriptable input field for advanced user logic.

Notes

  • Threshold Mode is ideal for discrete, attribute-driven decisions.
  • Snippet Mode offers advanced customisation through scripting, suited to nuanced behaviours.
  • The first condition that evaluates to true determines which path is taken for each internode.

See also: Simulation concept · Split · Wrangle · Prune