# Can I use object's Custom Properties inside Cycles materials?

I wonder if maybe the Attribute node in Cycles can bring in a Custom Property of an object.

I have a model that has an LED light, and I wish I could change the color of the LED on different instances of the model, without using different materials.

• – Ray Mairlot Nov 2 '17 at 17:18

An alternative to using the pass ID is using the object name and an OSL script. It is not very elegant either, but at least allows for setting multiple values. I have explained it here.

• I upvoted your post. However, including a summary of the method (copy paste it maybe) would be great. – Leander Sep 1 '19 at 16:50

Use the object's pass ID.

That's a less than elegant, jerry-jigged way of doing it, but I've managed to animate the emission of some cartoon stars independently with this, even they're sharing the same material.

I collect the objects pass ID with the Object Info node, then perform some operations on it so I can operate under an arbitrarily defined range of 100 to 110. You can use any range you want. Notice I have only 10 different brightness levels on my shader. If you need something smoother, get yourself a wider range.

After doing that, it's just a matter of setting the object's pass IDs and the material will react accordingly on a per-object basis. You can even animate them by hitting I on the pass ID field.

This approach has lot's of limitations, though:

• You'll waste some pass ID channels on this, and you'd better not use them elsewhere. Make sure you have them marked as used if you're on a larger project.
• You have a single channel to transfer information, so no complicated things like colors can be properly and freely animated.
• Also, the pass ID is an integer, and that means either using a large enough range if you need fine detail or going for a coarser animation.

But it's the best I've found until now.

There's a patch that adds exactly this functionality in the works:

https://developer.blender.org/D2057

• note that this has been in the tracker unchanged since juli 2016. – zeffii Oct 14 '17 at 19:12