Fix more issues with new name map and liboverrides.

Follow-up to rB13e17507c069, forgot to handle shapekeys...
This commit is contained in:
Bastien Montagne 2022-07-27 14:56:40 +02:00
parent 58dcd20998
commit 9f53272df4
1 changed files with 4 additions and 0 deletions

View File

@ -3657,7 +3657,9 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
Key *tmp_key = BKE_key_from_id(tmp_id);
if (local_key != nullptr && tmp_key != nullptr) {
tmp_key->id.flag |= (local_key->id.flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE);
BKE_main_namemap_remove_name(bmain, &tmp_key->id, tmp_key->id.name + 2);
tmp_key->id.lib = local_key->id.lib;
BLI_strncpy(tmp_key->id.name, local_key->id.name, sizeof(tmp_key->id.name));
}
PointerRNA rnaptr_src, rnaptr_dst, rnaptr_storage_stack, *rnaptr_storage = nullptr;
@ -3741,6 +3743,8 @@ void BKE_lib_override_library_main_update(Main *bmain)
Main *orig_gmain = G_MAIN;
G_MAIN = bmain;
BLI_assert(BKE_main_namemap_validate(bmain));
FOREACH_MAIN_ID_BEGIN (bmain, id) {
if (id->override_library != nullptr) {
BKE_lib_override_library_update(bmain, id);