Refactor: IDTypeInfo: Add owner_get to get owner of embedded IDs.

This concerns currently only collections (`master_collection` of scenes)
and root node trees. It removes the matching type-specific helpers
(`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`).

No functional change expected here.

NOTE: Current implementation of `owner_get` is far from optimal, we
could probably do it better, see {T69169}.

NOTE: While it could also have it, shapekeys IDTypeInfo was left out of
this change for now. Mainly because it sould not be used currently, and
we ultimately want to demote shape keys from ID status anyway.
This commit is contained in:
2021-02-25 10:17:31 +01:00
parent b5d39f9b46
commit de25b79ff5
44 changed files with 138 additions and 64 deletions

View File

@@ -199,6 +199,7 @@ IDTypeInfo IDType_ID_WO = {
.make_local = NULL,
.foreach_id = world_foreach_id,
.foreach_cache = NULL,
.owner_get = NULL,
.blend_write = world_blend_write,
.blend_read_data = world_blend_read_data,