Sorry for the long title, but I had to elaborate somehow, because the question is now a bit broader.

Basically, it's about instantiating objects of a collection along a line.

This question has also been asked a few times, and (at least partially) answered:

However, there is only talk of threading one after the other without the instances overlapping.

For this, of course, it is necessary to determine the size of the instances somehow.

But the task becomes even more complicated if you want to rotate and scale these instances differently at the same time!

Thereby the space requirement changes with each instantiated object.

The questions therefore is:

How to string objects from a collection one after the other along a given axis, while respecting the following premises?

  • The direction in which the instances are threaded should be variable.
  • The instances should not overlap
  • The distance between the instances should be adjustable
  • The single objects should be scaled and rotated randomly
  • The objects should remain as instances at the end if possible

enter image description here


1 Answer 1


The task is to determine the space requirement (Bounding Box) of each object along a certain axis.

If you would not additionally rotate and scale the instances individually, you would actually only have to determine the width of a single instance and the issue would be settled.

But since you also rotate and scale each instantiated object individually, there is an individual space requirement for each object that has to be determined.

And you can solve this as follows:

  1. First you have to instantiate the objects from the collection. Since the space requirements of the objects in a collection are not known in advance, you simply do this with a predefined number of instances. In this example, I randomly instantiate various objects from a collection at a single point, but with a specific number:

    enter image description here

  2. Next, I scale and rotate the instances in their local coordinate system. Here I use randomly generated values for scaling and rotation:

    enter image description here

  3. And now comes the trick: I then scale all individually scaled and rotated instances on the global Y-axis and Z-axis to zero. Now all instances are reduced to one stroke. The original mesh is still there, but all points are squeezed together on one axis.

    enter image description here

  4. Then I realize these instances and determine with the extent of the object with the largest space requirement on the X-axis. With this value I create a new Mesh Line. The number of points of this line correspond to the number of instances.

    enter image description here

  5. At this Mesh Line I then instantiate the squeezed objects and additionally another Mesh Line consisting of two points. This additional Mesh Line also has a length that corresponds to the object with the maximum space requirement.

    So as a result, I have instantiated squeezed meshes at a line, each surrounded by two points:

    enter image description here

  6. And now the critical part: this construction now allows me to use the node Transfer Attributes to capture the closest point between the additional lines and the mesh of each object. Since I previously reduced all meshes on the X-axis to zero, I thus get the individual value of its extent on the X-axis for each individually modified object. I capture these distances with Capture Attribute in the measuring points.

    enter image description here

  7. Afterwards the final distance between the objects is calculated. For this I use in each case the extent of the previous object with the extent of the current object. Since the lines consist of two points, I multiply the index in each case by $2$. At this point I can comfortably define an additional distance between the objects. The first instantiated object gets the value $0$, of course.

    enter image description here

  8. Finally, the previously individually scaled and rotated instances are aligned to a certain axis. This direction is freely definable and the transformation is done here in global space. At the very end, I set the instances to the right position by simply scaling this direction vector with the final distance.

    enter image description here

The result and the node tree for it look like this:

enter image description here enter image description here

And of course here is the blend file:

(Blender 3.2)


You must log in to answer this question.

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