Fix unchecked parameter in M_Ipo_Recalc, and some documentation fixes.

This commit is contained in:
Ken Hughes
2005-12-05 05:23:35 +00:00
parent 00ce7c629f
commit bf05bbef86
2 changed files with 40 additions and 47 deletions

View File

@@ -110,39 +110,37 @@ static PyMethodDef BPy_Ipo_methods[] = {
{"setName", ( PyCFunction ) Ipo_setName, METH_VARARGS,
"(str) - Change Ipo Data name"},
{"getBlocktype", ( PyCFunction ) Ipo_getBlocktype, METH_NOARGS,
"() - Return Ipo blocktype -"},
"() - Return Ipo blocktype"},
{"setBlocktype", ( PyCFunction ) Ipo_setBlocktype, METH_VARARGS,
"(str) - Change Ipo blocktype"},
{"getRctf", ( PyCFunction ) Ipo_getRctf, METH_NOARGS,
"() - Return Ipo rctf - "},
"() - Return Ipo rctf"},
{"setRctf", ( PyCFunction ) Ipo_setRctf, METH_VARARGS,
"(str) - Change Ipo rctf"},
"(flt,flt,flt,flt) - Change Ipo rctf"},
{"addCurve", ( PyCFunction ) Ipo_addCurve, METH_VARARGS,
"() - Return Ipo ncurves"},
"() - Add a curve to Ipo"},
{"delCurve", ( PyCFunction ) Ipo_delCurve, METH_VARARGS,
"() - Delete Ipo curves"},
"(str) - Delete curve from Ipo"},
{"getNcurves", ( PyCFunction ) Ipo_getNcurves, METH_NOARGS,
"() - Return Ipo ncurves"},
"() - Return number of Ipo curves"},
{"getNBezPoints", ( PyCFunction ) Ipo_getNBezPoints, METH_VARARGS,
"() - Return curve number of Bez points"},
"(int) - Return number of Bez points on an Ipo curve"},
{"delBezPoint", ( PyCFunction ) Ipo_DeleteBezPoints, METH_VARARGS,
"() - Return curve number of Bez points"},
"(int) - deprecated: use ipocurve.delBezier()"},
{"getCurveBP", ( PyCFunction ) Ipo_getCurveBP, METH_VARARGS,
"() - Return Ipo ncurves"},
"() - unsupported"},
{"EvaluateCurveOn", ( PyCFunction ) Ipo_EvaluateCurveOn, METH_VARARGS,
"() - Return curve value at given time"},
"(int,flt) - deprecated: see ipocurve.evaluate()"},
{"getCurveCurval", ( PyCFunction ) Ipo_getCurvecurval, METH_VARARGS,
"() - Return curval"},
{"getCurveBeztriple", ( PyCFunction ) Ipo_getCurveBeztriple,
METH_VARARGS,
"() - Return Ipo ncurves"},
{"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple,
METH_VARARGS,
"() - Return curval"},
"(int) - deprecated: see ipocurve.evaluate()"},
{"getCurveBeztriple", ( PyCFunction ) Ipo_getCurveBeztriple, METH_VARARGS,
"(int,int) - deprecated: see ipocurve.bezierPoints[]"},
{"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple, METH_VARARGS,
"(int,int,list) - set a BezTriple"},
{"getCurves", ( PyCFunction ) Ipo_getCurves, METH_NOARGS,
"() - Return curval"},
"() - Return list of all defined Ipo curves"},
{"getCurve", ( PyCFunction ) Ipo_getCurve, METH_VARARGS,
"() - Return curval"},
"(str|int) - Returns specified Ipo curve"},
{NULL, NULL, 0, NULL}
};
@@ -321,13 +319,14 @@ static PyObject *M_Ipo_Get( PyObject * self, PyObject * args )
static PyObject *M_Ipo_Recalc( PyObject * self, PyObject * args )
{
void testhandles_ipocurve( IpoCurve * icu );
PyObject *a;
PyObject *obj;
IpoCurve *icu;
if( !PyArg_ParseTuple( args, "O", &a ) )
return ( EXPP_ReturnPyObjError
( PyExc_TypeError, "expected ipo argument)" ) );
icu = IpoCurve_FromPyObject( a );
if( !PyArg_ParseTuple( args, "O!", &IpoCurve_Type, &obj ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected Ipo curve argument" );
icu = IpoCurve_FromPyObject( obj );
testhandles_ipocurve( icu );
Py_INCREF( Py_None );

View File

@@ -232,7 +232,8 @@ class Ipo:
def getCurveCurval(curvepos):
"""
Gets the current value of a curve of the Ipo.
Gets the current value of a curve of the Ipo (B{deprecated}). B{Note}:
new scripts should use L{IpoCurve.evaluate()}.
@type curvepos: int or string
@param curvepos: the position of the curve in the ipo or the name of the
curve
@@ -242,11 +243,12 @@ class Ipo:
def EvaluateCurveOn(curvepos,time):
"""
Gets the current value of a curve of the Ipo.
Gets the value at a specific time of a curve of the Ipo (B{deprecated}).
B{Note}: new scripts should use L{IpoCurve.evaluate()}.
@type curvepos: int
@param curvepos: the position of the curve in the ipo
@param curvepos: the position of the curve in the Ipo.
@type time: float
@param time: the position of the curve in the ipo
@param time: the desired time.
@rtype: float
@return: the current value of the selected curve of the Ipo at the given
time.
@@ -261,27 +263,19 @@ class IpoCurve:
Important Notes for Rotation Curves:\n
For the rotation IpoCurves, the y values for points are in units of 10 degrees. For example, 45.0 degrees is stored as 4.50 degrees. These are the same numbers you see in the Transform Properties pupmenu ( NKey ) in the IPO Curve Editor window. Positive rotations are in a counter-clockwise direction, just like in math class.
@ivar driver: Status of Driver
1: on
0: off
@type driver: int
@ivar driverObject: Object Used to Drive the IpoCurve
@type driverObject: Object
@ivar driverChannel: Object Channel Used to Drive the IpoCurve
Use module constants
IpoCurve.LOC_X
IpoCurve.LOC_Y
IpoCurve.LOC_Z
IpoCurve.ROT_X
IpoCurve.ROT_Y
IpoCurve.ROT_Z
IpoCurve.SIZE_X
IpoCurve.SIZE_Y
IpoCurve.SIZE_Z
@ivar driver: Status of Driver. 1= on, 0= off.
@type driver: int
@ivar driverObject: Object used to frive the IpoCurve.
@type driverObject: Object
@ivar driverChannel: Object Channel Used to Drive the IpoCurve.
Use module constants: IpoCurve.LOC_X, IpoCurve.LOC_Y, IpoCurve.LOC_Z,
IpoCurve.ROT_X, IpoCurve.ROT_Y, IpoCurve.ROT_Z, IpoCurve.SIZE_X,
IpoCurve.SIZE_Y, IpoCurve.SIZE_Z
@type driverChannel: int
@ivar name: The Curve Data name.
@type name: string
@ivar bezierPoints : The list of the Bezier points.
@type bezierPoints : list
"""
def setExtrapolation(extendmode):