Skip to content

Flow Nodes

Flow nodes control the execution path and structure of a graph. They allow you to repeat transforms, split points along a condition, or delegate work to a separate graph asset.


Loop

Loop

Category: Flow
Description: Applies a transformation to points iteratively.

Ports

DirectionNameType
InputInPoint
OutputOutPoint

Settings

FieldTypeDefaultDescription
iterationsint (1–20)3Number of iterations to run.
offsetPerIterationVector3(0, 0, 0)World-space position offset added per iteration.
rotationPerIterationVector3(0, 0, 0)Euler-degree rotation added per iteration.
scalePerIterationVector3(1, 1, 1)Scale multiplier per iteration. (1, 1, 1) means no change.
accumulatePointsbooltrueControls the loop mode (see below).

Modes

Accumulate mode (accumulatePoints = true)
Each iteration duplicates all source points, applying a cumulative transform at factor i+1. The total output count is sourcePoints × iterations. Use this to create arrays, scatter copies, or fractal-like repetition.

Iterative mode (accumulatePoints = false)
The transform is applied in-place to the same set of points, building on the result of each previous iteration. The output count equals the input count. Use this to move or rotate the same points over time.

Notes

  • Scale is computed as 1 + (scalePerIteration − 1) × factor, so a value of (1.2, 1.2, 1.2) adds 20 % per iteration.
  • Transforms are applied in TRS order: translate → rotate → scale.
  • The iterations range is clamped to 1–20 in the Inspector.

Branch

Branch

Category: Flow
Description: Routes points to different outputs based on an attribute threshold comparison.

Ports

DirectionNameType
InputInPoint
OutputTruePoint
OutputFalsePoint

Settings

FieldTypeDefaultDescription
sourceSelectorPPGAttributeSelectorBuiltIn(Density)The attribute to evaluate for each point. Can be a built-in property or a custom named attribute.
thresholdfloat0.5The value to compare the attribute against.
compareCompareModeGreaterThanComparison operator (see table below).

CompareMode Values

ValueCondition
GreaterThanattribute > threshold
LessThanattribute < threshold
GreaterOrEqualattribute >= threshold
LessOrEqualattribute <= threshold

IPPGAttributeConsumer

Branch implements IPPGAttributeConsumer. When sourceSelector targets a custom attribute, the attribute name is reported as consumed so upstream nodes can produce it correctly.

Notes

  • Points exactly equal to threshold are sent to False when using GreaterThan, and to True when using GreaterOrEqual.
  • Both output ports always receive a PPGPointData object (possibly empty). Downstream nodes that require points should tolerate zero-count inputs.
  • The True and False outputs share the same metadata as the input.

Sub Graph

Sub Graph

Category: Flow
Description: Executes another PPG graph asset as a nested sub-graph within the current graph.

Ports (Dynamic)

When a sub-graph is assigned, the Sub Graph node's ports are dynamically generated from the sub-graph's Graph Input and Graph Output nodes:

  • Each Graph Input node in the sub-graph creates an input port on the Sub Graph node, named after the GraphInput's portName.
  • Each Graph Output node in the sub-graph creates an output port on the Sub Graph node, named after the GraphOutput's portName.

If no sub-graph is assigned, fallback ports Input (Any) and Output (Any) are shown.

ExampleSub-graph containsSub Graph node shows
Simple1 GraphInput "Input", 1 GraphOutput "Output"Input (in), Output (out)
Multi-portGraphInput "Terrain", GraphInput "Mask", GraphOutput "Result"Terrain (in), Mask (in), Result (out)

Settings

FieldTypeDefaultDescription
subGraphPPGGraphAssetnullThe graph asset to execute. Graph Input/Output nodes inside it define the Sub Graph node's ports.

Behavior

  1. Data arriving at each input port is routed to the corresponding Graph Input node in the sub-graph (matched by port name).
  2. The sub-graph executes fully (instancers are skipped to avoid double-spawning).
  3. Data produced by each Graph Output node is routed to the corresponding output port on the Sub Graph node.
  4. Intermediate data produced inside the sub-graph is disposed after execution; only transferred output data and original input data survive.

Recursion Protection

  • A direct or indirect recursive reference (a graph calling itself) is detected at runtime and produces an error log. Execution is aborted for the offending node.
  • The maximum nesting depth is 16. Exceeding it also aborts execution with an error.

Notes

  • If subGraph is not assigned the node logs a warning and produces no output (execution continues).
  • Sub-graph execution failures (errors in child nodes) are reported as warnings and cause the Sub Graph node to return false, stopping the parent graph at that point.
  • The node accepts and outputs Any data type, so it can wrap graphs that operate on Points, Splines, or Surfaces.

Creating Sub Graphs

There are two ways to create a sub-graph:

  1. Select one or more nodes in the graph view.
  2. Right-click and choose "Collapse to Sub Graph".
  3. A save dialog prompts you to name the new graph asset.
  4. The selected nodes are moved into the new graph, with Graph Input and Graph Output nodes automatically created to preserve connections.
  5. A Sub Graph node replaces the selection in the parent graph, wired to the original upstream/downstream connections.

Constraint: The selection must have at most one entry point (incoming port) and one exit point (outgoing port). Selections with multiple entry or exit points will show a warning dialog. Use Merge nodes to consolidate data before collapsing.

Create New Sub Graph (from Inspector)

  1. Add a Sub Graph node to your graph.
  2. In the Inspector, if no sub-graph is assigned, a "Create New Sub Graph" button appears.
  3. Click it to create a new graph asset with Graph Input and Graph Output pre-placed (both set to Any type).
  4. The new asset is automatically assigned to the Sub Graph node. Double-click the node to enter and edit it.

Procedural Placement Graph for Unity