Skip to content

Loop In ​

The start of a Loop or For Each: runs the nodes wired between it and its Loop Out several times, carrying the result forward or collecting every pass.

Category: Loop Menu path: Loop > Loop · Loop > For Each Point · Loop > For Each Path

A Loop is a pair of nodes, Loop In and Loop Out, drawn inside a shared frame. The menu creates both at once. Everything wired between them is the loop's body, and it runs once per pass. A node belongs to the loop because of how it is wired, not where it sits: anything that depends on Loop In and feeds Loop Out is inside, and nodes that only feed the body from outside stay outside and are computed once.

Ports ​

PortTypeDirectionDescription
value (one per loop value)anyinputThe value entering the loop.
value (one per loop value)anyoutputThe value inside the loop, pass by pass. In Feedback mode it is the previous pass's result (the entering value on the first pass); in Join mode it is the entering value every pass.
indexscalaroutputThe pass number, starting at 0.
countscalaroutputHow many passes run.
normalizedscalaroutputThe pass as 0 to 1 across the run (0 when there is one pass).
count_inscalarinputLoop only: drives Count from a wire.
elementspoints / shapeinputFor Each only: the stream to walk.
elementpoints / shapeoutputFor Each only: the current point (one-point stream, with all its attributes and its id) or the current path.
positionvec2outputFor Each only: where the current point is, or the centre of the current path.

Parameters ​

ParamTypeDefaultDescription
iterateOverenumCountCount runs a fixed number of passes. Points runs once per point of the elements stream (For Each Point). Paths runs once per path of a shape (For Each Path).
countscalar4Passes to run, when iterating a count. Capped at 10,000.
modeenumFeedbackFeedback: each pass works on the previous pass's result. Join: every pass starts from the entering value, and Loop Out collects all of them.
joinBlendenumNormalJoin mode, image values: how each pass's picture is composited over the ones before it (Normal, Add, Screen, Multiply, Overlay).
previewPassscalar0Which pass the Node Preview panel and Debug nodes inside the loop show.

Loop Values ​

A loop value is something that travels through the loop: a shape, points, an image, a number, a vector or a colour. A loop starts with one value, In, which takes whatever you wire into it and becomes that type (unwire it completely and it is open again); + add value adds B, C… Each value appears as a matching port on Loop In and Loop Out. How it is combined at the end depends on the mode:

ValueFeedbackJoin
Shape / PointsThe last pass's resultEvery pass appended, in pass order
ImageThe last pass's resultEvery pass composited with joinBlend, later passes on top
Number / Vector / ColourThe last pass's resultThe last pass's result

A loop value that nothing inside the loop feeds passes through unchanged. An image value with nothing entering starts transparent.

How It Works ​

The engine runs the body once per pass with that pass's values injected at Loop In, then carries or collects what reaches Loop Out. Loops can sit inside other loops, and a loop inside another moves in whole: its In, Out and body always belong to the same enclosing loop. A wire that leaves a loop's body other than through its Loop Out gets nothing, and the status console says so.

Usage Examples ​

Basic: deform a shape twelve times ​

Rectangle → Loop In (Count 12, Feedback) → Shape Deform → Loop Out → Draw Shape. Each pass deforms the previous pass's result. Drive Shape Deform's amplitude from normalized so the effect grows through the run.

For Each: a shadowed shape at every point ​

Grid → Loop In's elements (For Each Point, Join). Inside: Circle → Transform 2D (position from position) → Draw Shape → Drop Shadow → Loop Out, with an image loop value. Every point gets its own shape and shadow, composited together. A Switch inside the loop, driven by index, can give different points different shapes.

Creative: recursive patterns ​

Feedback mode with Transform 2D (scale 0.9, rotate 15°) and Merge Shapes inside builds a spiral of copies, each one shrunk and turned from the last.

Tips ​

  • Nodes feeding the loop from outside (the Circle in the example above) are computed once and shared by every pass. Keep anything that does not depend on the pass outside.
  • Image nodes inside a loop recompute every pass. Very high pass counts with image effects are slow; For Each over thousands of points is usually better done with Clone To Points or Draw Instances.
  • Use previewPass to inspect one iteration; without it, a loop is a black box.
  • Loop Out — the other half of the pair
  • Solver In — the frame-to-frame counterpart: carries a value from one frame to the next
  • Switch — pick a branch per pass
  • Draw Instances and Clone Index — the older per-clone repeat, still useful for many identical copies