Specials Menu (W) crashes with lamps if the Emission node is missing/ renamed in Cycles
Closed, ResolvedPublic

Description

System Information
Win 7 64 bit, AMD X3 455, R7 360

Blender Version
Broken: current master 171c4e9, 2.79 and all the versions after the commit rB6322f017835f

Short description of error
The key value is hardcoded expecting a Emission called name for a node in the material tree. The problem arises if:

  • The Emission node is deleted or renamed
  • If a node of an another type is called Emission (as it expects a specific input)
  File "2.79\scripts\startup\bl_ui\space_view3d.py", line 1554, in draw
    value = lamp.node_tree.nodes["Emission"].inputs["Strength"].default_value
KeyError: 'bpy_prop_collection[key]: key "Emission" not found'

  File "2.79\scripts\startup\bl_ui\space_view3d.py", line 1554, in draw
    value = lamp.node_tree.nodes["Emission"].inputs["Strength"].default_value
KeyError: 'bpy_prop_collection[key]: key "Strength" not found'

Exact steps for others to reproduce the error
Default scene > switch to Cycles> Select a Lamp > Open the Node Editor > Enable nodes > Delete or rename the Emission node > In 3D View press W to bring the Specials menu.

Related Objects

ronan ducluzeau (zeauro) triaged this task as Confirmed priority.Oct 27 2017, 12:06 PM

I confirm the issue with master and 2.79.
Specials Menu contains an item to modify strength of the lamp by dragging mouse in 3Dview.
But this strength is set by Emission node when nodes are enabled.

Of course, it does not work anymore if nodetree is modified and does not contain a node called "Emission".

Strength item in Specials menu for lamp is present only if nodes are enabled.