[Bf-blender-cvs] [1ffe27c438c] temp-nodes-group-declarations: Fix updating of input and output nodes when creating group

Hans Goudey noreply at git.blender.org
Thu Dec 22 17:51:51 CET 2022


Commit: 1ffe27c438cd653f876c0ffabff07fa56d336fc4
Author: Hans Goudey
Date:   Thu Dec 22 11:51:20 2022 -0500
Branches: temp-nodes-group-declarations
https://developer.blender.org/rB1ffe27c438cd653f876c0ffabff07fa56d336fc4

Fix updating of input and output nodes when creating group

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

M	source/blender/editors/space_node/node_group.cc
M	source/blender/nodes/intern/node_common.cc

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

diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc
index 866d11d284a..beaf206dff7 100644
--- a/source/blender/editors/space_node/node_group.cc
+++ b/source/blender/editors/space_node/node_group.cc
@@ -933,9 +933,10 @@ static void node_group_make_insert_selected(const bContext &C,
   }
   nodeRebuildIDVector(&ntree);
 
+  /* Update the input and output node first, since the group node declaration depends on them. */
+  nodes::update_node_declaration_and_sockets(group, *input_node);
+  nodes::update_node_declaration_and_sockets(group, *output_node);
   nodes::update_node_declaration_and_sockets(ntree, *gnode);
-  nodes::update_node_declaration_and_sockets(ntree, *input_node);
-  nodes::update_node_declaration_and_sockets(ntree, *output_node);
 
   /* move nodes in the group to the center */
   for (bNode *node : nodes_to_move) {
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc
index 0c1c34e1441..e2712e59895 100644
--- a/source/blender/nodes/intern/node_common.cc
+++ b/source/blender/nodes/intern/node_common.cc
@@ -446,9 +446,7 @@ static void group_input_declare_dynamic(const bNodeTree &node_tree,
     r_declaration.outputs_.append(declataion_for_interface_socket(*input));
     r_declaration.outputs_.last()->in_out_ = SOCK_OUT;
   }
-  if (!ID_IS_LINKED(&node_tree.id)) {
-    r_declaration.outputs_.append(extend_declaration(SOCK_OUT));
-  }
+  r_declaration.outputs_.append(extend_declaration(SOCK_OUT));
 }
 
 static void group_output_declare_dynamic(const bNodeTree &node_tree,
@@ -459,9 +457,7 @@ static void group_output_declare_dynamic(const bNodeTree &node_tree,
     r_declaration.inputs_.append(declataion_for_interface_socket(*input));
     r_declaration.inputs_.last()->in_out_ = SOCK_IN;
   }
-  if (!ID_IS_LINKED(&node_tree.id)) {
-    r_declaration.inputs_.append(extend_declaration(SOCK_IN));
-  }
+  r_declaration.inputs_.append(extend_declaration(SOCK_IN));
 }
 
 static bool group_input_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link)



More information about the Bf-blender-cvs mailing list