diff options
author | Bastien Montagne <bastien@blender.org> | 2022-09-06 10:26:39 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-09-06 17:23:06 +0300 |
commit | 3dd9ab341a0535670e9f6a3b3582bbc86c9b7e6a (patch) | |
tree | 0796e77b1960e703676a2f7a2c8a277d4eb331f6 /source/blender/blenkernel/intern/collection.c | |
parent | 987c3a3e220b273b9110aaa5fe28a85a5761a54d (diff) |
IDManagement: better debug checks in `owner_get` callbacks.
Simplify and make more efficients checks in collection one (missed
these in yesterday's commit rBcd49fee74114), add some to ShapeKey's one.
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index e0448afdec6..e77525d0cb7 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -175,20 +175,8 @@ static ID *collection_owner_get(Main *bmain, ID *id, ID *UNUSED(owner_id_hint)) Collection *master_collection = (Collection *)id; BLI_assert((master_collection->flag & COLLECTION_IS_MASTER) != 0); BLI_assert(master_collection->owner_id != NULL); - -#ifndef NDEBUG - bool is_owner_found = false; - LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { - if (scene->master_collection == master_collection) { - BLI_assert(master_collection->owner_id == &scene->id); - BLI_assert(!is_owner_found); - is_owner_found = true; - } - } - BLI_assert(is_owner_found); -#else - UNUSED_VARS(bmain); -#endif + 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; } |