Merge branch 'master' into blender2.8
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 23 Nov 2017 18:16:11 +0000 (19:16 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 23 Nov 2017 18:16:11 +0000 (19:16 +0100)
1  2 
intern/cycles/render/buffers.cpp
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/makesrna/intern/rna_scene.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/render/intern/source/render_result.c

Simple merge
index d449dd20c3e4217a3af23b00160aee0528549e1f,096c164d7d00a9a98e9d35c85b4689dfc3179be4..cd062a676478f352c0eaa4ee0f6a77ec9b080f06
@@@ -1551,21 -1548,23 +1551,24 @@@ class VIEW3D_MT_object_specials(Menu)
              lamp = obj.data
  
              layout.operator_context = 'INVOKE_REGION_WIN'
 +            use_shading_nodes = context.view_render.use_shading_nodes
  
 -            if scene.render.use_shading_nodes:
 +            if use_shading_nodes:
-                 try:
-                     value = lamp.node_tree.nodes["Emission"].inputs["Strength"].default_value
-                 except AttributeError:
-                     value = None
-                 if value is not None:
+                 emission_node = None
+                 if lamp.node_tree:
+                     for node in lamp.node_tree.nodes:
+                         if getattr(node, "type", None) == 'EMISSION':
+                             emission_node = node
+                             break
+                 if emission_node is not None:
                      props = layout.operator("wm.context_modal_mouse", text="Strength")
                      props.data_path_iter = "selected_editable_objects"
-                     props.data_path_item = "data.node_tree.nodes[\"Emission\"].inputs[\"Strength\"].default_value"
+                     props.data_path_item = "data.node_tree" \
+                                            ".nodes[\"" + emission_node.name + "\"]" \
+                                            ".inputs[\"Strength\"].default_value"
                      props.header_text = "Lamp Strength: %.3f"
                      props.input_scale = 0.1
-                 del value
  
                  if lamp.type == 'AREA':
                      props = layout.operator("wm.context_modal_mouse", text="Size X")