[Bf-blender-cvs] [ec351c7a653] master: Writefile: Cleanup Nodetree runtime data.

Bastien Montagne noreply at git.blender.org
Wed Apr 1 14:27:37 CEST 2020


Commit: ec351c7a653da2b5da6dd91b916deed70bff117e
Author: Bastien Montagne
Date:   Wed Apr 1 12:01:27 2020 +0200
Branches: master
https://developer.blender.org/rBec351c7a653da2b5da6dd91b916deed70bff117e

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

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

M	source/blender/blenloader/intern/writefile.c

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

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. */



More information about the Bf-blender-cvs mailing list