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:
authorCampbell Barton <ideasman42@gmail.com>2008-06-25 17:21:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-06-25 17:21:38 +0400
commit7ba2389932dd54468b0e8ded17bea9e272c92304 (patch)
tree3500e84d0f6bed61a63573bd6c4b215f0af46d76 /source/blender/python/api2_2x/CurNurb.c
parent820c2df12c9d1ba7479c0a924f90f79a33028db9 (diff)
added r/w access to nurb curves orderU for migius
Diffstat (limited to 'source/blender/python/api2_2x/CurNurb.c')
-rw-r--r--source/blender/python/api2_2x/CurNurb.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c
index 174b5fb08dc..b2120bd63c6 100644
--- a/source/blender/python/api2_2x/CurNurb.c
+++ b/source/blender/python/api2_2x/CurNurb.c
@@ -53,6 +53,8 @@ static int CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args );
static PyObject *CurNurb_getFlagV( BPy_CurNurb * self );
static PyObject *CurNurb_oldsetFlagV( BPy_CurNurb * self, PyObject * args );
static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args );
+static PyObject *CurNurb_getOrderU( BPy_CurNurb * self );
+static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args );
static PyObject *CurNurb_getType( BPy_CurNurb * self );
static PyObject *CurNurb_oldsetType( BPy_CurNurb * self, PyObject * args );
static int CurNurb_setType( BPy_CurNurb * self, PyObject * args );
@@ -176,6 +178,9 @@ static PyGetSetDef BPy_CurNurb_getseters[] = {
(getter)CurNurb_getFlagV, (setter)CurNurb_setFlagV,
"The knot type in the V direction",
NULL},
+ {"orderU",
+ (getter)CurNurb_getOrderU, (setter)CurNurb_setOrderU,
+ "order setting for U direction", NULL},
{"type",
(getter)CurNurb_getType, (setter)CurNurb_setType,
"The curve type (poly: bezier, or NURBS)",
@@ -710,6 +715,35 @@ static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args )
return 0;
}
+static PyObject *CurNurb_getOrderU( BPy_CurNurb * self )
+{
+ return PyInt_FromLong( ( long ) self->nurb->orderu );
+}
+
+static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args )
+{
+ int order;
+
+ args = PyNumber_Int( args );
+ if( !args )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected integer argument" );
+
+ order = ( int )PyInt_AS_LONG( args );
+ Py_DECREF( args );
+
+ if( order < 2 ) order = 2;
+ else if( order > 6 ) order = 6;
+
+ if( self->nurb->pntsu < order )
+ order = self->nurb->pntsu;
+
+ self->nurb->orderu = (short)order;
+ makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
+
+ return 0;
+}
+
/*
* CurNurb_getIter
*