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.
This commit is contained in:
Jacques Lucke 2023-02-02 16:34:33 +01:00
parent 2a19810f97
commit 7208938707
Notes: blender-bot 2023-02-14 08:08:54 +01:00
Referenced by issue #104432, Fix #104383: Don't update declaration for clipboard copy
Referenced by issue #104278, Crash in geometrynode doversion code when opening Sprite production file
1 changed files with 15 additions and 2 deletions

View File

@ -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)