I have an object and I made instances of it, but everything is connected, shape & material...etc, how to assign different materials to those instanced objects ??
2 Answers
Let's see how to illustrate this. We will use this setup :
A cube parented to a plane, then the plane is set to "Instance" its children on each of its vertices. As you noticed you can't directly access the instantiated cubes unless you make the instances "real", but then you can't go back.
Let's circle the "Object info" output to see how we can use it to our advantage to differentiate each of the instantiated cube.
Note : I don't know if this is a bug or intended, but child objects under instancers are not instantiated when using a "Collection Instance" (Add > Collection Instance or SHIFT + A. More on that later.
Location
So the location output takes the XYZ world location of each object's origin. In this case we use it so the XYZ values are translated to a RGB value.
See it in movement :
Put them in a collection and use collections instances (notice that the child cube is not instantiated, is that a bug ?) :
Object color
This can be used to individually tweak the objects. You can select it there :
The instantiated cubes will take the color of their instancer, so they will all share the same color. But you can make individual instancers have different colors.
In collection instances, this breaks. I don't really understand since in this method, the instances share their color with their instancers :
Object Index
This one works differently, here the instancer does not matter. The instantiated cubes will share the same color as their origin, child cube. The object pass index can be used in the compositor after rendering, too.
Inside collection instances, the effect still works but the child cubes are not instantiated :
Material Index
I don't see how this could be used here.
Random
This will give you a random value between 0 and 1, per object, including instances. You will have the most variety here, but also the least control over the effect.
When using collection instances, a different value is picked for each object, but each subsequent collection instance will have the same random value. The child object is still missing :
Quick fix, combine the random and position :
For more advanced effects (roughness, alpha value, animation) with these controls see my other answer here : https://blender.stackexchange.com/a/163699/86891
-
1$\begingroup$ ... And how! There are 'pop' s... and there are POPs! :D Jeez! $\endgroup$– Robin Betts ♦Commented Mar 10, 2020 at 16:39
-
2$\begingroup$ I'm amazed !! This is remarkable !! Can't thank you enough fro the clear instruction, bro :) I will definitely give it a test :D $\endgroup$ Commented Mar 12, 2020 at 5:21
-
$\begingroup$ @YoungGilgamesh Did it work out? Accept the answer if it did! $\endgroup$– B LayerCommented Mar 1, 2021 at 20:31
You can assign materials to objects, rather than their data...
... it's the little dropdown on the far right, just above 'Deselect'.
-
$\begingroup$ I suppose that's duplicate linked, right ?? because when i use "instance to scene", there's no material panel when I clicked instanced object. $\endgroup$ Commented Mar 10, 2020 at 6:44
-
1$\begingroup$ I think you can't assign different materials to different instanced objects. However, you can use the outputs from the "Object Info" node in order to differentiate between each of them. $\endgroup$– GorgiousCommented Mar 10, 2020 at 7:46
-
$\begingroup$ @YoungGilgamesh ahh, yup, misunderstood your post.. Gorgious to the rescue. $\endgroup$– Robin Betts ♦Commented Mar 10, 2020 at 8:12
-
1$\begingroup$ @Gorgious .. you could pop in an answer illustrating that? $\endgroup$– Robin Betts ♦Commented Mar 10, 2020 at 8:14
-