diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-11-14 08:08:36 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-11-14 08:09:10 +0300 |
commit | 9ac08840ae7e9bd802329e9443da87d4e0dbe5a0 (patch) | |
tree | f789931d0ac166a0e62c5f413d6898cf5d76f001 /source/blender/blenkernel | |
parent | 4d33c37c9eb4fc46482f7b2a7227b54c5cfda07a (diff) |
Fix T46701: Sampled FCurve looks jagged when FModifiers (doing nothing) are present
This was caused by interpolation between samples being performed incorrectly
(i.e. wrong order of arguments) when sampling more than once per frame.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 02b95c89be4..abf847274c4 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2436,11 +2436,11 @@ static float fcurve_eval_samples(FCurve *fcu, FPoint *fpts, float evaltime) float t = fabsf(evaltime - floorf(evaltime)); /* find the one on the right frame (assume that these are spaced on 1-frame intervals) */ - fpt = prevfpt + (int)(evaltime - prevfpt->vec[0]); + fpt = prevfpt + ((int)evaltime - (int)prevfpt->vec[0]); /* if not exactly on the frame, perform linear interpolation with the next one */ - if (t != 0.0f) - cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], t); + if ((t != 0.0f) && (t < 1.0f)) + cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], 1.0f - t); else cvalue = fpt->vec[1]; } |