Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-11-19 16:23:48 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-11-19 17:55:05 +0300
commit42b2ae5f694d554b1f4c58acd0afd26516b9ed20 (patch)
tree8ecbae259cdc8f5801139f522f66e4e077069035 /source/blender/nodes/intern
parentc5306dd0cdf1f320f7b498d7b914d9374a7aa90f (diff)
Fix lost node links when linked node group datablock is temporarily missing
Don't refresh the list of sockets, so that when the .blend file is restored the links remain valid. Also display such nodes in red to indicate an error, same as when the node type info is missing.
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/node_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 36b9098d972..0b1ab85c059 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -188,6 +188,10 @@ void node_group_update(struct bNodeTree *ntree, struct bNode *node)
if (node->id == NULL) {
nodeRemoveAllSockets(ntree, node);
}
+ else if ((ID_IS_LINKED(node->id) && (node->id->tag & LIB_TAG_MISSING))) {
+ /* Missing datablock, leave sockets unchanged so that when it comes back
+ * the links remain valid. */
+ }
else {
bNodeTree *ngroup = (bNodeTree *)node->id;
group_verify_socket_list(ntree, node, &ngroup->inputs, &node->inputs, SOCK_IN);