[Bf-blender-cvs] [72089387079] master: Fix T104278: incorrect handling of unavailable linked node groups

Jacques Lucke noreply at git.blender.org
Thu Feb 2 16:39:08 CET 2023


Commit: 72089387079f09b536814d1e10ab54c3d114f603
Author: Jacques Lucke
Date:   Thu Feb 2 16:34:33 2023 +0100
Branches: master
https://developer.blender.org/rB72089387079f09b536814d1e10ab54c3d114f603

Fix T104278: incorrect handling of unavailable linked node groups

The declaration of group nodes using unavailable linked groups contains
a `skip_updating_sockets` tag, which indicates that the node shouldn't
change. This information was not used properly further down the line.

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

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

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

diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 48dad8d4034..74351022fd3 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -3591,11 +3591,24 @@ static void update_socket_declarations(ListBase *sockets,
   }
 }
 
+static void reset_socket_declarations(ListBase *sockets)
+{
+  LISTBASE_FOREACH (bNodeSocket *, socket, sockets) {
+    socket->runtime->declaration = nullptr;
+  }
+}
+
 void nodeSocketDeclarationsUpdate(bNode *node)
 {
   BLI_assert(node->runtime->declaration != nullptr);
-  update_socket_declarations(&node->inputs, node->runtime->declaration->inputs);
-  update_socket_declarations(&node->outputs, node->runtime->declaration->outputs);
+  if (node->runtime->declaration->skip_updating_sockets) {
+    reset_socket_declarations(&node->inputs);
+    reset_socket_declarations(&node->outputs);
+  }
+  else {
+    update_socket_declarations(&node->inputs, node->runtime->declaration->inputs);
+    update_socket_declarations(&node->outputs, node->runtime->declaration->outputs);
+  }
 }
 
 bool nodeDeclarationEnsureOnOutdatedNode(bNodeTree *ntree, bNode *node)



More information about the Bf-blender-cvs mailing list