[Bf-blender-cvs] [ac68f44b8a0] blender2.8: fix shader editor errors when showing world shader tree

Philipp Oeser noreply at git.blender.org
Fri Dec 14 19:03:38 CET 2018


Commit: ac68f44b8a0cb5926af2977721fc01cb4eb8e1b7
Author: Philipp Oeser
Date:   Fri Dec 14 17:58:12 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBac68f44b8a0cb5926af2977721fc01cb4eb8e1b7

fix shader editor errors when showing world shader tree

probably an oversight in rBd40bffa17f6d

Reviewers: brecht

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

===================================================================

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

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 114aa45ffa3..8e57d3a0c2f 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -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
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 1674940b77f..00f54c82036 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -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



More information about the Bf-blender-cvs mailing list