2
$\begingroup$

I'm trying to procedurally generate a scene with several objects (cubes for now!) sharing a single material, but appearing and fading out at different times. So far, I have been able to place the objects and show them at the correct keyframes. See below for the current state of the scene.

Several cubes, with keyframes controlling custom glow value

Now I want to change their "glow" values independently of each other. If it's possible, I would like to use a custom glow property for each object, and have that drive a Value node in the material they share.

In other words, object Cube should set glow = 1.0 at frame 0 and glow = 0.0 at frame 5, Cube.001 should set glow = 1.0 at frame 14 and glow = 0.0 at frame 19, etc. So the scene would show several cubes, all at different levels of glowing. That value would drive the Value node in the material tree for each object.

After reading through a lot of questions and answers on StackExchange, I learned that there isn't a material node that can read an object's custom property. I also tried setting up a Value node (like in the screenshot) and using a driver from a custom property, but it can only be driven by a single object at a time.

So is there some way to have multiple objects pass their own property to a single instance of a material? I'm not familiar enough with the data model to know if it is. Maybe the driver scripted expressions could work, but I can't find enough documentation on them to be sure.

I can clone the material once for every object if I absolutely have to, but I would definitely prefer defining it only once to keep the scene clean. I want to swap out the cubes for more interesting objects with multiple materials, so cloning materials will become harder.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.