[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31329] trunk/blender/release/scripts/ui/ properties_world.py: fix for error in world buttons when the world was None
Campbell Barton
ideasman42 at gmail.com
Sat Aug 14 00:35:13 CEST 2010
Revision: 31329
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31329
Author: campbellbarton
Date: 2010-08-14 00:35:13 +0200 (Sat, 14 Aug 2010)
Log Message:
-----------
fix for error in world buttons when the world was None
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_world.py
Modified: trunk/blender/release/scripts/ui/properties_world.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_world.py 2010-08-13 21:49:31 UTC (rev 31328)
+++ trunk/blender/release/scripts/ui/properties_world.py 2010-08-13 22:35:13 UTC (rev 31329)
@@ -29,8 +29,7 @@
@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 @@
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 @@
@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
More information about the Bf-blender-cvs
mailing list