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>2010-01-08 01:54:05 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-08 01:54:05 +0300
commitf3a6474537155e60f5db2a101b5ba11e20860307 (patch)
treee86f41c6d1e353fa9c08a32d8d1cf0deba7561ad /source/blender/blenkernel/intern/fcurve.c
parent79bb5419cc4f7bd372e3c611f8b4e2741bb7dc51 (diff)
Animation Visualisation Cleanups - Part 2:
* Finished baking code for motion paths, generalising it so that it works for both Objects and Bones. It is based on the old code for baking bones, although I have modified the updating code to use a more 'correct' method of updating dependencies. However, this may turn out to be too slow, and another API method should be added for that... * Moved some of the old version-patching code for animviz settings out of the drawing functions, instead doing this on the version patching proper. * Added RNA support for the new AnimViz types, and included RNA access via their users too. The old settings have still been left in for now, since there are still some things not ready to use yet. ---- * F-Curve's with sample points (i.e. sounds to F-Curves) now perform linear interpolation between sample points instead of using constant interpolation.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index e86cfce6fd9..3ce77c8cb4f 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1734,9 +1734,16 @@ static float fcurve_eval_samples (FCurve *fcu, FPoint *fpts, float evaltime)
cvalue= lastfpt->vec[1];
}
else {
+ float t= (float)abs(evaltime - (int)evaltime);
+
/* find the one on the right frame (assume that these are spaced on 1-frame intervals) */
fpt= prevfpt + (int)(evaltime - prevfpt->vec[0]);
- cvalue= fpt->vec[1];
+
+ /* 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);
+ else
+ cvalue= fpt->vec[1];
}
/* return value */