fix [#35771] "Specials" ->"Size Y" doesn't work for Cycles area lamp

This commit is contained in:
Campbell Barton 2013-06-18 06:23:30 +00:00
parent 1f785cc196
commit b0872918ea

@ -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"