IDManagement: Shapekey: add a `owner_get` callback.

Even though shepkeys are not strictly speaking an embedded data, they
share quiet a few points with those, and from liboverride perspective
they are embedded, so...
This commit is contained in:
Bastien Montagne 2021-05-26 15:43:12 +02:00
parent 653d39cec3
commit daf39af70a
1 changed files with 8 additions and 1 deletions

View File

@ -105,6 +105,11 @@ static void shapekey_foreach_id(ID *id, LibraryForeachIDData *data)
BKE_LIB_FOREACHID_PROCESS_ID(data, key->from, IDWALK_CB_LOOPBACK);
}
static ID *shapekey_owner_get(Main *UNUSED(bmain), ID *id)
{
return ((Key *)id)->from;
}
static void shapekey_blend_write(BlendWriter *writer, ID *id, const void *id_address)
{
Key *key = (Key *)id;
@ -216,7 +221,9 @@ IDTypeInfo IDType_ID_KE = {
.make_local = NULL,
.foreach_id = shapekey_foreach_id,
.foreach_cache = NULL,
.owner_get = NULL, /* Could have one actually? */
/* A bit weird, due to shapekeys not being strictly speaking embedded data... But they also
* share a lot with those (non linkable, only ever used by one owner ID, etc.). */
.owner_get = shapekey_owner_get,
.blend_write = shapekey_blend_write,
.blend_read_data = shapekey_blend_read_data,