I use Blender 3.1.2, in case this matters. Please see the attached blend file.
SetMaterialIndex.blend (957.0 KB)
I created an object, that is the template for several objects I want to instance in geometry nodes. This template object has three materials assigned to the first three slots and each of these materials has another pass index (0 to 2).
Now I create several points with geometry nodes and instance my template object to these points. After the “Instance on Points” node I have a “Set Material Index” node. I plugged a “Random Value” node into the “Material Index” socket, the random value creates integers from 0 to 2.
But now each face of each instanced object does have a random material.
Following the documentation for the “Set Material Index” I can change that by plugging a “False” into the “Selection” socket. But if I do so, each object does have the material in slot 0, so no randomness at all.
So, how can I instance several objects in geometry nodes and give each object (not each face of each object) a random material?
Thank you.