Fix T76470: GPencil sequence interpolate crash when not enough frames in layer

If try to interpolate a layer without an active a next frame, the interpolation failed.

Now, check for both frames before start interpolation.
This commit is contained in:
Antonio Vazquez 2020-05-06 12:21:53 +02:00
parent c6aa014d3a
commit c98240139e
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by issue #76470, GPencil: Sequence interpolate crash when not enough frames
1 changed files with 5 additions and 1 deletions

View File

@ -970,12 +970,16 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
bGPDstroke *gps_from, *gps_to;
int cframe, fFrame;
/* Need a set of frames to interpolate. */
if ((gpl->actframe == NULL) || (gpl->actframe->next == NULL)) {
continue;
}
/* all layers or only active */
if (((flag & GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS) == 0) && (gpl != active_gpl)) {
continue;
}
/* only editable and visible layers are considered */
if (!BKE_gpencil_layer_is_editable(gpl) || (gpl->actframe == NULL)) {
if (!BKE_gpencil_layer_is_editable(gpl)) {
continue;
}