Documentation / Node reference / geo nodes

geo/ForEachBegin

Opens a loop that geo/ForEachEnd runs once per point, primitive or object of this node's input.

Flow

Wire this node into the nodes to repeat, and point a geo/ForEachEnd's `beginNode` at it. The End then sets `index` to each entity in turn, cooks the nodes between the two, and merges what each pass produced. Outside the loop this node outputs the single entity at `index`, which is the pass the editor previews. Inside the body, read the current pass with `pv("../forEachBegin1/index")`, or read the entity itself with `attrib("../forEachBegin1", .ID, 0, .PRIMITIVE)` or `centroid("../forEachBegin1")`.

Parameters

Name Type What it does
entity UInt8 POINT · PRIMITIVE · OBJECT · STAGE What the loop runs over: each point, each primitive or each object of the input. Points and primitives count across all objects, first object first.
index UInt32 The pass to output. geo/ForEachEnd sets it on every pass and puts it back afterwards, so set by hand it picks the pass the editor previews. Past the last entity, the last one is used.

Examples

Scenes you can open in the editor that teach this node.

A loop that runs once per quad of a plane and writes each quad's number on it. geo/forEachBegin hands the loop one quad at a time, and the nodes in the loop read it by expression: the text takes the quad's ID, the transform takes its centre. geo/forEachEnd gathers what every pass produced.

geo/ForEachBegin geo/ForEachEnd

Modeling Attributes

See also

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.