diff options
author | Bastien Montagne <bastien@blender.org> | 2021-03-19 14:23:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-03-19 14:24:53 +0300 |
commit | d235f6a48e9402d0e0835441bee1389b70832ba6 (patch) | |
tree | 12bbd8e4a1309812725105f01b2b0c97e35032c2 | |
parent | ae650b016f760b103670b3d2f3a18d150cd05ce5 (diff) |
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).
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |