diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-06-20 07:38:34 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-06-20 07:38:34 +0400 |
commit | 12bf10be020de1f4031889f78552c77121da3194 (patch) | |
tree | df916ba35e2e711f788d5792097f071c9e5023df /release/ui/buttons_data_lamp.py | |
parent | bb9323a720483b0c02bf25ecfca9c6ccc8699519 (diff) | |
parent | 7785ead4eb64f9702d7a59060e73b3e121e674a7 (diff) |
2.5 merged 20773:21020
Diffstat (limited to 'release/ui/buttons_data_lamp.py')
-rw-r--r-- | release/ui/buttons_data_lamp.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index f626eb45ed6..52a60ce617e 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -22,12 +22,16 @@ class DATA_PT_preview(DataButtonsPanel): class DATA_PT_lamp(DataButtonsPanel): __idname__ = "DATA_PT_lamp" __label__ = "Lamp" + + def poll(self, context): + return ((context.object and context.object.type == 'LAMP') or context.lamp) def draw(self, context): + layout = self.layout + ob = context.object lamp = context.lamp space = context.space_data - layout = self.layout split = layout.split(percentage=0.65) @@ -82,8 +86,8 @@ class DATA_PT_sunsky(DataButtonsPanel): return (lamp and lamp.type == 'SUN') def draw(self, context): - lamp = context.lamp.sky layout = self.layout + lamp = context.lamp.sky row = layout.row() row.itemR(lamp, "sky") @@ -96,7 +100,6 @@ class DATA_PT_sunsky(DataButtonsPanel): split = layout.split() col = split.column() - sub = col.column() sub.active = lamp.sky sub.itemR(lamp, "sky_blend_type", text="Blend Type") @@ -125,8 +128,8 @@ class DATA_PT_shadow(DataButtonsPanel): return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA')) def draw(self, context): - lamp = context.lamp layout = self.layout + lamp = context.lamp layout.itemR(lamp, "shadow_method", expand=True) @@ -204,8 +207,8 @@ class DATA_PT_spot(DataButtonsPanel): return (lamp and lamp.type == 'SPOT') def draw(self, context): - lamp = context.lamp layout = self.layout + lamp = context.lamp split = layout.split() @@ -236,8 +239,8 @@ class DATA_PT_falloff_curve(DataButtonsPanel): return False def draw(self, context): - lamp = context.lamp layout = self.layout + lamp = context.lamp layout.template_curve_mapping(lamp.falloff_curve) @@ -246,4 +249,4 @@ bpy.types.register(DATA_PT_lamp) bpy.types.register(DATA_PT_shadow) bpy.types.register(DATA_PT_sunsky) bpy.types.register(DATA_PT_spot) -bpy.types.register(DATA_PT_falloff_curve)
\ No newline at end of file +bpy.types.register(DATA_PT_falloff_curve) |