From c98240139e8ebfb5abdcc3734cbd5248cf313644 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 6 May 2020 12:21:53 +0200 Subject: 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. --- source/blender/editors/gpencil/gpencil_interpolate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index b6e84205815..5cb49600d05 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -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; } -- cgit v1.2.3