diff options
author | Bastien Montagne <bastien@blender.org> | 2021-10-06 17:41:47 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-10-06 17:53:20 +0300 |
commit | bbfa6a92cf1c7581a09712401f50c0f0fc02240d (patch) | |
tree | 77597df9ad73f16060fa12086f2a67f76315dbd7 | |
parent | b7dc0346aae849d2ba3f81839a6fd682ff24114a (diff) |
Fix T91987: Linking overrides does not apply overrides rules.
Just a matter of calling `BKE_lib_override_library_main_update` in
`library_link_end`.
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3ee5e41bf1f..491322e06df 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5040,7 +5040,6 @@ static void library_link_end(Main *mainl, add_main_to_main(mainvar, main_newid); } - BKE_main_free(main_newid); blo_join_main((*fd)->mainlist); mainvar = (*fd)->mainlist->first; MEM_freeN((*fd)->mainlist); @@ -5054,6 +5053,15 @@ static void library_link_end(Main *mainl, placeholders_ensure_valid(mainvar); + /* Apply overrides of newly linked data if needed. Already existing IDs need to split out, to + * avoid re-applying their own overrides. */ + BLI_assert(BKE_main_is_empty(main_newid)); + split_main_newid(mainvar, main_newid); + BKE_lib_override_library_main_validate(main_newid, (*fd)->reports->reports); + BKE_lib_override_library_main_update(main_newid); + add_main_to_main(mainvar, main_newid); + BKE_main_free(main_newid); + BKE_main_id_tag_all(mainvar, LIB_TAG_NEW, false); /* Make all relative paths, relative to the open blend file. */ |