From 62421470ee09fb70f343eb9fd48b093316c8eea1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 20 Apr 2019 20:25:21 +0200 Subject: Nodes: remove group node forward compatibility with version 2.66 Forward compatibility with that version is already long gone, and removing it means we can avoid running some complicated code on every file read/write. --- source/blender/blenloader/intern/versioning_260.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/versioning_260.c') diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 8010ca8b1b8..efe052c482f 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -2566,7 +2566,7 @@ void do_versions_after_linking_260(Main *bmain) * Note: this always runs, without it links with NULL fromnode and tonode remain * which causes problems. */ - { + if (!MAIN_VERSION_ATLEAST(bmain, 266, 3)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { bNode *input_node = NULL, *output_node = NULL; int num_inputs = 0, num_outputs = 0; @@ -2655,4 +2655,21 @@ void do_versions_after_linking_260(Main *bmain) } FOREACH_NODETREE_END; } + + if (!MAIN_VERSION_ATLEAST(bmain, 280, 59)) { + /* From this point we no longer write incomplete links for forward + * compatibility with 2.66, we have to clean them up for all previous + * versions. */ + FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + bNodeLink *link, *next_link; + + for (link = ntree->links.first; link; link = next_link) { + next_link = link->next; + if (link->fromnode == NULL || link->tonode == NULL) { + nodeRemLink(ntree, link); + } + } + } + FOREACH_NODETREE_END; + } } -- cgit v1.2.3