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...
This commit is contained in:
Bastien Montagne 2014-08-16 22:42:02 +02:00
parent 1ad9987af1
commit fe2b461398
1 changed files with 2 additions and 1 deletions

View File

@ -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: