Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-04-25 11:40:09 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-25 11:40:09 +0300
commit53106934f97d5a41a38a2f597c4165837b51b1c6 (patch)
tree09101cc1bddc7eab46221e05daa7515910cc40e1 /source/blender/editors/gpencil/gpencil_interpolate.c
parent4ab85a338055b1d53a5a4c4e0cfc04c6300efcc3 (diff)
Fix T76078: GPencil: frames interpolation erase strokes
In some situations the stroke could be tagged and this tag was used to delete the interpolated strokes. Now, the frames used as interpolated range are untagged before creating the interpolated strokes.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_interpolate.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index e6661e886b1..b6e84205815 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -134,6 +134,19 @@ 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);
+
+ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
+ if (gps->flag & GP_STROKE_TAG) {
+ gps->flag &= ~GP_STROKE_TAG;
+ }
+ }
+}
+
/* Helper: Update all strokes interpolated */
static void gp_interpolate_update_strokes(bContext *C, tGPDinterpolate *tgpi)
{
@@ -265,6 +278,10 @@ 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 */