Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-04-27 17:42:51 +0400
committerJoshua Leung <aligorith@gmail.com>2014-04-28 18:23:53 +0400
commit6feec25bddfb96f979c89611840f1f558b7cd92c (patch)
treea7183cc78aa05a0b2d820dd6193d55cb9cf9742c /source/blender/editors/animation/keyframes_edit.c
parenta3a3141f53e5341cc4c669297ed1d894ad1d89e1 (diff)
"Auto" option for Keyframe.easing
This option (alongside the Ease In/Out/InOut options already available) aims to make it easier to get an initial curve that looks closer to the one you were expecting, by automatically picking whether Ease In or Ease Out should be used based on the type of interpolation being used for the curve segment in question. Notes: * The types chosen may need some adjustments (e.g. using ease in-out instead of just ease in) * This does break compatability with files saved in previous dev builds, but only if you were using Bounce/Elastic/Back with "Ease In"
Diffstat (limited to 'source/blender/editors/animation/keyframes_edit.c')
-rw-r--r--source/blender/editors/animation/keyframes_edit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 808ed758659..320aa0a2885 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -1103,6 +1103,13 @@ static short set_easingtype_easeinout(KeyframeEditData *UNUSED(ked), BezTriple *
return 0;
}
+static short set_easingtype_easeauto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
+{
+ if (bezt->f2 & SELECT)
+ bezt->easing = BEZT_IPO_EASE_AUTO;
+ return 0;
+}
+
/* Set the easing type of the selected BezTriples in each F-Curve to the specified one */
KeyframeEditFunc ANIM_editkeyframes_easing(short mode)
{
@@ -1114,8 +1121,10 @@ KeyframeEditFunc ANIM_editkeyframes_easing(short mode)
return set_easingtype_easeout;
case BEZT_IPO_EASE_IN_OUT: /* both */
- default:
return set_easingtype_easeinout;
+
+ default: /* auto */
+ return set_easingtype_easeauto;
}
}