I have a very simple question. Is it possible to change the material (i.e. color) of a body or face at each frame in Blender? Would it be possible to do it through Python?

  • $\begingroup$ blender.stackexchange.com/questions/70255/…, $\endgroup$
    – brockmann
    Sep 6 at 15:51
  • $\begingroup$ I want to mark as a duplicate but now I don't know which answer to choose 😅 $\endgroup$ Sep 6 at 15:57
  • $\begingroup$ IMO not a dup because it's a more general question than 'random' implies. Or maybe because I answered it. IDK. :P $\endgroup$ Sep 6 at 16:15
  • $\begingroup$ I guess there is even more @MarkusvonBroady ;) $\endgroup$
    – brockmann
    Sep 6 at 16:34

Yes it is possible. But how to do it depends on what exactly you want to do. One way is to use a driver on one of the properties of the material. Here is a very simple example to show you how it works

Material changing every frame

If you look at the Value node, you will see that I'm typing in #frame % 2. As soon as I hit enter, the Value field will be filled by a driver that changes between 0 and 1 on each frame.

Because the color ramp will give Black for 0 as the Fac and White for 1, this will generate a very annoying flashing effect.

You can use the frame number to drive pretty much any numeric value in a material and that will cause the material to change. You can generalize the ColorRamp to allow switching many colors for example, or you can perform math on the object's Normal Map.

  • $\begingroup$ you could also animate the value using the noise generator in the graph editor if you wanted. Just press i when your mouse is over the number and open the graph editor. A good option when you want more control. $\endgroup$
    – Millard
    Sep 6 at 20:44
  • $\begingroup$ I've rolled back the edit, because you do type the octothorpe (#) before frame when you first enter the driver. $\endgroup$ Sep 6 at 23:46

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