5

I am trying to animate changing brightness of a point lamp using input data that I have. However, when I try to access the lamp's strength using

bpy.data.node_groups["Shader Nodetree"].nodes["Emission"].inputs[1].default_value

I get the error message:

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
KeyError: 'bpy_prop_collection[key]: key "Shader Nodetree" not found

Is there another way I can/should access and change the lamp's strength via Python?

zeffii
  • 39,634
  • 9
  • 103
  • 186
wjkaufman
  • 53
  • 4

1 Answers1

2

Yes, reach node_tree through lamp object bpy.data.lamps['lamp name'].node_tree.nodes.

kilbee
  • 1,327
  • 12
  • 22