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:
authorStephen Swaney <sswaney@centurytel.net>2005-05-24 19:14:32 +0400
committerStephen Swaney <sswaney@centurytel.net>2005-05-24 19:14:32 +0400
commitbb84abaaa8fb14074f8be722346c6fd610d2f02e (patch)
tree524ff7cd2e43d08fed450ff95432d91764d45094 /source/blender/python
parent8242c5db2b25e8a2a6db9f615a21ee4512d85b9e (diff)
updates to doc strings in code and doc from Ken Hughes.
add alias .recalc() for IpoCurve.Recalc() to match api standard.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Ipo.c108
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c34
-rw-r--r--source/blender/python/api2_2x/doc/Curve.py22
-rw-r--r--source/blender/python/api2_2x/doc/Ipo.py30
4 files changed, 65 insertions, 129 deletions
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
index 3150ae43e75..cdaafe8ec06 100644
--- a/source/blender/python/api2_2x/Ipo.c
+++ b/source/blender/python/api2_2x/Ipo.c
@@ -452,7 +452,7 @@ static PyObject *Ipo_getNcurves( BPy_Ipo * self )
/*
- Lamp Name to Channel
+ Lamp ipo Name to Channel
*/
static int Ipo_laIcuName( char *s, int *param )
@@ -649,7 +649,7 @@ static int Ipo_acIcuName( char *s, int *param )
/*
- Camera name to channel
+ Camera ipo name to channel
*/
static int Ipo_caIcuName( char *s, int *param )
@@ -673,95 +673,29 @@ static int Ipo_caIcuName( char *s, int *param )
return not_ok;
}
+
+/*
+ texture ipo name to channel
+*/
+
static int Ipo_texIcuName( char *s, int *param )
{
- int ok = 0;
- if( !strcmp( s, "NSize" ) ) {
- *param = TE_NSIZE;
- return 1;
- }
- if( !strcmp( s, "NDepth" ) ) {
- *param = TE_NDEPTH;
- return 1;
- }
- if( !strcmp( s, "NType" ) ) {
- *param = TE_NTYPE;
- return 1;
- }
- if( !strcmp( s, "Turb" ) ) {
- *param = TE_TURB;
- return 1;
- }
- if( !strcmp( s, "Vnw1" ) ) {
- *param = TE_VNW1;
- return 1;
- }
- if( !strcmp( s, "Vnw2" ) ) {
- *param = TE_VNW2;
- return 1;
- }
- if( !strcmp( s, "Vnw3" ) ) {
- *param = TE_VNW3;
- return 1;
- }
- if( !strcmp( s, "Vnw4" ) ) {
- *param = TE_VNW4;
- return 1;
- }
- if( !strcmp( s, "MinkMExp" ) ) {
- *param = TE_VNMEXP;
- return 1;
- }
- if( !strcmp( s, "DistM" ) ) {
- *param = TE_VN_DISTM;
- return 1;
- }
- if( !strcmp( s, "ColT" ) ) {
- *param = TE_VN_COLT;
- return 1;
- }
- if( !strcmp( s, "iScale" ) ) {
- *param = TE_ISCA;
- return 1;
- }
- if( !strcmp( s, "DistA" ) ) {
- *param = TE_DISTA;
- return 1;
- }
- if( !strcmp( s, "MgType" ) ) {
- *param = TE_MG_TYP;
- return 1;
- }
- if( !strcmp( s, "MgH" ) ) {
- *param = TE_MGH;
- return 1;
- }
- if( !strcmp( s, "Lacu" ) ) {
- *param = TE_MG_LAC;
- return 1;
- }
- if( !strcmp( s, "Oct" ) ) {
- *param = TE_MG_OCT;
- return 1;
- }
- if( !strcmp( s, "MgOff" ) ) {
- *param = TE_MG_OFF;
- return 1;
- }
- if( !strcmp( s, "MgGain" ) ) {
- *param = TE_MG_GAIN;
- return 1;
- }
- if( !strcmp( s, "NBase1" ) ) {
- *param = TE_N_BAS1;
- return 1;
- }
- if( !strcmp( s, "NBase2" ) ) {
- *param = TE_N_BAS2;
- return 1;
+ /* this is another case where TE_TOTIPO == TE_TOTNAM.
+ te_ic_names[] has all our names so use that.
+ */
+ extern int te_ar[];
+ extern char *tex_ic_names[];
+ int not_ok = 0;
+ int i;
+
+ for( i = 0; i < TE_TOTIPO; i++){
+ if( !strcmp( s, tex_ic_names[i] ) ){
+ *param = te_ar[i];
+ return 1;
+ }
}
- return ok;
+ return not_ok;
}
static int Ipo_obIcuName( char *s, int *param )
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
index 4114f77efad..51adfba192f 100644
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ b/source/blender/python/api2_2x/Ipocurve.c
@@ -78,7 +78,6 @@ struct PyMethodDef M_IpoCurve_methods[] = {
/*****************************************************************************/
static PyObject *IpoCurve_getName( C_IpoCurve * self );
static PyObject *IpoCurve_Recalc( C_IpoCurve * self );
-static PyObject *IpoCurve_setName( C_IpoCurve * self, PyObject * args );
static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject * args );
static PyObject *IpoCurve_delBezier( C_IpoCurve * self, PyObject * args );
static PyObject *IpoCurve_setInterpolation( C_IpoCurve * self,
@@ -97,31 +96,27 @@ static PyObject *IpoCurve_evaluate( C_IpoCurve * self, PyObject * args );
static PyMethodDef C_IpoCurve_methods[] = {
/* name, method, flags, doc */
{"getName", ( PyCFunction ) IpoCurve_getName, METH_NOARGS,
- "() - Return IpoCurve Data name"},
+ "() - Return IpoCurve name"},
{"Recalc", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
- "() - Return IpoCurve Data name"},
+ "() - deprecated method. use recalc() instead"},
+ {"recalc", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
+ "() - Recomputes the curve after changes"},
{"update", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
- "() - Return IpoCurve Data name"},
- {"setName", ( PyCFunction ) IpoCurve_setName, METH_VARARGS,
- "(str) - Change IpoCurve Data name"},
+ "() - obsolete: use recalc method instead."},
{"addBezier", ( PyCFunction ) IpoCurve_addBezier, METH_VARARGS,
- "(str) - Change IpoCurve Data name"},
+ "(coordlist) - Adds a Bezier point to a curve"},
{"delBezier", ( PyCFunction ) IpoCurve_delBezier, METH_VARARGS,
- "(int) - delete Bezier point at index"},
+ "(int) - delete Bezier point at specified index"},
{"setInterpolation", ( PyCFunction ) IpoCurve_setInterpolation,
- METH_VARARGS,
- "(str) - Change IpoCurve Data name"},
+ METH_VARARGS, "(str) - Sets the interpolation type of the curve"},
{"getInterpolation", ( PyCFunction ) IpoCurve_getInterpolation,
- METH_NOARGS,
- "(str) - Change IpoCurve Data name"},
+ METH_NOARGS, "() - Gets the interpolation type of the curve"},
{"setExtrapolation", ( PyCFunction ) IpoCurve_setExtrapolation,
- METH_VARARGS,
- "(str) - Change IpoCurve Data name"},
+ METH_VARARGS, "(str) - Sets the extend mode of the curve"},
{"getExtrapolation", ( PyCFunction ) IpoCurve_getExtrapolation,
- METH_NOARGS,
- "(str) - Change IpoCurve Data name"},
+ METH_NOARGS, "() - Gets the extend mode of the curve"},
{"getPoints", ( PyCFunction ) IpoCurve_getPoints, METH_NOARGS,
- "(str) - Change IpoCurve Data name"},
+ "() - Returns list of all bezTriples of the curve"},
{"evaluate", ( PyCFunction ) IpoCurve_evaluate, METH_VARARGS,
"(float) - Evaluate curve at given time"},
{NULL, NULL, 0, NULL}
@@ -396,11 +391,6 @@ static PyObject *IpoCurve_delBezier( C_IpoCurve * self, PyObject * args )
return Py_None;
}
-static PyObject *IpoCurve_setName( C_IpoCurve * self, PyObject * args )
-{
- return 0;
-}
-
static PyObject *IpoCurve_Recalc( C_IpoCurve * self )
{
diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py
index 265768893a8..a123ad1416b 100644
--- a/source/blender/python/api2_2x/doc/Curve.py
+++ b/source/blender/python/api2_2x/doc/Curve.py
@@ -265,8 +265,8 @@ class Curve:
def appendNurb( new_point ):
"""
add a new curve to this Curve. The new point is added to the new curve. Blender does not support a curve with zero points. The new curve is added to the end of the list of curves in the Curve.
- @rtype: PyNone
- @return: PyNone
+ @rtype: CurNurb
+ @return: the newly added spline
@type new_point: BezTriple or list of xyzw coordinates for a Nurb curve.
@param new_point: see L{CurNurb.append} for description of parameter.
"""
@@ -347,7 +347,7 @@ class Curve:
@return: PyNone
"""
- def isNurb( curve_num):
+ def isNurb( curve_num ):
"""
method used to determine whether a CurNurb is of type Bezier or of type Nurb.
@rtype: integer
@@ -368,6 +368,20 @@ class Curve:
@raise AttributeError: throws exception if curve_num is out of range.
"""
+ def getNumCurves():
+ """
+ Get the number of curves in this Curve Data object.
+ @rtype: integer
+ """
+
+ def getNumPoints( curve_num ):
+ """
+ Get the number of control points in the curve.
+ @type curve_num: integer
+ @param curve_num: zero-based index into list of curves in this Curve
+ @rtype: integer
+ """
+
class CurNurb:
"""
The CurNurb Object
@@ -453,5 +467,3 @@ class CurNurb:
@rtype: PyNone
@return: PyNone
"""
-
-
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
index b0b269db6cd..bda2f12a623 100644
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ b/source/blender/python/api2_2x/doc/Ipo.py
@@ -3,10 +3,10 @@
"""
The Blender.Ipo submodule
-B{New}: Ipo updates to both the program and bpython acess.
+B{New}: Ipo updates to both the program and bpython access.
This module provides access to the Ipo Data in Blender. An Ipo is composed of
-several Ipocurves.
+several IpoCurves.
A datatype is defined : IpoCurve type. The member functions of this data type
are given below.
@@ -258,17 +258,17 @@ class IpoCurve:
This object gives access to generic data from all ipocurves objects in Blender.
Important Notes for Rotation Curves:\n
- For the rotation IpoCurves, the y values for points are in units of 10 degrees. 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.
+ 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.
@cvar name: The Curve Data name.
@cvar bezierPoints : The list of the Bezier points.
"""
- def setExtrapolation(extrapolationtype):
+ def setExtrapolation(extendmode):
"""
- Sets the extrapolation type of the curve.
- @type extrapolationtype: string
- @param extrapolationtype: the extrapolatrion type of the curve.
+ Sets the extend mode of the curve.
+ @type extendmode: string
+ @param extendmode: the extend mode of the curve.
Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
@rtype: None
@return: None
@@ -276,25 +276,25 @@ class IpoCurve:
def getExtrapolation():
"""
- Gets the extrapolation type of the curve.
+ Gets the extend mode of the curve.
@rtype: string
- @return: the extrapolation type of the curve.Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
+ @return: the extend mode of the curve. Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
"""
def setInterpolation(interpolationtype):
"""
- Sets the interpolation type of the curve.
+ Sets the interpolation type of the curve.
@type interpolationtype: string
- @param interpolationtype: the interpolatrion type of the curve. Can be Constant, Bezier, or Linear.
+ @param interpolationtype: the interpolation type of the curve. Can be Constant, Bezier, or Linear.
@rtype: None
@return: None
"""
def getInterpolation():
"""
- Gets the interpolation type of the curve.
+ Gets the interpolation type of the curve.
@rtype: string
- @return: the interpolation type of the curve.Can be Constant, Bezier, or Linear.
+ @return: the interpolation type of the curve. Can be Constant, Bezier, or Linear.
"""
def addBezier(coordlist):
@@ -315,9 +315,9 @@ class IpoCurve:
@return: None
"""
- def Recalc():
+ def recalc():
"""
- Recomputes the curent value of the curve.
+ Recomputes the curve after changes to control points.
@rtype: None
@return: None
"""