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-05-06 13:21:53 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-06 13:21:53 +0300
commitc98240139e8ebfb5abdcc3734cbd5248cf313644 (patch)
tree34cde531e15ac3330376b71d1c4d91efe304800d /source/blender/editors/gpencil
parentc6aa014d3abb0a2240cb7293d58c86be16b02ab3 (diff)
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.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c6
1 files changed, 5 insertions, 1 deletions
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;
}