8
$\begingroup$

I have to display several versions of the same object, with only the color changing. My first approach was to duplicate the mesh and add a different material to each.

My problem is: when I want to modify the mesh, I have to do it on each object separately. I tried to have different objects with the same mesh, but the color seems to be linked to the mesh and not to the object.

Is there a way (even programmatically) to have the same mesh in different objects with different colors?

Additionnal info:

I'm using Cycles and my material is a node material in which there is only one changing color.

$\endgroup$
1

1 Answer 1

12
$\begingroup$

You have a couple options:

One material:

You can set a unique index per object in Properties > Object > Relations:

enter image description here

Using the Object info node, you can get this value in the node tree and use it to mix colors (or shaders) accordingly (also see Get "Object Color" property in Cycles).

Using three linked cubes (duplicated with AltD) with the same material as an example:

enter image description here

Note that this node setup is a lot cleaner and easier to manage when node groups are used.

Multiple materials:

By setting the material to link to that specific Object instead of it's data, which is shared by the other linked objects, you can have separate materials on separate objects which share the same mesh/data.

Just select Object in the menu to the right of the material selector:

enter image description here

$\endgroup$
0

You must log in to answer this question.

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