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:
2023-02-02 16:34:33 +01:00
parent 2a19810f97
commit 7208938707

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)