Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/ui/buttons_data_lamp.py')
-rw-r--r--release/ui/buttons_data_lamp.py17
1 files changed, 7 insertions, 10 deletions
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: