Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-02-13 18:54:44 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-13 18:56:31 +0300
commit92e41bb1a8a540e8f1f5abdd4127647815ebb22c (patch)
treea6014d736668a08cbf2eae5b4f6b019e533bc5ce /source/blender/blenkernel
parent52f326ed4848e5ee48876ba81e210685dc7a1970 (diff)
Fix for fix (c) assert from own recent commit.
This master_collection thing is really, really annoyingly spreading all over the place...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/lib_query.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 4b075520b21..2cd45d1486f 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -338,7 +338,13 @@ static void library_foreach_bone(LibraryForeachIDData *data, Bone *bone)
static void library_foreach_layer_collection(LibraryForeachIDData *data, ListBase *lb)
{
for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
- FOREACH_CALLBACK_INVOKE(data, lc->collection, IDWALK_CB_NOP);
+ /* XXX This is very weak. The whole idea of keeping pointers to private IDs is very bad
+ * anyway... */
+ const int cb_flag = (lc->collection != NULL &&
+ (lc->collection->id.flag & LIB_PRIVATE_DATA) != 0) ?
+ IDWALK_CB_PRIVATE :
+ IDWALK_CB_NOP;
+ FOREACH_CALLBACK_INVOKE(data, lc->collection, cb_flag);
library_foreach_layer_collection(data, &lc->layer_collections);
}
@@ -356,7 +362,14 @@ static void library_foreach_collection(LibraryForeachIDData *data, Collection *c
FOREACH_CALLBACK_INVOKE(data, child->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_USER);
}
for (CollectionParent *parent = collection->parents.first; parent; parent = parent->next) {
- FOREACH_CALLBACK_INVOKE(data, parent->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_LOOPBACK);
+ /* XXX This is very weak. The whole idea of keeping pointers to private IDs is very bad
+ * anyway... */
+ const int cb_flag = ((parent->collection != NULL &&
+ (parent->collection->id.flag & LIB_PRIVATE_DATA) != 0) ?
+ IDWALK_CB_PRIVATE :
+ IDWALK_CB_NOP);
+ FOREACH_CALLBACK_INVOKE(
+ data, parent->collection, IDWALK_CB_NEVER_SELF | IDWALK_CB_LOOPBACK | cb_flag);
}
FOREACH_FINALIZE_VOID;