Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_world.py
| Show All 25 Lines | |||||
| class WorldButtonsPanel: | class WorldButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "world" | bl_context = "world" | ||||
| # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.world and context.scene.render.engine in cls.COMPAT_ENGINES) | return (context.world and context.engine in cls.COMPAT_ENGINES) | ||||
| class WORLD_PT_context_world(WorldButtonsPanel, Panel): | class WORLD_PT_context_world(WorldButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return rd.engine in cls.COMPAT_ENGINES | return view_render.engine in cls.COMPAT_ENGINES | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| scene = context.scene | scene = context.scene | ||||
| world = context.world | world = context.world | ||||
| space = context.space_data | space = context.space_data | ||||
| Show All 10 Lines | |||||
| class WORLD_PT_preview(WorldButtonsPanel, Panel): | class WORLD_PT_preview(WorldButtonsPanel, Panel): | ||||
| bl_label = "Preview" | bl_label = "Preview" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rd = context.scene.render | return (context.world) and (context.engine in cls.COMPAT_ENGINES) | ||||
| return (context.world) and (rd.engine in cls.COMPAT_ENGINES) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| self.layout.template_preview(context.world) | self.layout.template_preview(context.world) | ||||
| class WORLD_PT_world(WorldButtonsPanel, Panel): | class WORLD_PT_world(WorldButtonsPanel, Panel): | ||||
| bl_label = "World" | bl_label = "World" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| ▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
| class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel): | class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel): | ||||
| bl_label = "Surface" | bl_label = "Surface" | ||||
| bl_context = "world" | bl_context = "world" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return context.world and (engine in cls.COMPAT_ENGINES) | return context.world and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| world = context.world | world = context.world | ||||
| layout.prop(world, "use_nodes", icon='NODETREE') | layout.prop(world, "use_nodes", icon='NODETREE') | ||||
| Show All 35 Lines | |||||