I am trying a simple script to change a material attribute (Emission Level).
The command works in the python console but not as a script run from the text editor. No error messages.
Script below, delays put in for tracing purposes.
#set frame to 0
bpy.data.scenes["Scene"].frame_current = 0
#set segment g on
print("setting segment g on")
bpy.data.materials["segment g"].node_tree.nodes["Principled BSDF"].inputs[20].default_value = 10.0
print("wait 5")
time.sleep(5)
#set segment g off
print("setting segment g off")
bpy.data.materials["segment g"].node_tree.nodes["Principled BSDF"].inputs[20].default_value = 0.0
print("wait 5")
time.sleep(5)
print("finished")