I have a node setup that has multiple geometries combined with a Join Geometry node. I want to give each geometry a unique material, but I want to automate it so that for every object, the next material in an index is automatically assigned.

In other words, if there are multiple objects then object 1 is assigned MATERIAL 1, the second is assigned MATERIAL 2, and the third gets MATERIAL 3, and so on.

Is there a way to do this with nodes?


1 Answer 1


The node Set Material assigns a material to a geometry. However, exactly one material.

Therefore the node Set Material Index can only be applied to a geometry which has been assigned several materials before.

This can be either the geometry containing the Geometry Nodes modifier, but also geometry created in Geometry Nodes.

If you create geometry in Geometry Nodes, you have to assign several materials to it, which is possible by lining up several Set Material nodes and then selecting the respective slot with Set Material Index.

But this is not very flexible, because you would have to use many nodes in a row manually.

But there is a little trick:

enter image description here

Here you use the original geometry, to which several materials were assigned in the Material Properties before, as a base.

The trick is: By adding more objects afterwards with Join Geometry, or as in this example with Geometry to Instances, these inherit the materials of the base object.

In addition, these get their own index, which can be used here as Material Index at the same time.

The original geometry should not be used here in the end, so I mark it with the node Capture Attribute and remove it afterwards. The captured materials as well as their material index are kept in the rest of the geometry.

In this way I can assign each object its own material index, and the materials defined by you are taken from the Material Properties.

(Blender 3.3+)

  • $\begingroup$ This isn't as simple as I'd hoped but definitely workable, and I learned a thing, so thank you!! $\endgroup$ Nov 15, 2022 at 23:34

You must log in to answer this question.

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