From 462014b59b4f5ad110ebfcbc17dfa1f896582110 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 8 Sep 2022 13:06:40 +0200 Subject: IDManagement: Add new `BKE_id_owner_get` accessor. Essentially calls `IDTypeInfo->owner_get` for now, will make more sense once the callback is changed to return the address of the pointer instead. --- source/blender/editors/space_outliner/outliner_collections.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc index 0ded4654c80..6b1ca5a53f8 100644 --- a/source/blender/editors/space_outliner/outliner_collections.cc +++ b/source/blender/editors/space_outliner/outliner_collections.cc @@ -377,10 +377,8 @@ void outliner_collection_delete( if (parent->flag & COLLECTION_IS_MASTER) { BLI_assert(parent->id.flag & LIB_EMBEDDED_DATA); - const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(&parent->id); - BLI_assert(id_type->owner_get != nullptr); - - ID *scene_owner = id_type->owner_get(&parent->id); + ID *scene_owner = BKE_id_owner_get(&parent->id); + BLI_assert(scene_owner != nullptr); BLI_assert(GS(scene_owner->name) == ID_SCE); if (ID_IS_LINKED(scene_owner) || ID_IS_OVERRIDE_LIBRARY(scene_owner)) { skip = true; @@ -610,10 +608,7 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op) else if (parent != nullptr && (parent->flag & COLLECTION_IS_MASTER) != 0) { BLI_assert(parent->id.flag & LIB_EMBEDDED_DATA); - const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(&parent->id); - BLI_assert(id_type->owner_get != nullptr); - - Scene *scene_owner = (Scene *)id_type->owner_get(&parent->id); + Scene *scene_owner = reinterpret_cast(BKE_id_owner_get(&parent->id)); BLI_assert(scene_owner != nullptr); BLI_assert(GS(scene_owner->id.name) == ID_SCE); -- cgit v1.2.3