From 900928f8bf47b8f1bbb1b2cd863d2d9649c940a0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 4 Aug 2011 14:13:05 +0000 Subject: Bassam Feature Request: "Auto Clamped" handles can now be set per handle/key This used to be a weird per-curve setting which would happen to get applied/work correctly if handles were set to "auto", and was a source of constant confusion for both old and new animators. The main effect of this handle-type/option was really to just ensure that auto-handles stayed horizontal, instead of tilting as the keys were moved. This commit simply changes this from a per-curve to per keyframe/handle setting. --- source/blender/blenkernel/intern/fcurve.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source/blender/blenkernel/intern/fcurve.c') diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index aa8f817ae3c..28f17b3cf86 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -792,13 +792,10 @@ void calchandles_fcurve (FCurve *fcu) if (bezt->vec[2][0] < bezt->vec[1][0]) bezt->vec[2][0]= bezt->vec[1][0]; /* calculate auto-handles */ - if (fcu->flag & FCURVE_AUTO_HANDLES) - calchandleNurb(bezt, prev, next, 2); /* 2==special autohandle && keep extrema horizontal */ - else - calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ + calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ /* for automatic ease in and out */ - if ((bezt->h1==HD_AUTO) && (bezt->h2==HD_AUTO)) { + if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) && ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* only do this on first or last beztriple */ if ((a == 0) || (a == fcu->totvert-1)) { /* set both handles to have same horizontal value as keyframe */ @@ -846,9 +843,9 @@ void testhandles_fcurve (FCurve *fcu) /* one or two handles selected only */ if (ELEM(flag, 0, 7)==0) { /* auto handles become aligned */ - if (bezt->h1==HD_AUTO) + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) bezt->h1= HD_ALIGN; - if (bezt->h2==HD_AUTO) + if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) bezt->h2= HD_ALIGN; /* vector handles become 'free' when only one half selected */ -- cgit v1.2.3