diff options
author | Bastien Montagne <bastien@blender.org> | 2022-09-08 17:32:35 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-09-08 17:34:31 +0300 |
commit | 406243c2fde7472ea39f1eb6316311aec5b72e13 (patch) | |
tree | 2f14eea889d9ad6c8eebc0c40105e98148bf0d4c /source/blender/blenkernel/intern/collection.c | |
parent | 462014b59b4f5ad110ebfcbc17dfa1f896582110 (diff) |
IDManagement: change `IDTypeInfo.owner_get` to instead return address of the owner_id pointer.
Also rename the callback. That way, we can keep moving toward a more
generic handling of those embedded IDs (think e.g. about copy code).
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 2a544871716..dc04eb0dba3 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -169,10 +169,10 @@ static void collection_foreach_id(ID *id, LibraryForeachIDData *data) } } -static ID *collection_owner_get(ID *id) +static ID **collection_owner_pointer_get(ID *id) { if ((id->flag & LIB_EMBEDDED_DATA) == 0) { - return id; + return NULL; } BLI_assert((id->tag & LIB_TAG_NO_MAIN) == 0); @@ -182,7 +182,7 @@ static ID *collection_owner_get(ID *id) BLI_assert(GS(master_collection->owner_id->name) == ID_SCE); BLI_assert(((Scene *)master_collection->owner_id)->master_collection == master_collection); - return master_collection->owner_id; + return &master_collection->owner_id; } void BKE_collection_blend_write_nolib(BlendWriter *writer, Collection *collection) @@ -393,7 +393,7 @@ IDTypeInfo IDType_ID_GR = { .foreach_id = collection_foreach_id, .foreach_cache = NULL, .foreach_path = NULL, - .owner_get = collection_owner_get, + .owner_pointer_get = collection_owner_pointer_get, .blend_write = collection_blend_write, .blend_read_data = collection_blend_read_data, |