diff --git a/source/blender/python/api2_2x/BezTriple.c b/source/blender/python/api2_2x/BezTriple.c
index 94911cac1e7c806a8092c3d601ed27bd20563fe5..0533bb8c5847d529201b32dcbe0ed79c081e870c 100644
--- a/source/blender/python/api2_2x/BezTriple.c
+++ b/source/blender/python/api2_2x/BezTriple.c
@@ -85,8 +85,8 @@ static PyMethodDef C_BezTriple_methods[] = {
"(str) - Change BezTriple point coordinates"},
{"getPoints", (PyCFunction) BezTriple_getPoints, METH_NOARGS,
"() - return BezTriple knot point x and y coordinates"},
- {"getTriple", (PyCFunction) BezTriple_getTriple, METH_VARARGS,
- "() - return list of floating point triplets. order is H1, knot, H2"},
+ {"getTriple", (PyCFunction) BezTriple_getTriple, METH_NOARGS,
+ "() - return list of 3 floating point triplets. order is H1, knot, H2"},
{NULL, NULL, 0, NULL}
};
@@ -169,6 +169,15 @@ BezTriple_getPoints (C_BezTriple * self)
}
+/*
+ * BezTriple_getTriple
+ *
+ * get the coordinate data for a BezTriple.
+ * returns a list of 3 points.
+ * list order is handle1, knot, handle2.
+ * each point consists of a list of x,y,z float values.
+ */
+
static PyObject *
BezTriple_getTriple (C_BezTriple * self)
{
@@ -200,7 +209,7 @@ BezTriple_setPoints (C_BezTriple * self, PyObject * args)
if (!PyArg_ParseTuple (args, "O", &popo))
return (EXPP_ReturnPyObjError
(PyExc_TypeError, "expected tuple argument"));
- if (PyTuple_Check (popo) == 0)
+ if (PySequence_Check (popo) == 0)
{
puts ("error in BezTriple_setPoints");
Py_INCREF (Py_None);
@@ -208,7 +217,12 @@ BezTriple_setPoints (C_BezTriple * self, PyObject * args)
}
for (i = 0; i < 2; i++)
{
- bezt->vec[1][i] = PyFloat_AsDouble (PyTuple_GetItem (popo, i));
+ PyObject *o = PySequence_GetItem( popo, i );
+ if( !o )
+ printf("\n bad o. o no!\n");
+
+ /* bezt->vec[1][i] = PyFloat_AsDouble (PyTuple_GetItem (popo, i));*/
+ bezt->vec[1][i] = PyFloat_AsDouble ( o );
bezt->vec[0][i] = bezt->vec[1][i] - 1;
bezt->vec[2][i] = bezt->vec[1][i] + 1;
}
@@ -230,6 +244,10 @@ BezTripleGetAttr (C_BezTriple * self, char *name)
{
if (strcmp (name, "pt") == 0)
return BezTriple_getPoints (self);
+ else if (strcmp (name, "vec") == 0)
+ return BezTriple_getTriple (self);
+
+ /* look for default methods */
return Py_FindMethod (C_BezTriple_methods, (PyObject *) self, name);
}
diff --git a/source/blender/python/api2_2x/BezTriple.h b/source/blender/python/api2_2x/BezTriple.h
index 26d9fd185932241e3785bf5570736eac16b465ae..10bfff9b3320bfe0b7ccb4c19336d19eff92beb5 100644
--- a/source/blender/python/api2_2x/BezTriple.h
+++ b/source/blender/python/api2_2x/BezTriple.h
@@ -41,7 +41,7 @@
typedef struct
{
- PyObject_HEAD BezTriple * beztriple;
+ PyObject_HEAD BezTriple *beztriple;
}
C_BezTriple;
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
index 10b5a9b7bdba1fa2215502cd6557d9651ca0e2f6..4a40331660f204df52a9844d518e5698f5b42f6c 100644
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ b/source/blender/python/api2_2x/doc/Ipo.py
@@ -246,6 +246,15 @@ class IpoCurve:
@return: the points of the ipo curve.
"""
+ def evaluate( time ):
+ """
+ Compute the value of the IpoCurve at a particular time.
+ @type time: float
+ @param time: value along the X axis
+ @rtype: float
+ @return: the Y value of the curve at the given time
+ """
+
class BezTriple:
"""
@@ -271,3 +280,18 @@ class BezTriple:
@rtype: PyNone
@return: PyNone
"""
+
+ def getTriple():
+ """
+ Returns the x,y,z coordinates for each of the three points that make up a BezierTriple.
+
+ The return list looks like this [ [H1x, H1y, H1z], [Px, Py, Pz], [H2x, H2y, H2z] ] .
+
+ Example::
+ # where bt is of type BezierTriple
+ # and h1, p, and h2 are lists of 3 floats
+ h1, p, h2 = bt.getTriple()
+
+ @rtype: list consisting of 3 lists of 3 floats
+ @return: handle1, knot, handle2
+ """