Fix T63674: Incorrect poll methods in node category classes
authornBurn <nBurn>
Wed, 17 Apr 2019 11:36:20 +0000 (13:36 +0200)
committerJacques Lucke <mail@jlucke.com>
Wed, 17 Apr 2019 11:38:31 +0000 (13:38 +0200)
Differential Revision: https://developer.blender.org/D4697

release/scripts/startup/nodeitems_builtins.py

index 6077206..9f0a7f0 100644 (file)
@@ -40,19 +40,22 @@ class SortedNodeCategory(NodeCategory):
 class CompositorNodeCategory(SortedNodeCategory):
     @classmethod
     def poll(cls, context):
-        return (context.space_data.tree_type == 'CompositorNodeTree')
+        return (context.space_data.type == 'NODE_EDITOR' and
+                context.space_data.tree_type == 'CompositorNodeTree')
 
 
 class ShaderNodeCategory(SortedNodeCategory):
     @classmethod
     def poll(cls, context):
-        return (context.space_data.tree_type == 'ShaderNodeTree')
+        return (context.space_data.type == 'NODE_EDITOR' and
+                context.space_data.tree_type == 'ShaderNodeTree')
 
 
 class TextureNodeCategory(SortedNodeCategory):
     @classmethod
     def poll(cls, context):
-        return context.space_data.tree_type == 'TextureNodeTree'
+        return (context.space_data.type == 'NODE_EDITOR' and
+                context.space_data.tree_type == 'TextureNodeTree')
 
 
 # menu entry for node group tools