[Bf-blender-cvs] [ad586e7eeb1] blender-v2.90-release: LibOverride: Add update of overrides when reloading library data.

Bastien Montagne noreply at git.blender.org
Thu Jul 23 17:15:41 CEST 2020


Commit: ad586e7eeb1982cbc6ad8cb721b0df7cea868a2e
Author: Bastien Montagne
Date:   Thu Jul 23 17:07:48 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBad586e7eeb1982cbc6ad8cb721b0df7cea868a2e

LibOverride: Add update of overrides when reloading library data.

Pretty straight-forward, although it does not rebuild relationships
(this is a heavy process we do not want to automate for now, will be a
separate operator in near future).

Fix T78179: Library Overrides - Additional geometry not updating without reloading scene.

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

M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 6bc87ecb6cf..31d36603505 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -939,6 +939,21 @@ static void lib_relocate_do(Main *bmain,
     }
   }
 
+  /* Update overrides of reloaded linked data-blocks.
+   * Note that this will not necessarily fully update the override, it might need to be manually
+   * 're-generated' depending on changes in linked data. */
+  ID *id;
+  FOREACH_MAIN_ID_BEGIN (bmain, id) {
+    if (ID_IS_LINKED(id) || !ID_IS_OVERRIDE_LIBRARY_REAL(id) ||
+        (id->tag & LIB_TAG_PRE_EXISTING) == 0) {
+      continue;
+    }
+    if (id->override_library->reference->lib == library) {
+      BKE_lib_override_library_update(bmain, id);
+    }
+  }
+  FOREACH_MAIN_ID_END;
+
   BKE_main_collection_sync(bmain);
 
   BKE_main_lib_objects_recalc_all(bmain);



More information about the Bf-blender-cvs mailing list