[Bf-blender-cvs] [00af3e9472f] blender-v3.2-release: Fix: Node editor "Group" panel displays for embedded node trees

Hans Goudey noreply at git.blender.org
Mon May 16 17:17:22 CEST 2022


Commit: 00af3e9472f3a26c3c0faf8ee3fe5d7f3b8d6b0f
Author: Hans Goudey
Date:   Mon May 16 17:17:16 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB00af3e9472f3a26c3c0faf8ee3fe5d7f3b8d6b0f

Fix: Node editor "Group" panel displays for embedded node trees

Embedded node trees are not groups, since their inputs and outputs
are not exposed anywhere. So these panels should not be displayed.

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

M	release/scripts/startup/bl_ui/space_node.py

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

diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index e105b07ec53..813a799db24 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -727,7 +727,20 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
             layout.template_node_socket(color=color)
 
 
-class NodeTreeInterfacePanel:
+class NodeTreeInterfacePanel(Panel):
+
+    @classmethod
+    def poll(cls, context):
+        snode = context.space_data
+        if snode is None:
+            return False
+        tree = snode.edit_tree
+        if tree is None:
+            return False
+        if tree.is_embedded_data:
+            return False
+        return True
+
     def draw_socket_list(self, context, in_out, sockets_propname, active_socket_propname):
         layout = self.layout
 
@@ -804,32 +817,22 @@ class NodeTreeInterfacePanel:
             active_socket.draw(context, layout)
 
 
-class NODE_PT_node_tree_interface_inputs(NodeTreeInterfacePanel, Panel):
+class NODE_PT_node_tree_interface_inputs(NodeTreeInterfacePanel):
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'UI'
     bl_category = "Group"
     bl_label = "Inputs"
 
-    @classmethod
-    def poll(cls, context):
-        snode = context.space_data
-        return snode.edit_tree is not None
-
     def draw(self, context):
         self.draw_socket_list(context, "IN", "inputs", "active_input")
 
 
-class NODE_PT_node_tree_interface_outputs(NodeTreeInterfacePanel, Panel):
+class NODE_PT_node_tree_interface_outputs(NodeTreeInterfacePanel):
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'UI'
     bl_category = "Group"
     bl_label = "Outputs"
 
-    @classmethod
-    def poll(cls, context):
-        snode = context.space_data
-        return snode.edit_tree is not None
-
     def draw(self, context):
         self.draw_socket_list(context, "OUT", "outputs", "active_output")



More information about the Bf-blender-cvs mailing list