From d9c9108a6e62894d6ab696235af9a0af25693c76 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 1 Mar 2009 11:27:31 +0000 Subject: Graph Editor: Added operator to 'bake' keyframe-based F-Curves to be composed of samples. This operator can be activated using the 'Alt-C' hotkey for now, and operates on selected + editable F-Curves. This is currently still highly experimental, and does crash I've implemented this as a way to test out the FPoints/samples code, which will be used to provide better support of the dense F-Curves which result from importing Mocap/BVH data. These should use considerably less memory + have a few additional benefits over keyframes when they're working in a stable fashion. --- source/blender/blenkernel/BKE_fcurve.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/blender/blenkernel/BKE_fcurve.h') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index dd5e0dd6e21..a8b1ad49648 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -108,5 +108,26 @@ float evaluate_fcurve(struct FCurve *fcu, float evaltime); /* evaluate fcurve and store value */ void calculate_fcurve(struct FCurve *fcu, float ctime); +/* ************* F-Curve Samples API ******************** */ + +/* -------- Defines -------- */ + +/* Basic signature for F-Curve sample-creation function + * - fcu: the F-Curve being operated on + * - data: pointer to some specific data that may be used by one of the callbacks + */ +typedef float (*FcuSampleFunc)(struct FCurve *fcu, void *data, float evaltime); + +/* ----- Sampling Callbacks ------ */ + +/* Basic sampling callback which acts as a wrapper for evaluate_fcurve() */ +float fcurve_samplingcb_evalcurve(struct FCurve *fcu, void *data, float evaltime); + +/* -------- Main Methods -------- */ + +/* Main API function for creating a set of sampled curve data, given some callback function + * used to retrieve the values to store. + */ +void fcurve_store_samples(struct FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb); #endif /* BKE_FCURVE_H*/ -- cgit v1.2.3