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 | |
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
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 4 |
2 files changed, 15 insertions, 2 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); } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 2083a26f638..cfc4fcf8dad 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -2404,8 +2404,8 @@ void GRAPH_OT_equalize_handles(wmOperatorType *ot) ot->name = "Equalize Handles"; ot->idname = "GRAPH_OT_equalize_handles"; ot->description = - "Ensure selected keyframes' handles have equal length, optionally making them horizontal"; - + "Ensure selected keyframes' handles have equal length, optionally making them horizontal. " + "Automatic, Automatic Clamped, or Vector handle types will be converted to Aligned"; /* API callbacks */ ot->invoke = WM_menu_invoke; ot->exec = graphkeys_equalize_handles_exec; |