Fix missing proper 'make local' call for liboverrides from outliner.

Also includes minor improvements to
`BKE_lib_override_library_make_local` itself.

This is a complement to rB37458798fa02c.
This commit is contained in:
Bastien Montagne 2021-10-05 17:04:35 +02:00
parent c11585a82f
commit 11be9edae2
Notes: blender-bot 2023-02-14 03:59:42 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
2 changed files with 11 additions and 1 deletions

View File

@ -1918,6 +1918,16 @@ void BKE_lib_override_library_delete(Main *bmain, ID *id_root)
*/
void BKE_lib_override_library_make_local(ID *id)
{
if (!ID_IS_OVERRIDE_LIBRARY(id)) {
return;
}
if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id)) {
/* We should never directly 'make local' virtual overrides (aka shape keys). */
BLI_assert_unreachable();
id->flag &= ~LIB_EMBEDDED_DATA_LIB_OVERRIDE;
return;
}
BKE_lib_override_library_free(&id->override_library, true);
Key *shape_key = BKE_key_from_id(id);

View File

@ -742,7 +742,7 @@ static void id_local_fn(bContext *C,
}
}
else if (ID_IS_OVERRIDE_LIBRARY_REAL(tselem->id)) {
BKE_lib_override_library_free(&tselem->id->override_library, true);
BKE_lib_override_library_make_local(tselem->id);
}
}