diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-03-12 21:43:13 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-03-12 21:43:13 +0300 |
commit | 9d08c169d1d540553f879afaecf7f06965a81469 (patch) | |
tree | 81ea30115834eb13b6a123200b2e7e1feb0b9def /source | |
parent | 5788f608d391f1324a638a36fdf20eee75fbfac7 (diff) |
GPencil: Interpolate can use all keyframe types except breakdown
Before only it was only possible interpolate frames of `Keyframe` type. Now all types except `Breakdown` can be used.
`Breakdown` cannot be used because it would be impossible interpolate two times because the extremes of the interpolation would change and the clean operator would not work.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_interpolate.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 3b7c80cee07..1281f1392d8 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -435,16 +435,16 @@ static void gpencil_interpolate_update_strokes(bContext *C, tGPDinterpolate *tgp WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL); } -/* Helper: Get previous keyframe. */ +/* Helper: Get previous keyframe (exclude breakdown type). */ static bGPDframe *gpencil_get_previous_keyframe(bGPDlayer *gpl, int cfra) { if (gpl->actframe != NULL && gpl->actframe->framenum < cfra && - gpl->actframe->key_type == BEZT_KEYTYPE_KEYFRAME) { + gpl->actframe->key_type != BEZT_KEYTYPE_BREAKDOWN) { return gpl->actframe; } LISTBASE_FOREACH_BACKWARD (bGPDframe *, gpf, &gpl->frames) { - if (gpf->key_type != BEZT_KEYTYPE_KEYFRAME) { + if (gpf->key_type == BEZT_KEYTYPE_BREAKDOWN) { continue; } if (gpf->framenum >= cfra) { @@ -456,11 +456,11 @@ static bGPDframe *gpencil_get_previous_keyframe(bGPDlayer *gpl, int cfra) return NULL; } -/* Helper: Get next keyframe. */ +/* Helper: Get next keyframe (exclude breakdown type). */ static bGPDframe *gpencil_get_next_keyframe(bGPDlayer *gpl, int cfra) { LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { - if (gpf->key_type != BEZT_KEYTYPE_KEYFRAME) { + if (gpf->key_type == BEZT_KEYTYPE_BREAKDOWN) { continue; } if (gpf->framenum <= cfra) { @@ -760,7 +760,7 @@ static int gpencil_interpolate_invoke(bContext *C, wmOperator *op, const wmEvent Scene *scene = CTX_data_scene(C); tGPDinterpolate *tgpi = NULL; - /* cannot interpolate if not between 2 frames */ + /* Cannot interpolate if not between 2 frames. */ int cfra = CFRA; bGPDframe *gpf_prv = gpencil_get_previous_keyframe(gpl, cfra); bGPDframe *gpf_next = gpencil_get_next_keyframe(gpl, cfra); @@ -768,7 +768,7 @@ static int gpencil_interpolate_invoke(bContext *C, wmOperator *op, const wmEvent BKE_report( op->reports, RPT_ERROR, - "Cannot find a pair of grease pencil frames to interpolate between in active layer"); + "Cannot find valid keyframes to interpolate (Breakdowns keyframes are not allowed)"); return OPERATOR_CANCELLED; } @@ -1260,7 +1260,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) BKE_report( op->reports, RPT_ERROR, - "Cannot find a pair of grease pencil frames to interpolate between in active layer"); + "Cannot find valid keyframes to interpolate (Breakdowns keyframes are not allowed)"); return OPERATOR_CANCELLED; } |