From 358f8b484fa0b786d905aac54c19603aca0d0f07 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 1 Apr 2020 11:50:42 +0200 Subject: [PATCH] Writefile: Cleanup Collection runtime data. --- source/blender/blenloader/intern/writefile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index e5209281d2b..4a2f6875c83 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2467,6 +2467,12 @@ static void write_collection_nolib(WriteData *wd, Collection *collection) static void write_collection(WriteData *wd, Collection *collection, const void *id_address) { if (collection->id.us > 0 || wd->use_memfile) { + /* Clean up, important in undo case to reduce false detection of changed datablocks. */ + collection->flag &= ~COLLECTION_HAS_OBJECT_CACHE; + collection->tag = 0; + BLI_listbase_clear(&collection->object_cache); + BLI_listbase_clear(&collection->parents); + /* write LibData */ writestruct_at_address(wd, ID_GR, Collection, 1, id_address, collection); write_iddata(wd, &collection->id);