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 <montagne29@wanadoo.fr>2018-11-14 18:40:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-14 19:07:02 +0300
commitb7855862327043b858c5787864ada6f2a2c86ea4 (patch)
tree6b05140c7ba8517723c3e8e8a0c0d9aa1e9a0e1a /source/blender/blenkernel/intern/collection.c
parent46ac317a292d94f73e1583929423d8a3c5f14530 (diff)
Fix T57558: Outliner displaying same object twice in some cases.
Logical flaw in `BKE_scene_objects_iterator_begin()` code (two errors actually, wrong handling of first object of Master collection, and missing call to `object_base_unique()` to 'register' that first object and avoid getting it returned a second time). Simply fixed by always calling `BKE_scene_objects_iterator_next()` after minimal proper init, that one knows how to do the things. ;)
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r--source/blender/blenkernel/intern/collection.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 47fb3622c66..7b7898392d4 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1137,16 +1137,13 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
BKE_scene_collections_iterator_begin(&data->scene_collection_iter, scene);
Collection *collection = data->scene_collection_iter.current;
- if (collection->gobject.first != NULL) {
- iter->current = ((CollectionObject *)collection->gobject.first)->ob;
- }
- else {
- BKE_scene_objects_iterator_next(iter);
- }
+ data->cob_next = collection->gobject.first;
+
+ BKE_scene_objects_iterator_next(iter);
}
/**
- * Gets the first unique object in the sequence
+ * Ensures we only get each object once, even when included in several collections.
*/
static CollectionObject *object_base_unique(GSet *gs, CollectionObject *cob)
{