[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57539] trunk/blender/release/scripts/ startup/bl_ui/space_view3d.py: fix [#35771] "Specials" ->"Size Y" doesn' t work for Cycles area lamp

Campbell Barton ideasman42 at gmail.com
Tue Jun 18 08:23:30 CEST 2013


Revision: 57539
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57539
Author:   campbellbarton
Date:     2013-06-18 06:23:30 +0000 (Tue, 18 Jun 2013)
Log Message:
-----------
fix [#35771] "Specials" ->"Size Y" doesn't work for Cycles area lamp

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-06-18 05:16:15 UTC (rev 57538)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-06-18 06:23:30 UTC (rev 57539)
@@ -966,26 +966,30 @@
             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"




More information about the Bf-blender-cvs mailing list