I am trying to create an animation with python.
For this I want to keyframe the material slot. So I tried:
matFocus = bpy.data.materials.new(name="matFocus")
activeObject.material_slots[0].material=matFocus
activeObject.keyframe_insert(data_path="material_slots[0].material")
If I execute this, I get:
TypeError: bpy_struct.keyframe_insert() property "material_slots[0].material" not animatable
Background is: I have a scenery with many objects that all share the same material. My animation should highlight (via color) a sequence of objects one after another. So my approach was to assign a "focus-material" to each of them one by one and to keyframe this.
Is there a solution to this?