CloneIndex
The per-copy iteration variable: outputs which instance is currently being evaluated, so a DrawInstances source chain can vary per clone — a "for loop" over copies.
Category: Utility Menu path: Utility > Clone Index
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
index | scalar | output | Current clone index, 0 … count−1 |
count | scalar | output | Total number of clones (the point count) |
normalized | scalar | output | index ÷ (count−1) — 0 at the first clone, 1 at the last |
random | scalar | output | Seeded per-index hash in [0, 1) — stable per clone, independent of neighbors |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
seed | scalar | 0 | Seed for the random output |
How It Works
Place a CloneIndex anywhere in a chain feeding a DrawInstances node. DrawInstances detects it and switches to per-clone evaluation: the source chain re-runs once per instance with index set to 0, 1, 2, … so anything wired from CloneIndex — a Math expression into a shape's radius, a rotation, a color ramp position — takes a different value in each copy.
Outside a per-clone evaluation (previewing the chain directly, or with perClone set to Off) the node reads index 0 of count 1, so the graph still renders sanely.
Usage Examples
Basic: five copies, each rotated by its index
CloneIndex.index → Math (Multiply ×15) → Transform2D.rotation_in inside the source chain of a DrawInstances over 5 points: copy 0 sits at 0°, copy 1 at 15°, copy 2 at 30°…
Ramped sizes across a grid
CloneIndex.normalized → Math (Remap 4→40) → Circle.radius_in → DrawShape → DrawInstances ← Grid: circles grow smoothly from the first grid point to the last.
Per-copy random variation
Wire random into any parameter for stable, per-copy randomness that doesn't flicker over time (unlike a Noise sampled per frame).
Tips
- Per-clone evaluation runs the source chain once per instance every frame — the cost is N × chain cost. Keep the chain light, or cap it with DrawInstances'
maxClones(excess clones share renders round-robin). - For variation that's just scale/rotation/opacity/color per point, PointAttributes with an Index-mode ramp is far cheaper — it varies attributes without re-evaluating the chain. Reach for CloneIndex when the content of each copy must differ (different geometry parameters, different effect settings).
- Combines with DrawInstances time offsets: each clone gets both its own index and its own time offset.
- DrawInstances'
selectionModecontrols which clone render each point shows: Sequential = in point order, Random = seeded shuffle, Point Index = the index written on each point (via PointAttributes' Index target — assign variants spatially with a field).
Related Nodes
- DrawInstances — the consumer that activates per-clone evaluation
- PointAttributes — cheaper index-driven variation for transform-level differences
- Time — the analogous "context variable" node for time instead of clone index