fix shader editor errors when showing world shader tree

probably an oversight in rBd40bffa17f6d

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4079
This commit is contained in:
Philipp Oeser
2018-12-14 17:58:12 +01:00
parent ccc09ec124
commit ac68f44b8a
2 changed files with 6 additions and 3 deletions

View File

@@ -567,7 +567,8 @@ class EEVEE_NODE_PT_material_settings(Panel):
def poll(cls, context):
snode = context.space_data
return (context.engine in cls.COMPAT_ENGINES) and \
snode.tree_type == 'ShaderNodeTree' and snode.id
snode.tree_type == 'ShaderNodeTree' and snode.id and \
snode.id.bl_rna.identifier == 'Material'
def draw(self, context):
material = context.space_data.id
@@ -584,7 +585,8 @@ class NODE_PT_material_viewport(Panel):
@classmethod
def poll(cls, context):
snode = context.space_data
return snode.tree_type == 'ShaderNodeTree' and snode.id
return snode.tree_type == 'ShaderNodeTree' and snode.id and \
snode.id.bl_rna.identifier == 'Material'
def draw(self, context):
material = context.space_data.id