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
path: root/source
diff options
context:
space:
mode:
authorStephen Swaney <sswaney@centurytel.net>2004-06-06 23:42:12 +0400
committerStephen Swaney <sswaney@centurytel.net>2004-06-06 23:42:12 +0400
commitd97e3e55273c6c381eead86f807514ef1d4a3941 (patch)
tree2b68830125342643b8ff308da51c0b11bd04d4fe /source
parent37ac6859516026d5f986360812bf79347bc85181 (diff)
patch for bug #1347. IpoCurve.evaluate() missing/disappeared.
Contributed by Philip Wainwright.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
index f3e8c3873e2..2fb99f08cfd 100644
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ b/source/blender/python/api2_2x/Ipocurve.c
@@ -83,6 +83,8 @@ static PyObject *IpoCurve_setExtrapolation (C_IpoCurve * self,
PyObject * args);
static PyObject *IpoCurve_getExtrapolation (C_IpoCurve * self);
static PyObject *IpoCurve_getPoints (C_IpoCurve * self);
+static int IpoCurve_setPoints (C_IpoCurve * self, PyObject * value);
+static PyObject *IpoCurve_evaluate (C_IpoCurve * self, PyObject * args);
/*****************************************************************************/
/* Python C_IpoCurve methods table: */
@@ -109,6 +111,8 @@ static PyMethodDef C_IpoCurve_methods[] = {
"(str) - Change IpoCurve Data name"},
{"getPoints", (PyCFunction) IpoCurve_getPoints, METH_NOARGS,
"(str) - Change IpoCurve Data name"},
+ {"evaluate", (PyCFunction) IpoCurve_evaluate, METH_VARARGS,
+ "(float) - Evaluate curve at given time"},
{NULL, NULL, 0, NULL}
};
@@ -155,8 +159,6 @@ PyTypeObject IpoCurve_Type = {
static PyObject *
M_IpoCurve_New (PyObject * self, PyObject * args)
{
-
-
return 0;
}
@@ -526,3 +528,26 @@ IpoCurve_FromPyObject (PyObject * pyobj)
{
return ((C_IpoCurve *) pyobj)->ipocurve;
}
+
+/***************************************************************************/
+/* Function: IpoCurve_evaluate( time ) */
+/* Description: Evaluates IPO curve at the given time. */
+/***************************************************************************/
+
+static PyObject *
+IpoCurve_evaluate (C_IpoCurve * self, PyObject * args)
+{
+
+ float time = 0;
+ double eval = 0;
+
+ /* expecting float */
+ if (!PyArg_ParseTuple (args, "f", &time))
+ return (EXPP_ReturnPyObjError
+ (PyExc_TypeError, "expected float argument"));
+
+ eval= (double)eval_icu(self->ipocurve, time);
+
+ return PyFloat_FromDouble(eval);
+
+}