Is it possible to animate the vertex color of an object?
manipulating Color Layer directly with Python as a function of frame number
We can animate a color_layer vertex by vertex procedurally with
frame_change_pre handler, docs for which are here. This assumes that there is a vertex color map called 'Col', and that you know how to render Vertex Colors
import bpy import random obj = bpy.data.objects["Cube"] mesh = obj.data color_layer = mesh.vertex_colors["Col"] def set_vcols(frame): i = 0 for poly in mesh.polygons: for idx in poly.loop_indices: r = 0.5 g = 255 / (frame % 255) b = random.random() color_layer.data[i].color = r,g,b i += 1 def my_handler(scene): frame = scene.frame_current set_vcols(frame) bpy.app.handlers.frame_change_pre.append(my_handler)
If you go this route, while developing it might seem that your code is not being executed as you hoped, run the below code from console, then rerun your script:
purge the event list:
f_change = bpy.app.handlers.frame_change_pre del f_change[0:len(f_change)]