1
$\begingroup$

I have two different objects that share exactly the same material, so same nodes. I have let's say one emission node, is it possible to get different values for both objects while still keeping the same material ?

$\endgroup$
5
  • $\begingroup$ Sure. On the material Properties panel you'll see a '2' beside the material name if two objects are sharing one material. Click on the '2' and a duplicate material will be created for the second object called 'Material.001' (or whatever). You'l now find that you have two materials with identical node setups but different names for the two objects and you can change the settings for one without changing the other. $\endgroup$
    – John Eason
    Commented May 20 at 18:44
  • $\begingroup$ I am trying to do this while still keeping the same material $\endgroup$ Commented May 20 at 20:23
  • $\begingroup$ You can't keep the same material if you want different settings for it on different objects! That's why you're effectively creating a duplicate material for the second object. $\endgroup$
    – John Eason
    Commented May 20 at 21:46
  • $\begingroup$ Yeah too bad, was pretty confident there wasn't any way of doing this but still wanted to ask anyway. thx for trying to help still ! $\endgroup$ Commented May 20 at 22:24
  • $\begingroup$ you could make a node group out of the material and plugin your desired value to the input of the node group. Yes, you would have 2 materials, but you still have the "same" material/nodegroup inside, which still can influence both materials. Maybe that helps. $\endgroup$
    – Chris
    Commented May 21 at 8:53

2 Answers 2

3
$\begingroup$

You can store a per-object variable as a Pass Index, which is accessible by your material, via an Object Info Node:

enter image description here

Or, one way or another, you could store the variable on the object's geometry, in which case you have the option of varying the material across the object's surface, possibly in a different way, per-object:

enter image description here

That would be read via an Attribute node in the material. (,here, The attribute's name is for convenience only, you can call it whatever you like.)

You can assign more geometry-attributes if you need them, and combine and/or map them to influence any material settings you like.

.. so, for example, these two objects are in the same orientation, and share the same material:

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you so much for your help! $\endgroup$ Commented May 23 at 14:05
3
$\begingroup$

Yes, of course this is possible. In the following image, both spheres have the exact same material called "red light". But the emission is driven by two Attribute nodes, one which the manipulates the Hue of the given color, and one which sets the Strength on the Emission node:

same different materials

The crucial thing to achieve this is, the material needs an Attribute node (or several, depending on how many individual values you want to manipulate) set to Type: > Object (in this case Instancer works too, but not always) and the Name of the attribute must reference an attribute which is added as custom property in the Object Properties, so both objects need to have these Custom Properties. In this example, the left sphere has a "hue" value" of 0.5 (leaving the original color) and a "strength" value of 0.5, the right sphere has a "hue" value of 0.15 (changing the color) and a "strength" value of 20:

different properties

By default, when you click the New button under Custom Properties, a new property is created set to Float values and a Min and Max values of 0 and 1. But clicking on the cog icon to the right lets you edit these settings, the name, the data type, the min/max range.

I've used the hue change for changing the color, you can also make properties for saturation and brightness. You can also insstead of Float use the data type Float Array, which gives the property multiple float values (3 by default), so you could use this to enter RGB values directly. In this case you have to use the Color or Vector output of the Attribute node.

The good thing with this method is, you can even use drivers to change the properties on the objects individually. If you would use drivers directly in the material, it would be one driver changing the material on all objects together, not separately.

$\endgroup$
1
  • 1
    $\begingroup$ tysm !!! combining this with Robin Betts answer basically gave me what I was looking for $\endgroup$ Commented May 23 at 14:05

You must log in to answer this question.

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