[Bf-blender-cvs] [7dd7849dddb] master: Memfile Undo: aslo tag embedded IDs for update.

Bastien Montagne noreply at git.blender.org
Wed Jun 23 17:04:11 CEST 2021


Commit: 7dd7849dddb6392969f8fc858d8b9b376fb72049
Author: Bastien Montagne
Date:   Wed Jun 23 16:58:15 2021 +0200
Branches: master
https://developer.blender.org/rB7dd7849dddb6392969f8fc858d8b9b376fb72049

Memfile Undo: aslo tag embedded IDs for update.

This is again in the fuzzy area of how embedded IDs are handled
respectively by partial undo code and depsgraph... Should not be
necessary currently, but better be safe and explicit, and also tag
those embeded IDs from re-used owner ID.

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

M	source/blender/editors/undo/memfile_undo.c

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

diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c
index 9189adaf4d1..7c6ce56eab0 100644
--- a/source/blender/editors/undo/memfile_undo.c
+++ b/source/blender/editors/undo/memfile_undo.c
@@ -224,9 +224,21 @@ static void memfile_undosys_step_decode(struct bContext *C,
 
       /* Tag depsgraph to update data-block for changes that happened between the
        * current and the target state, see direct_link_id_restore_recalc(). */
-      if (id->recalc) {
+      if (id->recalc != 0) {
         DEG_id_tag_update_ex(bmain, id, id->recalc);
       }
+
+      bNodeTree *nodetree = ntreeFromID(id);
+      if (nodetree != NULL && nodetree->id.recalc != 0) {
+        DEG_id_tag_update_ex(bmain, &nodetree->id, nodetree->id.recalc);
+      }
+      if (GS(id->name) == ID_SCE) {
+        Scene *scene = (Scene *)id;
+        if (scene->master_collection != NULL && scene->master_collection->id.recalc != 0) {
+          DEG_id_tag_update_ex(
+              bmain, &scene->master_collection->id, scene->master_collection->id.recalc);
+        }
+      }
     }
     FOREACH_MAIN_ID_END;



More information about the Bf-blender-cvs mailing list