From 5bf11286423bc1278d00a237415cc2b572d082ab Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 12 Oct 2018 22:16:05 +0300 Subject: [PATCH] Dope Sheet: fix hold highlighting for non-bezier interpolation. The automatic highlighting of constant curve areas was checking that the bezier handles are horizontal even if a non-bezier interpolation mode was active. Conversely, it was highlighting based on just handles with Elastic interpolation, which always generates movement. --- source/blender/editors/animation/keyframes_draw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 8c3ecef5ae8..1941e98b865 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -332,8 +332,15 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, BezTriple *first_bezt */ if (IS_EQF(beztn->vec[1][1], prev->vec[1][1]) == 0) return; - if (IS_EQF(beztn->vec[1][1], beztn->vec[0][1]) == 0) return; - if (IS_EQF(prev->vec[1][1], prev->vec[2][1]) == 0) return; + /* Only check handles in case of actual bezier interpolation. */ + if (prev->ipo == BEZT_IPO_BEZ) { + if (IS_EQF(beztn->vec[1][1], beztn->vec[0][1]) == 0) return; + if (IS_EQF(prev->vec[1][1], prev->vec[2][1]) == 0) return; + } + /* This interpolation type induces movement even between identical keys. */ + else if (ELEM(prev->ipo, BEZT_IPO_ELASTIC)) { + return; + } } /* if there are no blocks already, just add as root */