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>2012-06-04 21:17:10 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-06-04 21:17:10 +0400
commit6548f7efefb2e9db25e8c6ca8b7d4ed6b9725543 (patch)
tree106465145a9e15e3e01ff6fbde850d880dbb7c2c /intern/cycles/blender
parent0f1fd51c2169d45327eef4c40622551694c9dd9e (diff)
Cycles: spot lamp support.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/addon/ui.py27
-rw-r--r--intern/cycles/blender/blender_object.cpp4
2 files changed, 27 insertions, 4 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 8480b0a5256..3b906bb4bdf 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -488,9 +488,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
col = split.column()
col.prop(clamp, "cast_shadow")
- if lamp.type == 'SPOT':
- layout.label(text="Not supported, interpreted as point lamp.")
- elif lamp.type == 'HEMI':
+ if lamp.type == 'HEMI':
layout.label(text="Not supported, interpreted as sun lamp.")
@@ -509,6 +507,29 @@ class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel):
if not panel_node_draw(layout, lamp, 'OUTPUT_LAMP', 'Surface'):
layout.prop(lamp, "color")
+class CyclesLamp_PT_spot(CyclesButtonsPanel, Panel):
+ bl_label = "Spot Shape"
+ bl_context = "data"
+
+ @classmethod
+ def poll(cls, context):
+ lamp = context.lamp
+ return (lamp and lamp.type == 'SPOT') and CyclesButtonsPanel.poll(context)
+
+ def draw(self, context):
+ layout = self.layout
+
+ lamp = context.lamp
+
+ split = layout.split()
+
+ col = split.column()
+ sub = col.column()
+ sub.prop(lamp, "spot_size", text="Size")
+ sub.prop(lamp, "spot_blend", text="Blend", slider=True)
+
+ col = split.column()
+ col.prop(lamp, "show_cone")
class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
bl_label = "Surface"
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index b04e0137e37..cea3b0256bd 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -106,7 +106,9 @@ void BlenderSync::sync_light(BL::Object b_parent, int b_index, BL::Object b_ob,
case BL::Lamp::type_SPOT: {
BL::SpotLamp b_spot_lamp(b_lamp);
light->size = b_spot_lamp.shadow_soft_size();
- light->type = LIGHT_POINT;
+ light->type = LIGHT_SPOT;
+ light->spot_angle = b_spot_lamp.spot_size();
+ light->spot_smooth = b_spot_lamp.spot_blend();
break;
}
case BL::Lamp::type_HEMI: {