[Bf-blender-cvs] [798b5808114] temp-T97352-3d-texturing-seam-bleeding-b2: Fix T101166: crash when creating group input socket

Jacques Lucke noreply at git.blender.org
Tue Sep 20 10:32:15 CEST 2022


Commit: 798b5808114f9cecdcd38ab2ad362f18e02a1a04
Author: Jacques Lucke
Date:   Sun Sep 18 21:06:56 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB798b5808114f9cecdcd38ab2ad362f18e02a1a04

Fix T101166: crash when creating group input socket

The issue was that not all Group Input nodes were updated when
the node group interface changed.

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

M	source/blender/blenkernel/intern/node_tree_update.cc

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

diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc
index b2caaa912d7..dcb6666317f 100644
--- a/source/blender/blenkernel/intern/node_tree_update.cc
+++ b/source/blender/blenkernel/intern/node_tree_update.cc
@@ -1047,6 +1047,7 @@ class NodeTreeMainUpdater {
 
   void update_individual_nodes(bNodeTree &ntree)
   {
+    Vector<bNode *> group_inout_nodes;
     LISTBASE_FOREACH (bNode *, node, &ntree.nodes) {
       nodeDeclarationEnsure(&ntree, node);
       if (this->should_update_individual_node(ntree, *node)) {
@@ -1058,6 +1059,18 @@ class NodeTreeMainUpdater {
           ntype.updatefunc(&ntree, node);
         }
       }
+      if (ELEM(node->type, NODE_GROUP_INPUT, NODE_GROUP_OUTPUT)) {
+        group_inout_nodes.append(node);
+      }
+    }
+    /* The update function of group input/output nodes may add new interface sockets. When that
+     * happens, all the input/output nodes have to be updated again. In the future it would be
+     * better to move this functionality out of the node update function into the operator that's
+     * supposed to create the new interface socket. */
+    if (ntree.runtime->changed_flag & NTREE_CHANGED_INTERFACE) {
+      for (bNode *node : group_inout_nodes) {
+        node->typeinfo->updatefunc(&ntree, node);
+      }
     }
   }



More information about the Bf-blender-cvs mailing list