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
committerJeroen Bakker <j.bakker@atmind.nl>2020-07-13 18:13:16 +0300
commit2a78504d0c18ea3105e69be9a2ed92a21961993b (patch)
treeec870a7e37d7662c3f807c7b74468953f1d93a80
parent061869fe61fc5746a8df172a3f02752eff7019b3 (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 */