[Bf-blender-cvs] [2dcd02fcc20] greasepencil-object: Enable undo copy fallback if cache is empty

Falk David noreply at git.blender.org
Mon Feb 7 18:35:14 CET 2022


Commit: 2dcd02fcc208f39603ac957aa8cfcb2183876a6c
Author: Falk David
Date:   Thu Feb 3 19:08:03 2022 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2dcd02fcc208f39603ac957aa8cfcb2183876a6c

Enable undo copy fallback if cache is empty

We cannot have "gaps" in our undo chain, things will quickly fall apart.

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

M	source/blender/editors/gpencil/gpencil_undo.c

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

diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index e7d2614081a..9ec863ce45e 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -421,6 +421,10 @@ static bool gpencil_undosys_step_encode(struct bContext *C,
 
   bool only_frame_changed = false;
 
+  /* TODO: We might need to check if ID_RECALC_ALL is set on the gpd here to test if we need to
+   * clear the cache. It might be bad to "start" with some cache and add new update nodes on top.
+   */
+
   /* In case the step we are about to encode would be the first in the gpencil undo system, ensure
    * that we do a full-copy. */
   if (undo_stack->step_active == NULL ||
@@ -448,7 +452,7 @@ static bool gpencil_undosys_step_encode(struct bContext *C,
 
   /* TODO: Handle this case properly once the update cache is more widly used. We avoid full-copies
    * for now at the expense of to being able to undo them. */
-#if 1
+#if 0
   if (!only_frame_changed && gpd->runtime.update_cache == NULL) {
     return false;
   }



More information about the Bf-blender-cvs mailing list