Collection Instance Pass Index not working? Bug or feature?

Hello,

Running into a wall using collection instances of a relatively complex object, and wondering if it’s a bug or a feature: I want to display a few collection instances, assigning Pass Index for each instance and using Object Index from an Object Info node as a mix factor in the materials of the objects, showing different variants of the same material on each instance. This works if it’s a duplicate, either linked or not, but does nothing if using a collection instance.

Inside the Object Info, Random also adds the variation to the instances, so why does random assing different values to each collection instance instead of just one random value to the original and copy that, and pass index just gets overwritten by the index of the original, ignorning the different value I assigned?

Is this a bug? Is this a feature? If it’s a feature, is there a specific reason why this behaves like it does? Any ideas or workaround on how to make Pass Index work for Collection Instances? What am I missing here? Looks like a perfect use case of collection instances and it’s unusable :frowning:

Note 1: Yes I could just group and manually copy the object, but then modifiers and other things don’t get update automatically, and performance is not as good.
Note 2: I can control color inside one material for each instance using Color from Object info node and changing in viewport display, but I need the ID value so I can use it for other things apart of color.

Many thanks for any clarification!

2 Likes

run into the same issue
Apparently it was fine with 2.79 version

No, it was same in 2.79. A group instance was an empty with dupligroup option enabled.
In 2.8, 2.9, a collection instance is still an empty with an Instancing > Collection option enabled.

Nothing has changed. Pass Index info is still ignored by Object Info node for empties.
Because an empty can not handle a material. It can not be the object, material is linked to.
This was simply something that was not supported.

Now, in 2.92, you can use an attribute node instead of an object info node.
https://docs.blender.org/manual/en/latest/render/shader_nodes/input/attribute.html

Replace Geometry by Instancer. In name field, type pass_index.
Now, it should work as you want.

1 Like