From a8e7c8d59b32f0e3792ad48dda8193ad7c0ca30c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 30 Apr 2021 16:49:59 +0200 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/lib_override.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);