diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-17 14:09:06 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-17 14:10:52 +0300 |
commit | b02a25b7e10e5713052f5a6ccf4127ad4d995f25 (patch) | |
tree | 6cc49eb98bba6d624c0cbf2ee61bd3a755df41a1 /source/blender/blenloader | |
parent | 055863d9c1f0195765f421b1f87e445dd070ea00 (diff) |
Add accumulated recalc flags to IDs.
Those accumulated flags get cleared every time an undo step is written
to memfile.
Preliminary work for undo-speedup.
Part of T60695/D6580.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index a92404b2372..1e50cda3eaf 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -703,7 +703,7 @@ void IDP_WriteProperty(const IDProperty *prop, void *wd) IDP_WriteProperty_OnlyData(prop, wd); } -static void write_iddata(void *wd, const ID *id) +static void write_iddata(WriteData *wd, ID *id) { /* ID_WM's id->properties are considered runtime only, and never written in .blend file. */ if (id->properties && !ELEM(GS(id->name), ID_WM)) { @@ -731,6 +731,11 @@ static void write_iddata(void *wd, const ID *id) } } } + + /* Clear the accumulated recalc flags in case of undo step saving. */ + if (wd->use_memfile) { + id->recalc_undo_accumulated = 0; + } } static void write_previews(WriteData *wd, const PreviewImage *prv_orig) @@ -1131,6 +1136,11 @@ static void write_nodetree_nolib(WriteData *wd, bNodeTree *ntree) for (sock = ntree->outputs.first; sock; sock = sock->next) { write_node_socket_interface(wd, sock); } + + /* Clear the accumulated recalc flags in case of undo step saving. */ + if (wd->use_memfile) { + ntree->id.recalc_undo_accumulated = 0; + } } /** @@ -2425,6 +2435,11 @@ static void write_collection_nolib(WriteData *wd, Collection *collection) for (CollectionChild *child = collection->children.first; child; child = child->next) { writestruct(wd, DATA, CollectionChild, 1, child); } + + /* Clear the accumulated recalc flags in case of undo step saving. */ + if (wd->use_memfile) { + collection->id.recalc_undo_accumulated = 0; + } } static void write_collection(WriteData *wd, Collection *collection) |