Fix T63674: Incorrect poll methods in node category classes

Differential Revision: https://developer.blender.org/D4697
This commit is contained in:
nBurn 2019-04-17 13:36:20 +02:00 committed by Jacques Lucke
parent f73255c1be
commit 05b8b54018
Notes: blender-bot 2023-02-14 11:08:33 +01:00
Referenced by issue #63674, Errors thrown in console when running Operator Cheat Sheet
1 changed files with 6 additions and 3 deletions

View 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