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:
authorJeroen Bakker <jeroen@blender.org>2020-06-25 12:46:30 +0300
committerJeroen Bakker <jeroen@blender.org>2020-06-25 12:46:30 +0300
commitf575a148018ac943600ee78f1f35c3b9e472476e (patch)
tree63f7f070387a808a8c71b8546e0619fa29c3690c
parent91f07fbfd662ddb311d4dc459eab556db5936370 (diff)
Revert "Fix (unreported) critical mistake in Collection liblink code in readfile.c."
This reverts commit 517f32045c282f1031299268ad0ebfa8f934bd1a.
-rw-r--r--source/blender/blenloader/intern/readfile.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 657d776e57c..3c56ec966d5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6433,6 +6433,8 @@ static void lib_link_collection_data(FileData *fd, Library *lib, Collection *col
for (CollectionChild *child = collection->children.first; child != NULL; child = child->next) {
child->collection = newlibadr(fd, lib, child->collection);
}
+
+ BKE_collection_parent_relations_rebuild(collection);
}
static void lib_link_collection(FileData *fd, Main *UNUSED(bmain), Collection *collection)
@@ -10137,9 +10139,18 @@ static void lib_link_all(FileData *fd, Main *bmain)
* so simpler to just use it directly in this single call. */
BLO_main_validate_shapekeys(bmain, NULL);
- /* We have to rebuild that runtime information *after* all data-blocks have been properly linked.
- */
- BKE_main_collections_parent_relations_rebuild(bmain);
+ if (fd->memfile != NULL) {
+ /* When doing redo, we perform a tremendous amount of esoteric magic tricks to avoid having to
+ * re-read all library data-blocks.
+ * Unfortunately, that means that we do not clear Collections' parents lists, which then get
+ * improperly extended in some cases by lib_link_scene() and lib_link_collection() calls above
+ * (when one local collection is parent of linked ones).
+ * I do not really see a way to address that issue, besides brute force call below which
+ * invalidates and re-creates all parenting relationships between collections. Yet another
+ * example of why it is such a bad idea to keep that kind of double-linked relationships info
+ * 'permanently' in our data structures... */
+ BKE_main_collections_parent_relations_rebuild(bmain);
+ }
#ifndef NDEBUG
/* Double check we do not have any 'need link' tag remaining, this should never be the case once