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>2021-09-21 18:29:19 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-09-21 18:29:27 +0300
commit49ab38bf54d4da95f0bb67a348c9305527d95983 (patch)
tree4b610bd25eff2b7ac15d3ca9f4e0441009898534
parent2e6a7353852f432f626269b3e7d9246701c690e2 (diff)
Fix T91534: GPencil interpolate Sequence fails if stroke has 0 points
In some cases the stroke has 0 points and this must be skipped in the interpolation.
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index fdd9f44605e..d7cab85abad 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -316,6 +316,9 @@ static void gpencil_stroke_pair_table(bContext *C,
if (ELEM(NULL, gps_from, gps_to)) {
continue;
}
+ if ((gps_from->totpoints == 0) || (gps_to->totpoints == 0)) {
+ continue;
+ }
/* Insert the pair entry in the hash table and the list of strokes to keep order. */
BLI_addtail(&tgpil->selected_strokes, BLI_genericNodeN(gps_from));
BLI_ghash_insert(tgpil->pair_strokes, gps_from, gps_to);
@@ -1333,6 +1336,9 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
if (ELEM(NULL, gps_from, gps_to)) {
continue;
}
+ if ((gps_from->totpoints == 0) || (gps_to->totpoints == 0)) {
+ continue;
+ }
/* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
if (gps_from->totpoints > gps_to->totpoints) {