From 8d3e57f338234995c30ae702fff62ed6229f762e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 22 Dec 2021 16:57:07 +0100 Subject: Fix T93799: Outliner: Remaping objects could result in duplicates in a collection. Fix is similar to how CollectionObject with NULL object pointers are handled. Using one of the 'free' pad bytes in Object_Runtime struct instead of a gset (or other external way to detect object duplicates), as this is several times faster. NOTE: This makes remapping slightly slower again (adds 10 extra seconds to file case in T94059). General improvements of remapping time complexity, especially when remapping a lot of IDs at once, is a separate topic currently investigated in D13615. --- source/blender/makesdna/DNA_object_types.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index c9345b6a950..13a368e4263 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -126,7 +126,12 @@ typedef struct Object_Runtime { /** Did last modifier stack generation need mapping support? */ char last_need_mapping; - char _pad0[3]; + /** Opaque data reserved for management of objects in collection context. + * E.g. used currently to check for potential duplicates of objects in a collection, after + * remapping process. */ + char collection_management; + + char _pad0[2]; /** Only used for drawing the parent/child help-line. */ float parent_display_origin[3]; -- cgit v1.2.3