Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_lamp.py
| Show All 31 Lines | |||||
| class DataButtonsPanel: | class DataButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "data" | bl_context = "data" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return context.lamp and (engine in cls.COMPAT_ENGINES) | return context.lamp and (engine in cls.COMPAT_ENGINES) | ||||
| class DATA_PT_context_lamp(DataButtonsPanel, Panel): | class DATA_PT_context_lamp(DataButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | ||||
| ▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | |||||
| class DATA_PT_sunsky(DataButtonsPanel, Panel): | class DATA_PT_sunsky(DataButtonsPanel, Panel): | ||||
| bl_label = "Sky & Atmosphere" | bl_label = "Sky & Atmosphere" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES) | return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| lamp = context.lamp.sky | lamp = context.lamp.sky | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| class DATA_PT_shadow(DataButtonsPanel, Panel): | class DATA_PT_shadow(DataButtonsPanel, Panel): | ||||
| bl_label = "Shadow" | bl_label = "Shadow" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | 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) | return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| layout.row().prop(lamp, "shadow_method", expand=True) | layout.row().prop(lamp, "shadow_method", expand=True) | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): | class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): | ||||
| bl_label = "Shadow" | bl_label = "Shadow" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | 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) | return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| self.layout.prop(lamp, "use_shadow", text="") | self.layout.prop(lamp, "use_shadow", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 33 Lines | |||||
| class DATA_PT_area(DataButtonsPanel, Panel): | class DATA_PT_area(DataButtonsPanel, Panel): | ||||
| bl_label = "Area Shape" | bl_label = "Area Shape" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES) | return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| col = layout.column() | col = layout.column() | ||||
| Show All 9 Lines | |||||
| class DATA_PT_spot(DataButtonsPanel, Panel): | class DATA_PT_spot(DataButtonsPanel, Panel): | ||||
| bl_label = "Spot Shape" | bl_label = "Spot Shape" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 18 Lines | |||||
| class DATA_PT_spot(DataButtonsPanel, Panel): | class DATA_PT_spot(DataButtonsPanel, Panel): | ||||
| bl_label = "Spot Shape" | bl_label = "Spot Shape" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 9 Lines | |||||
| class DATA_PT_falloff_curve(DataButtonsPanel, Panel): | class DATA_PT_falloff_curve(DataButtonsPanel, Panel): | ||||
| bl_label = "Falloff Curve" | bl_label = "Falloff Curve" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| lamp = context.lamp | 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) | return (lamp and lamp.type in {'POINT', 'SPOT'} and lamp.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| lamp = context.lamp | lamp = context.lamp | ||||
| self.layout.template_curve_mapping(lamp, "falloff_curve", use_negative_slope=True) | self.layout.template_curve_mapping(lamp, "falloff_curve", use_negative_slope=True) | ||||
| Show All 26 Lines | |||||