[Bf-blender-cvs] [c56e8ae9190] ui-asset-view-template: LibOverride: fix code trying to auto-resync linked overrides.

Bastien Montagne noreply at git.blender.org
Sun Mar 21 16:12:00 CET 2021


Commit: c56e8ae91901fcdc10a6968535fe80f696a220dd
Author: Bastien Montagne
Date:   Fri Mar 19 12:23:18 2021 +0100
Branches: ui-asset-view-template
https://developer.blender.org/rBc56e8ae91901fcdc10a6968535fe80f696a220dd

LibOverride: fix code trying to auto-resync linked overrides.

This is not only potentially extremely expensive, it is also fairly
futile, and code is not designed to handle it currently anyway (could
easily end up in inifinite loops and other crashes).

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

M	source/blender/blenkernel/intern/lib_override.c

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

diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 3b5566c6cdc..cc2d384bcb8 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -862,6 +862,7 @@ bool BKE_lib_override_library_resync(
     Main *bmain, Scene *scene, ViewLayer *view_layer, ID *id_root, const bool do_hierarchy_enforce)
 {
   BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_root));
+  BLI_assert(!ID_IS_LINKED(id_root));
 
   ID *id_root_reference = id_root->override_library->reference;
 
@@ -1108,7 +1109,7 @@ void BKE_lib_override_library_main_resync(Main *bmain, Scene *scene, ViewLayer *
    * those used by current existing overrides. */
   ID *id;
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
-    if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
+    if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) {
       continue;
     }
     if (id->tag & (LIB_TAG_DOIT | LIB_TAG_MISSING)) {
@@ -1130,7 +1131,7 @@ void BKE_lib_override_library_main_resync(Main *bmain, Scene *scene, ViewLayer *
   /* Now check existing overrides, those needing resync will be the one either already tagged as
    * such, or the one using linked data that is now tagged as needing override. */
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
-    if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
+    if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) {
       continue;
     }
 
@@ -1180,6 +1181,10 @@ void BKE_lib_override_library_main_resync(Main *bmain, Scene *scene, ViewLayer *
         if ((id->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) == 0) {
           continue;
         }
+        BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id));
+        if (ID_IS_LINKED(id)) {
+          continue;
+        }
         do_continue = true;
         CLOG_INFO(&LOG, 2, "Resyncing %s...", id->name);
         const bool success = BKE_lib_override_library_resync(bmain, scene, view_layer, id, false);



More information about the Bf-blender-cvs mailing list