From c3c38155ad2aca369fa956b2251ed41c749942cc Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 13 Jun 2009 21:22:21 +0000 Subject: 2.5 Buttons: * Added more material buttons by William. Thanks. I made some minor adjustments and added Specular Shader Model RNA. * Code cleanup and some consistency tweaks of button files. Notes: Preview render now only shows up when there is an active world, material, texture or lamp. * Made sure initial panels with ID Datablocks are shown, even when no block is active. --- release/ui/buttons_data_lamp.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'release/ui/buttons_data_lamp.py') diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index f626eb45ed6..7328abc7c35 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.type == '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) -- cgit v1.2.3