[Bf-blender-cvs] [ce7a5a23767] master: Fix T78042: GPencil: Strokes go missing after Interpolation from another layer

Antonio Vazquez noreply at git.blender.org
Fri Jun 19 19:39:35 CEST 2020


Commit: ce7a5a23767c2f628a69496590b415318f7eb89f
Author: Antonio Vazquez
Date:   Fri Jun 19 19:39:21 2020 +0200
Branches: master
https://developer.blender.org/rBce7a5a23767c2f628a69496590b415318f7eb89f

Fix T78042: GPencil: Strokes go missing after Interpolation from another layer

This was due some strokes could be tagged and as the layer was locked, the strokes were not untagged and removed when all tagged strokes are removed.

The tagged strokes are used as temp ghost of the interpolation and removed at the end of the interpolation.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 5cb49600d05..4ddcc60fb92 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -138,7 +138,9 @@ static void gp_interpolate_free_temp_strokes(bGPDframe *gpf)
 /* Helper: Untag all strokes. */
 static void gp_interpolate_untag_strokes(bGPDframe *gpf)
 {
-  BLI_assert(gpf != NULL);
+  if (gpf == NULL) {
+    return;
+  }
 
   LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
     if (gps->flag & GP_STROKE_TAG) {
@@ -262,6 +264,12 @@ static void gp_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
   LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
     tGPDinterpolate_layer *tgpil;
 
+    /* Untag strokes to be sure nothing is pending. This must be done for
+     * all layer because it could be anything tagged and it would be removed
+     * at the end of the process when all tagged strokes are removed. */
+    gp_interpolate_untag_strokes(gpl->actframe);
+    gp_interpolate_untag_strokes(gpl->actframe->next);
+
     /* all layers or only active */
     if (!(tgpi->flag & GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS) && (gpl != active_gpl)) {
       continue;
@@ -278,10 +286,6 @@ static void gp_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
     tgpil->prevFrame = gpl->actframe;
     tgpil->nextFrame = gpl->actframe->next;
 
-    /* Untag interpolated strokes to be sure nothing is pending. */
-    gp_interpolate_untag_strokes(tgpil->prevFrame);
-    gp_interpolate_untag_strokes(tgpil->nextFrame);
-
     BLI_addtail(&tgpi->ilayers, tgpil);
 
     /* create a new temporary frame */



More information about the Bf-blender-cvs mailing list