Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-08-17 00:42:02 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-08-17 00:42:02 +0400
commitfe2b4613985f2e3914a7e54a1abe70a43871905d (patch)
tree3638bda29ae20d192ddae81e9542d5b28108ddf1 /intern/cycles/blender/addon
parent1ad9987af14e4f5c8fbe168df2fbe39c058732e5 (diff)
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...
Diffstat (limited to 'intern/cycles/blender/addon')
-rw-r--r--intern/cycles/blender/addon/ui.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 4a13f265d14..057b59264a4 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: