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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-18 22:43:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-18 22:43:13 +0300
commitf50962a6892e20e2525947d7bfcfd58a2265898e (patch)
treec371917bf9b29abf4ef994ea0b730430617260ec /source/blender/blenkernel/intern/fcurve.c
parent3085edf2af65c243e1a02f574ca404b86d056a6b (diff)
in rare cases fcurves with no handle length can result in 0.0. check if the point matches the frame.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index d93a9820886..552c7d0767d 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1714,9 +1714,13 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim
{
/* evaltime occurs somewhere in the middle of the curve */
for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++)
- {
+ {
+ /* use if the key is directly on the frame, rare cases this is needed else we get 0.0 instead. */
+ if(fabs(bezt->vec[1][0] - evaltime) < SMALL_NUMBER) {
+ cvalue= bezt->vec[1][1];
+ }
/* evaltime occurs within the interval defined by these two keyframes */
- if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime))
+ else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime))
{
/* value depends on interpolation mode */
if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES))