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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user