Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-11-23 21:13:31 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-12-30 17:32:59 +0300
commit5b2d5f9077930012aed15a9e447cd5d11a3f63a7 (patch)
tree7122063ad4af2380639e02a5f58f2fca851f5d5b /release
parentf901bf6f4718122bd3f81f5ba05090fe994ae3fe (diff)
Fix T53171: lamp specials strength tweak fails with renamed emission nodes.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index f4e83530383..ed3d5de76f2 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1444,18 +1444,21 @@ class VIEW3D_MT_object_specials(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
if scene.render.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")