diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-10 18:57:41 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-10 18:57:41 +0300 |
commit | 9c2613d1b6d034b4d80367df06ec4cd08d9bbbaa (patch) | |
tree | 5b783f113e0dcc272e414813377762997f86538d /source/blender/blenkernel | |
parent | cd349dc4023aa1e6b4728ae6804ae36a5e170758 (diff) | |
parent | 1dd177241908906254527052beb01aa52745b6a8 (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index a2338eb9b39..9dc64365f0c 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1384,7 +1384,21 @@ void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain) continue; } if (id->override_library->hierarchy_root != NULL) { - continue; + if (!ID_IS_OVERRIDE_LIBRARY_REAL(id->override_library->hierarchy_root) || + id->override_library->hierarchy_root->lib != id->lib) { + CLOG_ERROR( + &LOG, + "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a " + "new valid one", + id->override_library->hierarchy_root != NULL ? + id->override_library->hierarchy_root->name : + "<NONE>", + id->name); + id->override_library->hierarchy_root = NULL; + } + else { + continue; + } } BKE_main_relations_tag_set(bmain, MAINIDRELATIONS_ENTRY_TAGS_PROCESSED, false); @@ -1402,7 +1416,7 @@ void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain) continue; } - lib_override_root_hierarchy_set(bmain, id_root, id_root, NULL); + lib_override_root_hierarchy_set(bmain, id_root, id, NULL); BLI_assert(id->override_library->hierarchy_root != NULL); } @@ -1451,6 +1465,7 @@ static void lib_override_library_remap(Main *bmain, remapper, ID_REMAP_FORCE_USER_REFCOUNT | ID_REMAP_FORCE_NEVER_NULL_USAGE); BKE_id_remapper_free(remapper); + BLI_linklist_free(nomain_ids, NULL); } static bool lib_override_library_resync(Main *bmain, @@ -2058,6 +2073,10 @@ static bool lib_override_resync_tagging_finalize_recurse( CLOG_INFO(&LOG, 4, "Found root ID '%s' for resync root ID '%s'", id_root->name, id->name); + if (id_root->override_library == NULL) { + BLI_assert(0); + } + LinkNodePair **id_resync_roots_p; if (!BLI_ghash_ensure_p(id_roots, id_root, (void ***)&id_resync_roots_p)) { *id_resync_roots_p = MEM_callocN(sizeof(**id_resync_roots_p), __func__); |