Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_light.py
| Show All 12 Lines | class DataButtonsPanel: | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| return context.light and (engine in cls.COMPAT_ENGINES) | return context.light and (engine in cls.COMPAT_ENGINES) | ||||
| class DATA_PT_context_light(DataButtonsPanel, Panel): | class DATA_PT_context_light(DataButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| light = context.light | light = context.light | ||||
| space = context.space_data | space = context.space_data | ||||
| Show All 9 Lines | class DATA_PT_preview(DataButtonsPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| self.layout.template_preview(context.light) | self.layout.template_preview(context.light) | ||||
| class DATA_PT_light(DataButtonsPanel, Panel): | class DATA_PT_light(DataButtonsPanel, Panel): | ||||
| bl_label = "Light" | bl_label = "Light" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| light = context.light | light = context.light | ||||
| # Compact layout for node editor. | # Compact layout for node editor. | ||||
| if self.bl_space_type == 'PROPERTIES': | if self.bl_space_type == 'PROPERTIES': | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(light, "contact_shadow_distance", text="Distance") | col.prop(light, "contact_shadow_distance", text="Distance") | ||||
| col.prop(light, "contact_shadow_bias", text="Bias") | col.prop(light, "contact_shadow_bias", text="Bias") | ||||
| col.prop(light, "contact_shadow_thickness", text="Thickness") | col.prop(light, "contact_shadow_thickness", text="Thickness") | ||||
| class DATA_PT_spot(DataButtonsPanel, Panel): | class DATA_PT_spot(DataButtonsPanel, Panel): | ||||
| bl_label = "Spot Shape" | bl_label = "Spot Shape" | ||||
| bl_parent_id = "DATA_PT_EEVEE_light" | bl_parent_id = "DATA_PT_EEVEE_light" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| light = context.light | light = context.light | ||||
| engine = context.engine | engine = context.engine | ||||
| return (light and light.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | return (light and light.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 28 Lines | class DATA_PT_falloff_curve(DataButtonsPanel, Panel): | ||||
| def draw(self, context): | def draw(self, context): | ||||
| light = context.light | light = context.light | ||||
| self.layout.template_curve_mapping( | self.layout.template_curve_mapping( | ||||
| light, "falloff_curve", use_negative_slope=True) | light, "falloff_curve", use_negative_slope=True) | ||||
| class DATA_PT_custom_props_light(DataButtonsPanel, PropertyPanel, Panel): | class DATA_PT_custom_props_light(DataButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE_NEXT', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| _context_path = "object.data" | _context_path = "object.data" | ||||
| _property_type = bpy.types.Light | _property_type = bpy.types.Light | ||||
| classes = ( | classes = ( | ||||
| DATA_PT_context_light, | DATA_PT_context_light, | ||||
| DATA_PT_preview, | DATA_PT_preview, | ||||
| DATA_PT_light, | DATA_PT_light, | ||||
| Show All 14 Lines | |||||