Version: 2.83
I want to change the colour of a material during animation - via python script.
I can create a cube wherever I want, called myobject and attached to it an appropriate material:
material.use_nodes = True
principled_bsdf = material.node_tree.nodes['Principled BSDF']
principled_bsdf.inputs[0].default_value = colour
principled_bsdf.inputs[5].default_value = 0
myobject.active_material = material
I can then move the object for each i and use myobject.keyframe_insert(data_path = "location", frame(i)) to insert frames appropriately. What is the correct data_path channel to insert keyframes for different colours, so I can change principled_bsdf.inputs[0] for whichever keyframes I want.
This question asks the same question, but doesn't have any answers: Change the color via python script
Note that using data_path = "color" doesn't give an error, but also doesn't work.