Instancing and Procedural Motion · Chapter 1 of 9

Instancing: One Object, Many Copies

Written for version 2.7.0

What an instance is, adding an Instancer to a node, Count and Seed, the Instancer FX graph, and a first row of copies with Instance Index.

The Rig Editor chapters made things one at a time: a mesh, its materials, its bones. This path is about having many of one thing, such as a row of posts, a stand of trees or a field of grass, without building each by hand. It starts with the Instancer, which draws one object many times over.

What an instance is

An instance is a copy that is drawn, not made. The model still holds one object. The Instancer draws it again and again, and gives each drawing its own place, turn and size.

The Node Hierarchy holds one Tree. The viewport shows eight, because the Tree carries an Instancer that draws it once per copy.
  • Change the original and every copy changes with it, at once. Edit the mesh, swap its material or reshape it, and the whole row follows.
  • The model stays small. Eight trees or eight hundred, the Node Hierarchy and the file hold one.
  • Where each copy goes is worked out by a small graph, not placed by hand. Change one number and the whole arrangement moves.
  • The graph can read the clock, so the copies can move on their own. Later chapters use this for wind and for things that react to other objects.

Duplicating the node does none of this. Each duplicate is a separate node to select, move and keep in step with the others, and a change to one stays with that one.

The prototype is a whole subtree

The Instancer belongs to a node, and what it repeats is that node together with everything parented under it. That bundle is called the prototype. In the picture above the Tree is an Empty with two meshes under it, a Trunk and a Crown, and all of it is drawn in each copy.

  • An Empty is the natural host. It draws nothing itself, so it can hold several meshes that travel together.
  • A mesh node can host an Instancer too. Then that mesh, and anything under it, is the prototype.
  • An armature cannot host one, and it cannot be parented under another node. To repeat a rigged mesh, parent the mesh bound to the armature under an Empty and give the Empty the Instancer. The armature stays at the top level.
  • The host node's origin is the zero point. A copy with no offset stands exactly where the host stands, and moving or turning the host carries every copy with it.

Add an Instancer

With the Empty selected, tap Add Instancer in the detail panel. The section fills in and ten copies appear, all standing in the same place.
  1. Make the small object you want repeated, and parent it under an Empty. The last chapter covers both.
  2. Select the Empty.
  3. In the detail panel, scroll to Instancer, below Transform.
  4. Tap Add Instancer.
  • Nothing seems to change in the viewport. There are ten copies now, but a new Instancer moves none of them, so they all stand on the same spot.
  • Enabled switches the copies off without losing anything. With it off the prototype draws once, where you made it.
  • Remove Instancer takes the Instancer and its graph away for good. Undo brings them back.

Count and Seed

Count sets how many copies there are. Seed reshuffles the random numbers in the graph: here they set each tree's size, so a new Seed gives a different stand of trees.
  • Count is a number field. Tap it, type a number and confirm. It runs from 1 to 10,000.
  • Seed is a whole number that feeds every Instance Random node in the graph. The same Seed always gives the same arrangement, on every device and in every render. A different Seed gives a different one that follows the same rules.
  • Seed does nothing until the graph uses Instance Random. The next chapter puts it to work.
CountWhere the number comes from
StaticThe number you type in Count
Vertex CountThe number of vertices in a mesh you choose under Counted Mesh. Edit that mesh and the count follows

Vertex Count is for putting one copy on every vertex of another mesh, which a later chapter builds. Until you choose a mesh the row reads static fallback and the typed Count is used.

The Instancer FX graph

Where the copies go is decided by a graph called Instancer FX. It is the same kind of graph as a material's: nodes, wires, and one output node. It runs once for every copy, and what reaches the output is that copy's transform.

Edit Instancer FX docks the graph under the viewport, named after the node. A new graph holds one node, Instance Transform.
  1. With the host selected, tap Edit Instancer FX in the Instancer section.
  2. The graph docks under the viewport. Its title is the node's name followed by Instancer FX.
  3. Tap an empty part of the canvas to add a node, and drag from an output dot to an input dot to wire two nodes together.
  4. Tap the pin at the right of the graph's bar to close it. The arrows beside the pin open it full screen.
