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>2007-11-10 14:05:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-11-10 14:05:44 +0300
commitf02a746f56fb351ea92bbf82b8efbd3c1d6faa3e (patch)
treef0f8d557de4abab0cdf52eaa67df42355a94b429 /source/blender/python/api2_2x
parentf9e35056af9940026a670fad351a3f7e02448a04 (diff)
==Python API==
added .smooth setting to CurNurb's so you can do.... for curNurb in Curve.Get('foo'): curNurb.smooth = True
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r--source/blender/python/api2_2x/CurNurb.c24
-rw-r--r--source/blender/python/api2_2x/doc/Curve.py2
2 files changed, 24 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c
index 642e7b7b5e6..e98b0da8f3d 100644
--- a/source/blender/python/api2_2x/CurNurb.c
+++ b/source/blender/python/api2_2x/CurNurb.c
@@ -37,6 +37,9 @@
#include "gen_utils.h"
#include "BezTriple.h"
+/* Only for ME_SMOOTH */
+#include "DNA_meshdata_types.h"
+
/*
* forward declarations go here
*/
@@ -69,7 +72,8 @@ static PyObject *CurNurb_isCyclic( BPy_CurNurb * self );
static PyObject *CurNurb_dump( BPy_CurNurb * self );
static PyObject *CurNurb_switchDirection( BPy_CurNurb * self );
static PyObject *CurNurb_recalc( BPy_CurNurb * self );
-
+static PyObject *CurNurb_getFlagBits( BPy_CurNurb * self, void *type );
+static int CurNurb_setFlagBits( BPy_CurNurb * self, PyObject *value, void *type );
char M_CurNurb_doc[] = "CurNurb";
@@ -185,7 +189,10 @@ static PyGetSetDef BPy_CurNurb_getseters[] = {
(getter)CurNurb_getKnotsV, (setter)NULL,
"The The knot vector in the V direction",
NULL},
-
+ {"smooth",
+ (getter)CurNurb_getFlagBits, (setter)CurNurb_setFlagBits,
+ "The smooth bool setting",
+ (void *)ME_SMOOTH},
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
};
@@ -423,6 +430,19 @@ static PyObject *CurNurb_getPoints( BPy_CurNurb * self )
return PyInt_FromLong( ( long ) self->nurb->pntsu );
}
+static PyObject *CurNurb_getFlagBits( BPy_CurNurb * self, void *type )
+{
+ return EXPP_getBitfield( (void *)&self->nurb->flag,
+ (int)type, 'h' );
+}
+
+static int CurNurb_setFlagBits( BPy_CurNurb * self, PyObject *value,
+ void *type )
+{
+ return EXPP_setBitfield( value, (void *)&self->nurb->flag,
+ (int)type, 'h' );
+}
+
/*
* CurNurb_append( point )
* append a new point to a nurb curve.
diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py
index d8ab28524fb..5e6df688953 100644
--- a/source/blender/python/api2_2x/doc/Curve.py
+++ b/source/blender/python/api2_2x/doc/Curve.py
@@ -543,6 +543,8 @@ class CurNurb:
@ivar knotsV: The knot vector in the V direction. The tuple will be empty
if the curve isn't a NURB or doesn't have knots in this direction.
@type knotsV: tuple of floats
+ @ivar smooth: Set the smoothing for this curve (applies to cuve objects that have a bevel)
+ @type smooth: bool
"""
def __setitem__( n, point ):