From ad586e7eeb1982cbc6ad8cb721b0df7cea868a2e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 23 Jul 2020 17:07:48 +0200 Subject: LibOverride: Add update of overrides when reloading library data. Pretty straight-forward, although it does not rebuild relationships (this is a heavy process we do not want to automate for now, will be a separate operator in near future). Fix T78179: Library Overrides - Additional geometry not updating without reloading scene. --- source/blender/windowmanager/intern/wm_files_link.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/windowmanager/intern/wm_files_link.c') diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 6bc87ecb6cf..31d36603505 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -939,6 +939,21 @@ static void lib_relocate_do(Main *bmain, } } + /* Update overrides of reloaded linked data-blocks. + * Note that this will not necessarily fully update the override, it might need to be manually + * 're-generated' depending on changes in linked data. */ + ID *id; + FOREACH_MAIN_ID_BEGIN (bmain, id) { + if (ID_IS_LINKED(id) || !ID_IS_OVERRIDE_LIBRARY_REAL(id) || + (id->tag & LIB_TAG_PRE_EXISTING) == 0) { + continue; + } + if (id->override_library->reference->lib == library) { + BKE_lib_override_library_update(bmain, id); + } + } + FOREACH_MAIN_ID_END; + BKE_main_collection_sync(bmain); BKE_main_lib_objects_recalc_all(bmain); -- cgit v1.2.3