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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-03 04:17:35 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-03 04:17:35 +0400
commitdc7d0ef474d235b59c4889b8fdb2eb1551f3df83 (patch)
tree343e9f02b6080c1f00a6708995ea0238df95ecd5 /release/ui/buttons_data_lamp.py
parentabfc3daaf4dc6234ac4a48e72747a0b3fa559d2c (diff)
UI:
* Add Lamp Fallof Curve and Texture Color Ramp panels. * Use button space context data. * A few other minor python layout script updates.
Diffstat (limited to 'release/ui/buttons_data_lamp.py')
-rw-r--r--release/ui/buttons_data_lamp.py46
1 files changed, 33 insertions, 13 deletions
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index a2a6ad0426c..86be9cd1a68 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -7,15 +7,14 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
- ob = context.active_object
- return (ob and ob.type == 'LAMP')
+ return (context.lamp != None)
class DATA_PT_lamp(DataButtonsPanel):
__idname__ = "DATA_PT_lamp"
__label__ = "Lamp"
def draw(self, context):
- lamp = context.active_object.data
+ lamp = context.lamp
layout = self.layout
layout.itemR(lamp, "type", expand=True)
@@ -56,11 +55,11 @@ class DATA_PT_sunsky(DataButtonsPanel):
__label__ = "Sun/Sky"
def poll(self, context):
- ob = context.active_object
- return (ob.type == 'LAMP' and ob.data.type == 'SUN')
+ lamp = context.lamp
+ return (lamp and lamp.type == 'SUN')
def draw(self, context):
- lamp = context.active_object.data.sky
+ lamp = context.lamp.sky
layout = self.layout
row = layout.row()
@@ -99,11 +98,11 @@ class DATA_PT_shadow(DataButtonsPanel):
__label__ = "Shadow"
def poll(self, context):
- ob = context.active_object
- return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 'SPOT', 'AREA'))
+ lamp = context.lamp
+ return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
def draw(self, context):
- lamp = context.active_object.data
+ lamp = context.lamp
layout = self.layout
layout.itemR(lamp, "shadow_method", expand=True)
@@ -178,11 +177,11 @@ class DATA_PT_spot(DataButtonsPanel):
__label__ = "Spot"
def poll(self, context):
- ob = context.active_object
- return (ob.type == 'LAMP' and ob.data.type == 'SPOT')
+ lamp = context.lamp
+ return (lamp and lamp.type == 'SPOT')
def draw(self, context):
- lamp = context.active_object.data
+ lamp = context.lamp
layout = self.layout
split = layout.split()
@@ -200,7 +199,28 @@ class DATA_PT_spot(DataButtonsPanel):
if lamp.shadow_method == 'BUFFER_SHADOW':
colsub.itemR(lamp, "halo_step", text="Step")
+class DATA_PT_falloff_curve(DataButtonsPanel):
+ __idname__ = "DATA_PT_falloff_curve"
+ __label__ = "Falloff Curve"
+
+ def poll(self, context):
+ lamp = context.lamp
+
+ if lamp and lamp.type in ('POINT', 'SPOT'):
+ if lamp.falloff_type == 'CUSTOM_CURVE':
+ return True
+
+ return False
+
+ def draw(self, context):
+ lamp = context.lamp
+ layout = self.layout
+
+ layout.template_curve_mapping(lamp.falloff_curve)
+
bpy.types.register(DATA_PT_lamp)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)
-bpy.types.register(DATA_PT_spot) \ No newline at end of file
+bpy.types.register(DATA_PT_spot)
+bpy.types.register(DATA_PT_falloff_curve)
+