[Bf-blender-cvs] [fe2b461] master: Fix poll func of CYCLES_OT_use_shading_nodes.

Bastien Montagne noreply at git.blender.org
Sat Aug 16 22:44:29 CEST 2014


Commit: fe2b4613985f2e3914a7e54a1abe70a43871905d
Author: Bastien Montagne
Date:   Sat Aug 16 22:42:02 2014 +0200
Branches: master
https://developer.blender.org/rBfe2b4613985f2e3914a7e54a1abe70a43871905d

Fix poll func of CYCLES_OT_use_shading_nodes.

Operators' poll func might be called from anywhere in Blender, so they should
not make any assumption about available context. material, lamp and world
are specific to context from Properties space...

===================================================================

M	intern/cycles/blender/addon/ui.py

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 4a13f26..057b592 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -629,7 +629,8 @@ class CYCLES_OT_use_shading_nodes(Operator):
 
     @classmethod
     def poll(cls, context):
-        return context.material or context.world or context.lamp
+        return (getattr(context, "material", False) or getattr(context, "world", False) or
+                getattr(context, "lamp", False))
 
     def execute(self, context):
         if context.material:




More information about the Bf-blender-cvs mailing list