From ec351c7a653da2b5da6dd91b916deed70bff117e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 1 Apr 2020 12:01:27 +0200 Subject: Writefile: Cleanup Nodetree runtime data. Note: As with collections, this does not affect embedded nodetrees from material etc. We prpbably need to tackle those as well at some point... --- source/blender/blenloader/intern/writefile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 3b7ce3bdc1b..fb6bd637a3b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -3272,6 +3272,14 @@ static void write_probe(WriteData *wd, LightProbe *prb, const void *id_address) static void write_nodetree(WriteData *wd, bNodeTree *ntree, const void *id_address) { if (ntree->id.us > 0 || wd->use_memfile) { + /* Clean up, important in undo case to reduce false detection of changed datablocks. */ + ntree->init = 0; /* to set callbacks and force setting types */ + ntree->is_updating = false; + ntree->typeinfo = NULL; + ntree->interface_type = NULL; + ntree->progress = NULL; + ntree->execdata = NULL; + writestruct_at_address(wd, ID_NT, bNodeTree, 1, id_address, ntree); /* Note that trees directly used by other IDs (materials etc.) are not 'real' ID, they cannot * be linked, etc., so we write actual id data here only, for 'real' ID trees. */ -- cgit v1.2.3