[Bf-blender-cvs] [252c846c97e] temp-lanpr-cleanup2: Fix T70778: Library Override dissabled after re-instancing same collection in different scene.

Bastien Montagne noreply at git.blender.org
Wed Nov 13 06:04:55 CET 2019


Commit: 252c846c97ed1ca02b2624291497af02e2351a46
Author: Bastien Montagne
Date:   Fri Nov 8 17:47:48 2019 +0100
Branches: temp-lanpr-cleanup2
https://developer.blender.org/rB252c846c97ed1ca02b2624291497af02e2351a46

Fix T70778: Library Override dissabled after re-instancing same collection in different scene.

Very stupid mistake in own new generic ID lib_link function, that would try
to link ID pointers for all data-blocks, not only those actually needing it.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d45c43ceca6..872d3ef0592 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2619,10 +2619,13 @@ static void lib_link_id(FileData *fd, Main *main)
     ID *id;
 
     for (id = lb->first; id; id = id->next) {
-      if (id->override_library) {
-        id->override_library->reference = newlibadr_us(
-            fd, id->lib, id->override_library->reference);
-        id->override_library->storage = newlibadr_us(fd, id->lib, id->override_library->storage);
+      if (id->tag & LIB_TAG_NEED_LINK) {
+        if (id->override_library) {
+          id->override_library->reference = newlibadr_us(
+              fd, id->lib, id->override_library->reference);
+          id->override_library->storage = newlibadr_us(fd, id->lib, id->override_library->storage);
+        }
+        /* DO NOT clear LIB_TAG_NEED_LINK here, it is used again by per-ID-type linkers. */
       }
     }
   }



More information about the Bf-blender-cvs mailing list