From d1f96f9b1194404ffafd2540cd2928048779656e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 22 May 2019 22:51:36 +0200 Subject: BKE Collection: Add new function to rebuild parent relationships. It's not always possible to keep 'by hand' parent relationships valid in collections hierarchy. Add functions to remake those (re-using/factorizing code from `readfile.c` `lib_link_collection_data()` function). Can't stress again how painful it is to have those kind of backward relationships in our data structures, those *always* end up being serious issues to keep in sync... Should only be generated on the fly when needed, period. :( --- source/blender/blenkernel/BKE_collection.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel/BKE_collection.h') diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index 0e093bb086b..502c949be9a 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -163,6 +163,9 @@ bool BKE_collection_find_cycle(struct Collection *new_ancestor, struct Collectio bool BKE_collection_has_collection(struct Collection *parent, struct Collection *collection); +void BKE_collection_parent_relations_rebuild(struct Collection *collection); +void BKE_main_collections_parent_relations_rebuild(struct Main *bmain); + /* Iteration callbacks. */ typedef void (*BKE_scene_objects_Cb)(struct Object *ob, void *data); -- cgit v1.2.3