17
$\begingroup$

Suppose I have a beautiful node group that procedurally generates a plant (or building or whatever) for me:

enter image description here
PS: This plant is available here: Staggered palm frond leaves with Geometry Nodes?

Now I want to instantiate this object at the points of a grid or on randomly distributed points.

However, I want to use a different seed value for each instance so that not all objects look the same.

But when I try to feed my node group with a random seed value, it doesn't work. All objects look the same, and the random seed value is obviously ignored:

enter image description here

So the question is:

How can I use Geometry Nodes to instantiate a procedural object with different seed values so that the instances are different (Blender 3.0+)?

Note: This question (and answer) serves as a target for the recurring question regarding instantiation and variability, which is asked again and again in different forms, and should show as clearly as possible why it is not possible, and what workaround there is.

$\endgroup$

1 Answer 1

20
$\begingroup$

What is an Instance?

An instance is the reference to an existing object. This object exists only once.

An instance is therefore comparable to the Duplicate Linked function.

  • The advantage of this: The resource consumption remains low, because the geometry exists only once.
  • The disadvantage of this: The instances all look the same, because the geometry exists only once.

What does the 'Instance on Points' Node do?

So the node Instance on Points creates multiple references of the given object at the given positions.

Before that happens, the given object is converted to an instance, unless an instance is passed directly.

Unfortunately, when using the node, it is not possible to use procedurally created objects with different values per point. The object is created once, then transformed into an instance and moved to the desired position.

Ergo: One and the same object is always used per point, no matter what additional parameters are fed into the procedural node group.


(Instantiation of an object in a 3x3 grid)

The instances created in this way can then only be transformed (for example with Transform Instances, Rotate Instances and Scale Instances, but also with Set Position).

However, it is no longer possible to change the parameters as they were available at the time the object was created.

But if a change of the individual points of such an instance is subsequently necessary or desired, these instances can also be converted back into a mesh.

This is done with the node Realize Instances. However, it is not possible to selectively convert a single object, but all instances are always converted.

Note: If the originally instantiated objects were curves or points, they will be available again afterwards as individual curves or points.

In this way, individual parts of the geometry can be edited afterwards, which can be quite sufficient in some simpler situations, but is not purposeful in the case of complex node groups with individual parameters.

But how can procedurally created Objects be used?

This question can be answered currently only partially satisfactorily, since the node does not permit as mentioned a parameterization of individual objects when instantiating, and on the other hand also no loop node exists.

But: The node Instance on Points can process also several instances instead of a single instance!

This is made possible by simply supplying several instances instead of a single instance at the input Instance and additionally selecting the option Pick Instance.


(Instantiation of multiple instances with the option Pick Instance)

In order to be able to individually select the objects/geometries to be instantiated, they must be collectively transformed into selectable instances. This is done with the node Geometry to Instance:

However, the indices and the order of the provided objects are important: For example, if the number of provided objects is 2, and the number of points at which to instantiate is 9, the following object are chosen:

  • 0,1,0,1,0,1,0,1,0 (index always starts counting at 0)
  • or as seen in this example A,B,A,B,A,B,A,B,A.

This order is of course maintained for more than 9 objects and repeated accordingly.

The situation is different, if a variable value is also used for Instance Index. Then exactly that object is always selected for instantiation whose index matches the value passed:

To the Point

In plain language this means:

The currently only available "workaround" therefore means that each variation of the object created with the procedural node group must first be created, because only then can be selected from several objects in the first place!

There are two possibilities:

  • Either one creates the variations within Geometry Nodes
  • Or you use a Collection which contains the variations

Using Geometry Nodes

Here, the required number of objects with different seed values is created before instantiation, then collected with Geometry to Instance and then passed to the node Instance on Points.

Using a collection

Here the objects are in a Collection and each has the node group with its own seed values added as Geometry Nodes modifiers. Using Collection Info this collection is read and passed directly for instantiation.


It is important here that the Separate Children option is enabled!

Note that the order mentioned before is equal to the index of the instance and this order is determined by the name of the object, because the sorting is alphabetical here!


If the examples shown above are then visualized, the whole thing looks like this:


Creation of procedurally generated objects instantiated at different points with Geometry Nodes.

Or if you then add a higher density and random values for scaling and rotation, it can already look like this with nine different variants:


Update for Blender 4.0+

Since Blender 4.0 there are Repeat Zones, which are comparable to a For-Loop.

A new instance of the procedural node group is created for each loop and individual parameters can be used for each run.

A solution for this could look like this:

Here I use the number of points of the grid for the number of loops/iterations. The node group in this example has an input for Seed. In the first run, I use the value $0$ for this and with each subsequent run, this value is filled with a new random value between $0$ and $100$. Of course, there are different ways of generating these values per run, but how you set this up also depends on your procedural node group and which parameters you need here.

After the geometry has been created by the procedural node group, I convert it into an instance and add it to the existing geometry (which is empty at the beginning). At the output of the Repeat Zone, this geometry contains various instances that can be used directly with Instance on Points (Pick Instance must be activated).

$\endgroup$
4
  • 4
    $\begingroup$ +1 Great overview on how instancing works, as I often find questions here where people have problems with the concept of instances. $\endgroup$ Commented Sep 14, 2022 at 6:32
  • 1
    $\begingroup$ Could you add a repeat zone as a possibility to create different instances? $\endgroup$
    – Leander
    Commented Feb 22 at 16:51
  • 1
    $\begingroup$ @Leander Unfortunately, at the time this answer was written, no repeat zones existed yet, and yes, this can of course be solved with repeat zones. However, the concept of instances would be a little misguided. But you're right, it would be a good addition to this post. ...I'll take care of it and add Repeat Zone. $\endgroup$
    – quellenform
    Commented Feb 22 at 17:08
  • $\begingroup$ Thank you - I'm glad that my question (blender.stackexchange.com/questions/312406/…) was not completely a stupid duplicate, and that things have indeed changed since 2022 :) $\endgroup$ Commented Feb 22 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .