Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
    
Cool, thanks! I knew it was possible. –  Oltarus Apr 24 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.