From b0872918ea9938f83a9e9c52184fa1e335bff0f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Jun 2013 06:23:30 +0000 Subject: [PATCH] fix [#35771] "Specials" ->"Size Y" doesn't work for Cycles area lamp --- release/scripts/startup/bl_ui/space_view3d.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index b8cbd058063..e0449931fc9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -966,26 +966,30 @@ class VIEW3D_MT_object_specials(Menu): 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: 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.header_text = "Lamp Strength: %.3f" props.input_scale = 0.1 - except AttributeError: - pass + del value - if lamp.type == 'AREA' and lamp.shape == 'RECTANGLE': + if lamp.type == 'AREA': props = layout.operator("wm.context_modal_mouse", text="Size X") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.size" props.header_text = "Lamp Size X: %.3f" - props = layout.operator("wm.context_modal_mouse", text="Size Y") - props.data_path_iter = "selected_editable_objects" - props.data_path_item = "data.size" - props.header_text = "Lamp Size Y: %.3f" - elif lamp.type in {'SPOT', 'AREA', 'POINT', 'SUN'}: + if lamp.shape == 'RECTANGLE': + props = layout.operator("wm.context_modal_mouse", text="Size Y") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.size_y" + props.header_text = "Lamp Size Y: %.3f" + + elif lamp.type in {'SPOT', 'POINT', 'SUN'}: props = layout.operator("wm.context_modal_mouse", text="Size") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_soft_size"