diff options
author | Kevin C. Burke <blastframe> | 2022-04-28 12:15:24 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-04-28 12:15:50 +0300 |
commit | eed8c2e65554c4df15c6cc4c2177fda269002494 (patch) | |
tree | dcd2fd1ec9e6e1bbd36cf88733b7107a492d9f1d /source/blender/editors/animation/keyframes_edit.c | |
parent | 198a7639441536681a257debd905917e02d52b7f (diff) |
Fix T96476: Equalize Handles not working on all keyframes
As the default handle type in Blender is 'Auto Clamped' the Equalize
Handles operator will often appear to have no affect on the selected
keyframes on which it is run. If either of the keyframes' handle types
are 'Auto', 'Auto Clamped', or 'Vector', this patch will convert the
handles to 'Aligned'.
Reviewed By: sybren
Maniphest Tasks: T96476
Differential Revision: https://developer.blender.org/D14345
Diffstat (limited to 'source/blender/editors/animation/keyframes_edit.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index ed40845a47c..f8277cf6a85 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -1303,6 +1303,12 @@ void ANIM_fcurve_equalize_keyframes_loop(FCurve *fcu, /* Perform handle equalization if mode is 'Both' or 'Left'. */ if (mode & EQUALIZE_HANDLES_LEFT) { + /*If left handle type is 'Auto', 'Auto Clamped', or 'Vector', convert handles to 'Aligned'.*/ + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) { + bezt->h1 = HD_ALIGN; + bezt->h2 = HD_ALIGN; + } + if (flatten) { handle_flatten(bezt->vec, 0, flat_direction_left); } @@ -1313,6 +1319,13 @@ void ANIM_fcurve_equalize_keyframes_loop(FCurve *fcu, /* Perform handle equalization if mode is 'Both' or 'Right'. */ if (mode & EQUALIZE_HANDLES_RIGHT) { + /*If right handle type is 'Auto', 'Auto Clamped', or 'Vector', convert handles to + * 'Aligned'.*/ + if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) { + bezt->h1 = HD_ALIGN; + bezt->h2 = HD_ALIGN; + } + if (flatten) { handle_flatten(bezt->vec, 2, flat_direction_right); } |