[Bf-blender-cvs] [1d3da5aa84b] temp-graph-select-changes: Apply handle type change to both handles if only key is selected

Julian Eisel noreply at git.blender.org
Mon Nov 4 12:46:11 CET 2019


Commit: 1d3da5aa84bc0bb1500fc90eff8e0d64682f24d0
Author: Julian Eisel
Date:   Mon Nov 4 12:44:22 2019 +0100
Branches: temp-graph-select-changes
https://developer.blender.org/rB1d3da5aa84bc0bb1500fc90eff8e0d64682f24d0

Apply handle type change to both handles if only key is selected

That way one does not have to select the handles first, to apply the
handle change correctly. By default we only select the key now, not the
handles, so this was annoying.

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

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

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

diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index f8328e9f07f..2a1a76a19f7 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -1064,6 +1064,11 @@ static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
 
     ENSURE_HANDLES_MATCH(bezt);
   }
+  /* If no handle is selected, but the key is, apply to both handles. */
+  else if (bezt->f2 & SELECT) {
+    bezt->h1 = bezt->h2 = HD_AUTO;
+  }
+
   return 0;
 }
 
@@ -1082,6 +1087,11 @@ static short set_bezier_auto_clamped(KeyframeEditData *UNUSED(ked), BezTriple *b
 
     ENSURE_HANDLES_MATCH(bezt);
   }
+  /* If no handle is selected, but the key is, apply to both handles. */
+  else if (bezt->f2 & SELECT) {
+    bezt->h1 = bezt->h2 = HD_AUTO_ANIM;
+  }
+
   return 0;
 }
 
@@ -1094,6 +1104,11 @@ static short set_bezier_vector(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
   if (bezt->f3 & SELECT) {
     bezt->h2 = HD_VECT;
   }
+  /* If no handle is selected, but the key is, apply to both handles. */
+  if ((((bezt->f1 | bezt->f3) & SELECT) == 0) && (bezt->f2 & SELECT)) {
+    bezt->h1 = bezt->h2 = HD_VECT;
+  }
+
   return 0;
 }
 
@@ -1120,6 +1135,11 @@ static short set_bezier_align(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
   if (bezt->f3 & SELECT) {
     bezt->h2 = HD_ALIGN;
   }
+  /* If no handle is selected, but the key is, apply to both handles. */
+  if ((((bezt->f1 | bezt->f3) & SELECT) == 0) && (bezt->f2 & SELECT)) {
+    bezt->h1 = bezt->h2 = HD_ALIGN;
+  }
+
   return 0;
 }
 
@@ -1132,6 +1152,11 @@ static short set_bezier_free(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
   if (bezt->f3 & SELECT) {
     bezt->h2 = HD_FREE;
   }
+  /* If no handle is selected, but the key is, apply to both handles. */
+  if ((((bezt->f1 | bezt->f3) & SELECT) == 0) && (bezt->f2 & SELECT)) {
+    bezt->h1 = bezt->h2 = HD_FREE;
+  }
+
   return 0;
 }



More information about the Bf-blender-cvs mailing list