fix shader editor errors when showing world shader tree
authorPhilipp Oeser <info@graphics-engineer.com>
Fri, 14 Dec 2018 16:58:12 +0000 (17:58 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Fri, 14 Dec 2018 18:01:22 +0000 (19:01 +0100)
probably an oversight in rBd40bffa17f6d

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4079

intern/cycles/blender/addon/ui.py
release/scripts/startup/bl_ui/space_node.py

index 114aa45ffa3c5af2a46beeb75c6f9f13a448f1bc..8e57d3a0c2f42e04514510c486be22021a15b16c 100644 (file)
@@ -1980,7 +1980,8 @@ class CYCLES_NODE_PT_settings(CyclesNodeButtonsPanel, Panel):
     def poll(cls, context):
         snode = context.space_data
         return CyclesNodeButtonsPanel.poll(context) 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
index 1674940b77febcdbb6a767eb8a16ebf60406a4a1..00f54c82036d4f2c52a3b4f6a960b4c0d74106ad 100644 (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