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.
This commit is contained in:
Antonio Vazquez 2021-09-21 17:29:19 +02:00 committed by Jeroen Bakker
parent cc31c159a1
commit 934c724755
Notes: blender-bot 2024-03-22 15:57:27 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #91534, GPencil: Interpolate Sequence crash and quit.
1 changed files with 6 additions and 0 deletions

View File

@ -317,6 +317,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);
@ -1334,6 +1337,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) {