Merge branch 'master' into blender2.8
[blender.git] / release / scripts / startup / bl_ui / properties_data_lamp.py
index 25b855918733f9413b24de51620a91afe45fc2cb..30cd39d2e2f8e597c02b5bceaed9ab2c75de01a0 100644 (file)
@@ -30,7 +30,7 @@ class LAMP_MT_sunsky_presets(Menu):
     draw = Menu.draw_preset
 
 
-class DataButtonsPanel():
+class DataButtonsPanel:
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -103,6 +103,13 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
                 sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
                 sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
 
+            elif lamp.falloff_type == 'INVERSE_COEFFICIENTS':
+                col.label(text="Inverse Coefficients:")
+                sub = col.column(align=True)
+                sub.prop(lamp, "constant_coefficient", text="Constant")
+                sub.prop(lamp, "linear_coefficient", text="Linear")
+                sub.prop(lamp, "quadratic_coefficient", text="Quadratic")
+
             col.prop(lamp, "use_sphere")
 
         if lamp.type == 'AREA':
@@ -118,7 +125,7 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
 
 class DATA_PT_sunsky(DataButtonsPanel, Panel):
     bl_label = "Sky & Atmosphere"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
@@ -322,9 +329,9 @@ class DATA_PT_area(DataButtonsPanel, Panel):
         col.row().prop(lamp, "shape", expand=True)
         sub = col.row(align=True)
 
-        if (lamp.shape == 'SQUARE'):
+        if lamp.shape == 'SQUARE':
             sub.prop(lamp, "size")
-        elif (lamp.shape == 'RECTANGLE'):
+        elif lamp.shape == 'RECTANGLE':
             sub.prop(lamp, "size", text="Size X")
             sub.prop(lamp, "size_y", text="Size Y")
 
@@ -355,6 +362,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
 
         col = split.column()
 
+        col.active = (lamp.shadow_method != 'BUFFER_SHADOW' or lamp.shadow_buffer_type != 'DEEP')
         col.prop(lamp, "use_halo")
         sub = col.column(align=True)
         sub.active = lamp.use_halo
@@ -378,7 +386,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
     def draw(self, context):
         lamp = context.lamp
 
-        self.layout.template_curve_mapping(lamp, "falloff_curve")
+        self.layout.template_curve_mapping(lamp, "falloff_curve", use_negative_slope=True)
 
 
 class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel):