0
$\begingroup$

I have an object collection (let's call it a Red Cube for simplicity) which has a "blinking" animation (via emission material + keyframed mix shader).

Now, I want to create several instances of that collection, and be able to have a different animation timing for each instance.

For example, one might blink for a second every 5 seconds, another one blink twice every 10s, etc.

Is there any way I can accomplish this, without having to create a new material (and object using it, and collection...) for each new light pattern I want to create?

Ideally (at least, in my mind) there would be a way to attach some kind of "argument" to an instance, describing how the light should behave -- that can be used by the material to control the animation, if that makes any sense..?

Model:

Model

Material:

Material

$\endgroup$
0
$\begingroup$

Sure. Check it out:

enter image description here

There are a number of different ways to identify exactly which emitters you want behaving this way or that, but I think that using UV is the easiest, particularly with 2.8 improvements. Here, I'm using the UV.x position of each object, which has been shrunk to 0 with individual origins pivot, to decide what period to use for the sine wave that I'm using to drive emissions. Everything is driven from a single value node, where I just entered #frame to get my current frame count.

You can use something other than UV to identify which objects you want behaving which way, like object ID or position or vertex color. I just find UV easy to use and flexible. If you're using UV already, just create a new UV map; but if you're using linked objects, you'll need to use a different identifier.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks @Nathan, yeah the problem mostly boils down to: "what can I add to a linked object to make it behave differently". I tried custom properties + driver, etc. but it seems you can only affect the collection instance, which is not accessible from the material nodes... $\endgroup$ – redShadow Sep 8 '19 at 10:35
  • $\begingroup$ What I'm looking for, I guess, is something like Unity "prefabs", which allow getting some configuration from instance variables.. I wonder if there's anything similar to that in Blender? $\endgroup$ – redShadow Sep 8 '19 at 10:36
  • $\begingroup$ @redShadow I'm sorry, I didn't read you question well enough. There are a few ways you can do that-- as Leander offered, you can use object ID as your seed instead of UV, although that's a little more difficult to tune. Another way to do this is to give all of your instanced objects a data transfer modifier to copy UV from a non-rendering object, which lets you tune via UV (on your other object), but that might not work well if you want to do object-level transformations on your instanced emitters. $\endgroup$ – Nathan Sep 8 '19 at 15:11
0
$\begingroup$

The best way to do this - use Object Color.

enter image description here

In instances, material uses Object Color of instance, that makes easy way to control material from Instance level.

enter image description here enter image description here

| improve this answer | |
$\endgroup$

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.