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 | ||||
| ▲ Show 20 Lines • Show All 209 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 | |||||