diff options
author | Bastien Montagne <bastien@blender.org> | 2021-04-30 17:49:59 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-04-30 19:49:01 +0300 |
commit | a8e7c8d59b32f0e3792ad48dda8193ad7c0ca30c (patch) | |
tree | f50ecbef3d0411ec336026238f4686358fbe4435 | |
parent | aadfa31cf000f74f6b16f311c1532e2c6c1a384b (diff) |
LibOverride: Fix infinite resync loop in some invalid file cases.
Multi-overrides of a same linked ID in a same override hierarchy are
currently not supported and can cause all kind of issues.
In some cases they could lead to infinite loop trying to resync the same
ID over and over, this is now prevented.
Found in some Blender studio production files.
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 40b7681614d..45ba2526da2 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1224,6 +1224,13 @@ void BKE_lib_override_library_main_resync(Main *bmain, Scene *scene, ViewLayer * } do_continue = true; + /* In complex non-supported cases, with several different override hierarchies sharing + * relations between each-other, we may end up not actually updating/replacing the given + * root id (see e.g. pro/shots/110_rextoria/110_0150_A/110_0150_A.anim.blend of sprites + * project repository, r2687). + * This can lead to infinite loop here, at least avoid this. */ + id->tag &= ~LIB_TAG_LIB_OVERRIDE_NEED_RESYNC; + CLOG_INFO(&LOG, 2, "Resyncing %s...", id->name); const bool success = BKE_lib_override_library_resync( bmain, scene, view_layer, id, override_resync_residual_storage, false, false); |