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-06-19 20:39:21 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-06-19 20:39:30 +0300
commitce7a5a23767c2f628a69496590b415318f7eb89f (patch)
tree5de4b7fe37037e5c57135267ce3ab48fb878dbe3
parenta24cd69d783727966bd2882ee4791375f4b821df (diff)
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.
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c14
1 files changed, 9 insertions, 5 deletions
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 */