Instance TransformWhat it sets for each copyWith no wire
PositionWhere the copy stands, measured from the host node along the host's own axes0, 0, 0: on the host
Rotation (deg)Its turn in degrees, about X, Y and Z. The three are combined in the order Y, X, Z, the same order a node's own rotation uses0, 0, 0
ScaleIts size along each axis1, 1, 1
VisibilityWhether it is drawn. 0.5 or more draws it, less hides it1: drawn
  • The Add Node card offers fewer folders here than in a material: Input, Parameters, Math, Logic, Channels, Texture Processing and Instance. The graph is worked out copy by copy, not pixel by pixel, so colour, noise and coordinate nodes are not part of it.
  • The Instance folder holds the nodes that tell copies apart: Instance Index, Instance Random, Grid, Node Transform and Mesh Vertex.
  • A hidden copy keeps its number. Hiding copy 3 does not turn copy 4 into copy 3.

A row of copies

Instance Index gives every copy its number, counting from 0. Multiply that number by a distance and you have how far along the copy should stand.

Add Instance Index, multiply Index by a spacing, put the result in X of a Construct Vector3 and wire it into Position. A larger spacing stretches the row.
  1. Tap empty canvas, open the Instance folder and choose Instance Index.
  2. Add a Multiply from Math and a Construct Vector3 from Channels.
  3. Wire Index into A of the Multiply. Select the Multiply and set B to the spacing you want, for example 1.5.
  4. Wire the Multiply into X of the Construct Vector3.
  5. Wire the Construct Vector3 into Position on Instance Transform.
  • Copy 0 gets 0 times the spacing, so it stays on the host. Copy 1 moves one step, copy 2 two steps, and so on.
  • Y and Z of the Construct Vector3 are left at 0, so the row runs along X only. Use Y for a stack, or Z for a row running front to back.
  • A number in the graph is changed by dragging up or down on it, as everywhere in the editor.
  • The row follows the host. Turn the Empty and the whole row turns with it.

Index, Normalized and Count

Normalized runs from 0 on the first copy to 1 on the last. Sent through Scale And Offset into the Y of a Scale, it makes the row grow taller.
OutputWhat it carriesGood for
IndexThe copy's number: 0, 1, 2 and so onSpacing copies evenly
NormalizedThe same position as a fraction, 0 on the first copy and 1 on the lastAnything that should run from one end to the other whatever the Count: a fade in size, an arc, a climb
CountHow many copies there areDividing a length or a circle into equal parts
  • Normalized stays the same shape when you change Count. A row that grows from short to tall still does so with twenty copies or two hundred.
  • With a single copy Normalized is 0.

Instancer or Instanced Offset?

A mesh's Modifiers list has an entry called Instanced Offset, which also repeats things. The two do different jobs.

InstancerInstanced Offset
Where it livesOn a node, in the Instancer sectionOn a mesh, in its Modifiers list
What it repeatsThe node and everything under itThat one mesh
What you getCopies that are only drawnReal geometry, joined into the one mesh
How copies are placedA graph, free for every copyOne step, repeated in a line
Can each copy differYes: place, turn, size and visibilityNo, each follows the last by the same step
Can it move over timeYes, the graph can read the clockNo
Can copies be welded togetherNoYes, with its merge distance
  • Reach for Instanced Offset when the result should be one solid object: a chain, a fence rail, a staircase.
  • Reach for the Instancer when you want many separate things, when they should vary, or when they should move.

Limits worth knowing

With Enabled off the Tree draws once, where it was made. With it on only the copies draw, but a tap on that first spot still selects the original and its outline shows there.
  • Count stops at 10,000.
  • An Instancer inside another Instancer's prototype does nothing. Only the outer one makes copies.
  • Picking and the selection outline stay where the original was made. Tap a copy and nothing is selected. Tap the original's own spot, or its row in the Node Hierarchy.
  • A light inside the prototype is repeated in every copy, and each one counts towards the limit on lights in a frame. The Instancer section says so when the prototype holds a light.
  • The copies are drawn, not built, so there is nothing to edit in Mesh mode beyond the one original.
  • A skinned mesh in the prototype follows its armature's current pose in every copy. Giving each copy its own pose is Pose FX, a later chapter.
Something unclear?

Tell us which node carried the Instancer, what was parented under it, the Count, and what the viewport showed instead of what you expected. A screenshot of the graph helps.

Send Feedback