9
$\begingroup$

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 ??

$\endgroup$
0

2 Answers 2

10
$\begingroup$

Let's see how to illustrate this. We will use this setup :

enter image description here

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

enter image description here

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 :

enter image description here

Put them in a collection and use collections instances (notice that the child cube is not instantiated, is that a bug ?) :

enter image description here


Object color

enter image description here

This can be used to individually tweak the objects. You can select it there :

enter image description here

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 : enter image description here


Object Index

enter image description here

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 : enter image description here

Material Index

I don't see how this could be used here.


Random

enter image description here

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 :

enter image description here

Quick fix, combine the random and position :

enter image description here

For more advanced effects (roughness, alpha value, animation) with these controls see my other answer here : https://blender.stackexchange.com/a/163699/86891

$\endgroup$
3
  • 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 Layer
    Commented Mar 1, 2021 at 20:31
11
$\begingroup$

You can assign materials to objects, rather than their data...

enter image description here

... it's the little dropdown on the far right, just above 'Deselect'.

$\endgroup$
6
  • $\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$
    – Gorgious
    Commented 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
  • $\begingroup$ @RobinBetts Done ! $\endgroup$
    – Gorgious
    Commented Mar 10, 2020 at 15:35

You must log in to answer this question.

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