From 40ae17d2f6e2d5dbbe89321491572035c304872c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 19 May 2009 17:13:33 +0000 Subject: UI * Fix buttons jumping around when resizing and zoom. Part of this was adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the rounding is unpredictable (used to be 0.375f, but that was disabled). * Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is now taken into account in more places in the view2d code, to avoid zooming into the center or panning out of the view. * Remove "Free" align mode in buttons window (it's not really useful). * View3D/Graph/Image editors now use the same PanelType system as the buttons window, means some deprecated panel code could be removed. * Some small visual tweaks for panels. * View 2D Reset operator (Home key), to reset zoom and panning for panels. * Added argument to set number buttons as sliders (slider=True for itemR). * Ignore labels for button alignment (doesn't look right). * Fix some use of context.main in py scripts, should get data from active object instead. * Fix autotexspace -> auto_texspace in py script. --- release/ui/buttons_data_lamp.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 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 9b64748032d..2005481d38b 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -15,7 +15,7 @@ class DATA_PT_lamp(DataButtonsPanel): __label__ = "Lamp" def draw(self, context): - lamp = context.main.lamps[0] + lamp = context.active_object.data layout = self.layout if not lamp: @@ -61,11 +61,10 @@ class DATA_PT_sunsky(DataButtonsPanel): def poll(self, context): ob = context.active_object - lamp = context.main.lamps[0] - return (ob.type == 'LAMP' and lamp.type == 'SUN') + return (ob.type == 'LAMP' and ob.data.type == 'SUN') def draw(self, context): - lamp = context.main.lamps[0].sky + lamp = context.active_object.data layout = self.layout if not lamp: @@ -107,11 +106,10 @@ class DATA_PT_shadow(DataButtonsPanel): def poll(self, context): ob = context.active_object - lamp = context.main.lamps[0] - return (ob.type == 'LAMP' and lamp.type in ('POINT','SUN', 'SPOT', 'AREA')) + return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 'SPOT', 'AREA')) def draw(self, context): - lamp = context.main.lamps[0] + lamp = context.active_object.data layout = self.layout if not lamp: @@ -190,11 +188,10 @@ class DATA_PT_spot(DataButtonsPanel): def poll(self, context): ob = context.active_object - lamp = context.main.lamps[0] - return (ob.type == 'LAMP' and lamp.type == 'SPOT') + return (ob.type == 'LAMP' and ob.data.type == 'SPOT') def draw(self, context): - lamp = context.main.lamps[0] + lamp = context.active_object.data layout = self.layout if not lamp: -- cgit v1.2.3