From ae6a63253499eb83f5e6c260e598e7f8fd0cae13 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 Aug 2010 22:35:13 +0000 Subject: fix for error in world buttons when the world was None --- release/scripts/ui/properties_world.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/release/scripts/ui/properties_world.py b/release/scripts/ui/properties_world.py index 1fa0d15a90b..bb5758ff902 100644 --- a/release/scripts/ui/properties_world.py +++ b/release/scripts/ui/properties_world.py @@ -29,8 +29,7 @@ class WorldButtonsPanel(): @classmethod def poll(cls, context): - rd = context.scene.render - return (rd.engine in cls.COMPAT_ENGINES) + return (context.world and context.scene.render.engine in cls.COMPAT_ENGINES) class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel): @@ -70,12 +69,6 @@ class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel): self.layout.template_preview(context.world) - - - - - - class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel): bl_label = "World" COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -141,8 +134,8 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): - light = context.world.lighting - return light.gather_method == 'APPROXIMATE' + light = getattr(context.world, "lighting", None) + return light and light.gather_method == 'APPROXIMATE' def draw_header(self, context): light = context.world.lighting -- cgit v1.2.3