[Bf-blender-cvs] [36234e49485] override-recursive-resync: IDManagement: Shapekey: add a `owner_get` callback.

Bastien Montagne noreply at git.blender.org
Wed May 26 18:01:30 CEST 2021


Commit: 36234e494859ca58d1fddc22bea9ed08b13589bf
Author: Bastien Montagne
Date:   Wed May 26 15:43:12 2021 +0200
Branches: override-recursive-resync
https://developer.blender.org/rB36234e494859ca58d1fddc22bea9ed08b13589bf

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...

===================================================================

M	source/blender/blenkernel/intern/key.c

===================================================================

diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index f2893e162cb..073276b7011 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -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,



More information about the Bf-blender-cvs mailing list