Can anybody help me with changing colors of a mesh in animation? When I change the color and set the keyframe, the last modified color of the mesh is applied on all previous keyframes. When I press i to set keyframe, which keyframe should I choose from the rolling list?
You can change color by scripting in case you don't want to resort to rendering. You need to open your text editor and change your colors like so:
def f1(hodnota, what, materialA, materialB): if (hodnota < 0): bpy.data.scenes['Scene'].objects[what].material_slots[materialA].material.diffuse_color = value*(-1) bpy.data.scenes['Scene'].objects[what].material_slots[materialA].material.diffuse_color = 0 bpy.data.scenes['Scene'].objects[what].material_slots[materialA].material.diffuse_color = 0 return value*value bpy.app.driver_namespace['f1'] = f1
When you are happy with your function, click Run Script button in your text editor. To call the function select your driver object, go to Graph editor -> Drivers and into Expr field code something like
f1(var, 'Cylinder.002', 'Material.001', 'Material.002')
You will need to run the script each time you open your file and it is generally pain in the neck, but in case your computer is too weak to run rendered view or if you want to show what you see when developing, it is a way.
I didn't find a way to attach my blend file. Hopefully this will be enough to get you started or you will find a way to let me know how to attach it.