[Bf-blender-cvs] [b7855862327] blender2.8: Fix T57558: Outliner displaying same object twice in some cases.

Bastien Montagne noreply at git.blender.org
Wed Nov 14 17:07:12 CET 2018


Commit: b7855862327043b858c5787864ada6f2a2c86ea4
Author: Bastien Montagne
Date:   Wed Nov 14 16:40:37 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb7855862327043b858c5787864ada6f2a2c86ea4

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. ;)

===================================================================

M	source/blender/blenkernel/intern/collection.c

===================================================================

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)
 {



More information about the Bf-blender-cvs mailing list