diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-23 18:07:48 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-23 18:15:32 +0300 |
commit | ad586e7eeb1982cbc6ad8cb721b0df7cea868a2e (patch) | |
tree | e0adc3c926bf53aacb5dd5f9f3ebcb477888ed58 /source/blender | |
parent | 50cb693f1de613c3323063b8aae298bfa822076f (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 15 |
1 files changed, 15 insertions, 0 deletions
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); |