I want to change the value of the Emission colour and strength of one of my materials I have set in the editor, I did the following code, but nothing happens:
led = bpy.data.objects["LED"]
led.animation_data_clear()
led_mat = bpy.data.materials['LED_mat']
led_mat.use_nodes = True
nodes = led_mat.node_tree.nodes
led_emit = nodes.new("ShaderNodeBsdfDiffuse")
led_emit.inputs["Color"].default_value = (1.0, 1.0, 0, 1)
led_emit.inputs["Color"].keyframe_insert("default_value", frame=1)
What is the correct way to do it? I needed to use the new
function because even I set the Emission parameter in the editor for the material, I got the error of an undefined parameter.