[Bf-blender-cvs] [eed8c2e6555] master: Fix T96476: Equalize Handles not working on all keyframes

Kevin C. Burke noreply at git.blender.org
Thu Apr 28 11:16:03 CEST 2022


Commit: eed8c2e65554c4df15c6cc4c2177fda269002494
Author: Kevin C. Burke
Date:   Thu Apr 28 11:15:24 2022 +0200
Branches: master
https://developer.blender.org/rBeed8c2e65554c4df15c6cc4c2177fda269002494

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

===================================================================

M	source/blender/editors/animation/keyframes_edit.c
M	source/blender/editors/space_graph/graph_edit.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list