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-04-01 12:50:42 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-04-01 13:39:06 +0300
commit358f8b484fa0b786d905aac54c19603aca0d0f07 (patch)
tree1876707668a05dffcc45d6ed81e0d307d6c07f57
parente24553ca0f0d20a0eb738a39e55318756154a603 (diff)
Writefile: Cleanup Collection runtime data.
-rw-r--r--source/blender/blenloader/intern/writefile.c6
1 files changed, 6 insertions, 0 deletions
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);