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/scripts/startup/bl_ui/properties_data_lamp.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_lamp.py323
1 files changed, 136 insertions, 187 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py
index f9394139b42..d613967584c 100644
--- a/release/scripts/startup/bl_ui/properties_data_lamp.py
+++ b/release/scripts/startup/bl_ui/properties_data_lamp.py
@@ -22,14 +22,6 @@ from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-class LAMP_MT_sunsky_presets(Menu):
- bl_label = "Sun & Sky Presets"
- preset_subdir = "sunsky"
- preset_operator = "script.execute_preset"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
- draw = Menu.draw_preset
-
-
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -37,14 +29,14 @@ class DataButtonsPanel:
@classmethod
def poll(cls, context):
- engine = context.scene.render.engine
+ engine = context.engine
return context.lamp and (engine in cls.COMPAT_ENGINES)
class DATA_PT_context_lamp(DataButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
@@ -55,20 +47,15 @@ class DATA_PT_context_lamp(DataButtonsPanel, Panel):
split = layout.split(percentage=0.65)
- texture_count = len(lamp.texture_slots.keys())
-
if ob:
split.template_ID(ob, "data")
elif lamp:
split.template_ID(space, "pin_id")
- if texture_count != 0:
- split.label(text=str(texture_count), icon='TEXTURE')
-
class DATA_PT_preview(DataButtonsPanel, Panel):
bl_label = "Preview"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
self.layout.template_preview(context.lamp)
@@ -76,7 +63,7 @@ class DATA_PT_preview(DataButtonsPanel, Panel):
class DATA_PT_lamp(DataButtonsPanel, Panel):
bl_label = "Lamp"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
@@ -85,239 +72,175 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
layout.row().prop(lamp, "type", expand=True)
- split = layout.split()
+ layout.use_property_split = True
- col = split.column()
- sub = col.column()
- sub.prop(lamp, "color", text="")
- sub.prop(lamp, "energy")
+ col = col.column()
+ col.prop(lamp, "color")
+ col.prop(lamp, "energy")
if lamp.type in {'POINT', 'SPOT'}:
- sub.label(text="Falloff:")
- sub.prop(lamp, "falloff_type", text="")
- sub.prop(lamp, "distance")
+
+ col = col.column()
+ col.label(text="Falloff")
+ col.prop(lamp, "falloff_type")
+ col.prop(lamp, "distance")
+ col.prop(lamp, "shadow_soft_size")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
- col.label(text="Attenuation Factors:")
sub = col.column(align=True)
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:")
+ 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':
col.prop(lamp, "distance")
- col.prop(lamp, "gamma")
col = split.column()
- col.prop(lamp, "use_negative")
- col.prop(lamp, "use_own_layer", text="This Layer Only")
- col.prop(lamp, "use_specular")
- col.prop(lamp, "use_diffuse")
+ col.label()
-class DATA_PT_sunsky(DataButtonsPanel, Panel):
- bl_label = "Sky & Atmosphere"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
-
- @classmethod
- def poll(cls, context):
- lamp = context.lamp
- engine = context.scene.render.engine
- return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES)
+class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel):
+ bl_label = "Lamp"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
+ lamp = context.lamp
- lamp = context.lamp.sky
-
- row = layout.row(align=True)
- row.prop(lamp, "use_sky")
- row.menu("LAMP_MT_sunsky_presets", text=bpy.types.LAMP_MT_sunsky_presets.bl_label)
- row.operator("lamp.sunsky_preset_add", text="", icon='ZOOMIN')
- row.operator("lamp.sunsky_preset_add", text="", icon='ZOOMOUT').remove_active = True
-
- row = layout.row()
- row.active = lamp.use_sky or lamp.use_atmosphere
- row.prop(lamp, "atmosphere_turbidity", text="Turbidity")
-
- split = layout.split()
-
- col = split.column()
- col.active = lamp.use_sky
- col.label(text="Blending:")
- sub = col.column()
- sub.prop(lamp, "sky_blend_type", text="")
- sub.prop(lamp, "sky_blend", text="Factor")
-
- col.label(text="Color Space:")
- sub = col.column()
- sub.row().prop(lamp, "sky_color_space", expand=True)
- sub.prop(lamp, "sky_exposure", text="Exposure")
-
- col = split.column()
- col.active = lamp.use_sky
- col.label(text="Horizon:")
- sub = col.column()
- sub.prop(lamp, "horizon_brightness", text="Brightness")
- sub.prop(lamp, "spread", text="Spread")
+ layout.row().prop(lamp, "type", expand=True)
- col.label(text="Sun:")
- sub = col.column()
- sub.prop(lamp, "sun_brightness", text="Brightness")
- sub.prop(lamp, "sun_size", text="Size")
- sub.prop(lamp, "backscattered_light", slider=True, text="Back Light")
+ layout.use_property_split = True
- layout.separator()
+ col = layout.column()
+ col.prop(lamp, "color")
+ col.prop(lamp, "energy")
+ col.prop(lamp, "specular_factor", text="Specular")
- layout.prop(lamp, "use_atmosphere")
+ col.separator()
- split = layout.split()
+ if lamp.type in {'POINT', 'SPOT', 'SUN'}:
+ col.prop(lamp, "shadow_soft_size", text="Radius")
+ elif lamp.type == 'AREA':
+ col.prop(lamp, "shape")
- col = split.column()
- col.active = lamp.use_atmosphere
- col.label(text="Intensity:")
- col.prop(lamp, "sun_intensity", text="Sun")
- col.prop(lamp, "atmosphere_distance_factor", text="Distance")
+ sub = col.column(align=True)
- col = split.column()
- col.active = lamp.use_atmosphere
- col.label(text="Scattering:")
- sub = col.column(align=True)
- sub.prop(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
- sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
+ if lamp.shape in {'SQUARE', 'DISK'}:
+ sub.prop(lamp, "size")
+ elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
+ sub.prop(lamp, "size", text="Size X")
+ sub.prop(lamp, "size_y", text="Y")
-class DATA_PT_shadow(DataButtonsPanel, Panel):
+class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
bl_label = "Shadow"
- COMPAT_ENGINES = {'BLENDER_RENDER'}
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
lamp = context.lamp
- engine = context.scene.render.engine
+ engine = context.engine
return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES)
+ def draw_header(self, context):
+ lamp = context.lamp
+ self.layout.prop(lamp, "use_shadow", text="")
+
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
lamp = context.lamp
- layout.row().prop(lamp, "shadow_method", expand=True)
-
- if lamp.shadow_method == 'NOSHADOW' and lamp.type == 'AREA':
- split = layout.split()
-
- col = split.column()
- col.label(text="Form Factor Sampling:")
-
- sub = col.row(align=True)
-
- if lamp.shape == 'SQUARE':
- sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
- elif lamp.shape == 'RECTANGLE':
- sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
- sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
+ layout.active = lamp.use_shadow
- if lamp.shadow_method != 'NOSHADOW':
- split = layout.split()
+ col = layout.column()
+ sub = col.column(align=True)
+ sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
+ sub.prop(lamp, "shadow_buffer_clip_end", text="End")
- col = split.column()
- col.prop(lamp, "shadow_color", text="")
+ col.prop(lamp, "shadow_buffer_soft", text="Softness")
- col = split.column()
- col.prop(lamp, "use_shadow_layer", text="This Layer Only")
- col.prop(lamp, "use_only_shadow")
+ col.separator()
- if lamp.shadow_method == 'RAY_SHADOW':
- split = layout.split()
+ col.prop(lamp, "shadow_buffer_bias", text="Bias")
+ col.prop(lamp, "shadow_buffer_exp", text="Exponent")
+ col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
- col = split.column()
- col.label(text="Sampling:")
- if lamp.type in {'POINT', 'SUN', 'SPOT'}:
- sub = col.row()
+class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel):
+ bl_label = "Cascaded Shadow Map"
+ bl_parent_id = "DATA_PT_EEVEE_shadow"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
- sub.prop(lamp, "shadow_ray_samples", text="Samples")
- sub.prop(lamp, "shadow_soft_size", text="Soft Size")
+ @classmethod
+ def poll(cls, context):
+ lamp = context.lamp
+ engine = context.engine
- elif lamp.type == 'AREA':
- sub = col.row(align=True)
+ return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES)
- if lamp.shape == 'SQUARE':
- sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
- elif lamp.shape == 'RECTANGLE':
- sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
- sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
+ def draw(self, context):
+ layout = self.layout
+ lamp = context.lamp
+ layout.use_property_split = True
- col.row().prop(lamp, "shadow_ray_sample_method", expand=True)
+ col = layout.column()
- if lamp.shadow_ray_sample_method == 'ADAPTIVE_QMC':
- layout.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
+ col.prop(lamp, "shadow_cascade_count", text="Count")
+ col.prop(lamp, "shadow_cascade_fade", text="Fade")
- if lamp.type == 'AREA' and lamp.shadow_ray_sample_method == 'CONSTANT_JITTERED':
- row = layout.row()
- row.prop(lamp, "use_umbra")
- row.prop(lamp, "use_dither")
- row.prop(lamp, "use_jitter")
+ col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
+ col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
- elif lamp.shadow_method == 'BUFFER_SHADOW':
- col = layout.column()
- col.label(text="Buffer Type:")
- col.row().prop(lamp, "shadow_buffer_type", expand=True)
- if lamp.shadow_buffer_type in {'REGULAR', 'HALFWAY', 'DEEP'}:
- split = layout.split()
+class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
+ bl_label = "Contact Shadows"
+ bl_parent_id = "DATA_PT_EEVEE_shadow"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
- col = split.column()
- col.label(text="Filter Type:")
- col.prop(lamp, "shadow_filter_type", text="")
- sub = col.column(align=True)
- sub.prop(lamp, "shadow_buffer_soft", text="Soft")
- sub.prop(lamp, "shadow_buffer_bias", text="Bias")
+ @classmethod
+ def poll(cls, context):
+ lamp = context.lamp
+ engine = context.engine
+ return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES)
- col = split.column()
- col.label(text="Sample Buffers:")
- col.prop(lamp, "shadow_sample_buffers", text="")
- sub = col.column(align=True)
- sub.prop(lamp, "shadow_buffer_size", text="Size")
- sub.prop(lamp, "shadow_buffer_samples", text="Samples")
- if lamp.shadow_buffer_type == 'DEEP':
- col.prop(lamp, "compression_threshold")
+ def draw_header(self, context):
+ lamp = context.lamp
- elif lamp.shadow_buffer_type == 'IRREGULAR':
- layout.prop(lamp, "shadow_buffer_bias", text="Bias")
+ layout = self.layout
+ layout.active = lamp.use_shadow
+ layout.prop(lamp, "use_contact_shadow", text="")
- split = layout.split()
+ def draw(self, context):
+ layout = self.layout
+ lamp = context.lamp
+ layout.use_property_split = True
- col = split.column()
- col.prop(lamp, "use_auto_clip_start", text="Autoclip Start")
- sub = col.column()
- sub.active = not lamp.use_auto_clip_start
- sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
+ col = layout.column()
+ col.active = lamp.use_shadow and lamp.use_contact_shadow
- col = split.column()
- col.prop(lamp, "use_auto_clip_end", text="Autoclip End")
- sub = col.column()
- sub.active = not lamp.use_auto_clip_end
- sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
+ col.prop(lamp, "contact_shadow_distance", text="Distance")
+ col.prop(lamp, "contact_shadow_soft_size", text="Softness")
+ col.prop(lamp, "contact_shadow_bias", text="Bias")
+ col.prop(lamp, "contact_shadow_thickness", text="Thickness")
class DATA_PT_area(DataButtonsPanel, Panel):
bl_label = "Area Shape"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
lamp = context.lamp
- engine = context.scene.render.engine
+ engine = context.engine
return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
@@ -329,21 +252,21 @@ 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 in {'SQUARE', 'DISK'}:
sub.prop(lamp, "size")
- elif lamp.shape == 'RECTANGLE':
+ elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
sub.prop(lamp, "size", text="Size X")
sub.prop(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel, Panel):
bl_label = "Spot Shape"
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
lamp = context.lamp
- engine = context.scene.render.engine
+ engine = context.engine
return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
@@ -371,15 +294,40 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
sub.prop(lamp, "halo_step", text="Step")
+class DATA_PT_spot(DataButtonsPanel, Panel):
+ bl_label = "Spot Shape"
+ bl_parent_id = "DATA_PT_EEVEE_lamp"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ @classmethod
+ def poll(cls, context):
+ lamp = context.lamp
+ engine = context.engine
+ return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+
+ lamp = context.lamp
+
+ col = layout.column()
+
+ col.prop(lamp, "spot_size", text="Size")
+ col.prop(lamp, "spot_blend", text="Blend", slider=True)
+
+ col.prop(lamp, "show_cone")
+
+
class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
bl_label = "Falloff Curve"
bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
lamp = context.lamp
- engine = context.scene.render.engine
+ engine = context.engine
return (lamp and lamp.type in {'POINT', 'SPOT'} and lamp.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES)
@@ -390,18 +338,19 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel):
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
_context_path = "object.data"
_property_type = bpy.types.Lamp
classes = (
- LAMP_MT_sunsky_presets,
DATA_PT_context_lamp,
DATA_PT_preview,
DATA_PT_lamp,
- DATA_PT_sunsky,
- DATA_PT_shadow,
+ DATA_PT_EEVEE_lamp,
+ DATA_PT_EEVEE_shadow,
+ DATA_PT_EEVEE_shadow_contact,
+ DATA_PT_EEVEE_shadow_cascaded_shadow_map,
DATA_PT_area,
DATA_PT_spot,
DATA_PT_falloff_curve,