diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:01:27 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:39:06 +0300 |
commit | ec351c7a653da2b5da6dd91b916deed70bff117e (patch) | |
tree | 3c48250f002f3262086600644ad2ffeb877f5d77 /source/blender/blenloader | |
parent | e0dc4130fda77dc4d99ffe25e36a53228a2d0325 (diff) |
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...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 8 |
1 files changed, 8 insertions, 0 deletions
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. */ |