3
$\begingroup$

I saw some similar questions to this, but nothing that quite fit. For example, suppose I have a material that is used by a number of objects, e.g., two shaders feeding a mixer. I want to animate the mix factor, but with different (non-random) keyframes for each object. I'm using Cycles.

If I keyframe the factor directly, it will use the same keyframes for all for all objects. I can duplicate the material for each object, but that's hard to maintain.

Node groups come close. I can encapsulate the material in a group and bring the factor out as an input, so I only have to maintain one material. But it appears that I still need a separate "wrapper" material for each object in order to set the keyframes. This is kind of cumbersome.

I thought a driver might help, with a keyframed custom property on each object; I had hoped that there was a way to tell it to use the custom property on the "current" object, but it requires a specific object.

I was also hoping the attribute node would give access to custom properties, but apparently not.

Any other ways?

Thanks.

$\endgroup$
1
$\begingroup$

You can get a random value that is unique to each object using the Object Info node.

enter image description here

You can also use a math node if you want to add the random value to a keyframed value change. The random value will be between 0.0 and 1.0 so you may also find multiplying helpful if you want a larger range.

enter image description here

$\endgroup$
  • $\begingroup$ Sorry, I wasn't clear. I want each object to be different, but I'll still be specifying the behavior; e.g., object1 changes at frame 24, object2 changes at frame 57, etc. $\endgroup$ – Jabberwock Jan 3 '15 at 14:20
  • $\begingroup$ [Sorry for the second comment, but I was AFK and the previous comment timed out] The node groups that I'm using now aren't a terrible solution, but I hate having to have separate wrapper materials for each object. It just seems like there should be a way to do it with one material. Thanks for your suggestion. $\endgroup$ – Jabberwock Jan 3 '15 at 14:38
  • $\begingroup$ If you want to control the frame an object changes then you will need to have keyframes that are valid for each object. Value nodes with keyframes that connect to a group would be the simplest approach. If you have a table of data you could use a script to create the keyframes. The barrier you have is that for an object you can access it's material data, but for a material you can't get back to the object using it, this prevents an object property driving the material. $\endgroup$ – sambler Jan 3 '15 at 14:56
  • $\begingroup$ Thanks. Just to make sure I'm not missing anything, I'd still need a separate material for each object (which would contain just the value node and group node), correct? True, a material can't get back to the object, but there are nodes that give object-specific information, like Attribute and Object Info. A node that retrieves objects' custom properties at least seems feasible (and useful). Think it's worth suggesting as an enhancement, or am I overlooking something? $\endgroup$ – Jabberwock Jan 3 '15 at 21:43
  • $\begingroup$ Yes you need the material and value nodes per object to hold the keyframe data. While they appear to be together blender and cycles work independently, cycles only sees the info that gets sent to it so the attribute node is limited to what it can get. This lists available data $\endgroup$ – sambler Jan 4 '15 at 7:33

Your Answer

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

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