Page Menu
Home
Search
Configure Global Search
Log In
Files
F1068
bpycurve-flagu-taper.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Toni Alatalo (antont)
Nov 13 2013, 12:53 PM
Size
5 KB
Subscribers
None
bpycurve-flagu-taper.diff
View Options
Index: api2_2x/CurNurb.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/CurNurb.c,v
retrieving revision 1.14
diff -u -r1.14 CurNurb.c
--- api2_2x/CurNurb.c 9 Aug 2005 08:12:36 -0000 1.14
+++ api2_2x/CurNurb.c 8 Sep 2005 18:55:30 -0000
@@ -641,12 +641,15 @@
static PyObject *CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args )
{
- int flagu;
+ int arg, flagu;
- if( !PyArg_ParseTuple( args, "i", &( flagu ) ) )
+ if( !PyArg_ParseTuple( args, "i", &( arg ) ) )
return ( EXPP_ReturnPyObjError
( PyExc_AttributeError,
"expected integer argument" ) );
+
+ flagu = arg * 2;
+ flagu = (self->nurb->flagu & CU_CYCLIC ) | flagu;
if( self->nurb->flagu != flagu ) {
self->nurb->flagu = (short)flagu;
Index: api2_2x/Curve.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Curve.c,v
retrieving revision 1.33
diff -u -r1.33 Curve.c
--- api2_2x/Curve.c 11 Aug 2005 22:27:53 -0000 1.33
+++ api2_2x/Curve.c 8 Sep 2005 18:55:30 -0000
@@ -113,6 +113,9 @@
static PyObject *Curve_getBevOb( BPy_Curve * self );
static PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args );
+static PyObject *Curve_getTaperOb( BPy_Curve * self );
+static PyObject *Curve_setTaperOb( BPy_Curve * self, PyObject * args );
+
static PyObject *Curve_getIter( BPy_Curve * self );
static PyObject *Curve_iterNext( BPy_Curve * self );
@@ -219,6 +222,10 @@
"() - returns Bevel Object assigned to this Curve"},
{"setBevOb", ( PyCFunction ) Curve_setBevOb, METH_VARARGS,
"() - assign a Bevel Object to this Curve"},
+ {"getTaperOb", ( PyCFunction ) Curve_getTaperOb, METH_NOARGS,
+ "() - returns Taper Object assigned to this Curve"},
+ {"setTaperOb", ( PyCFunction ) Curve_setTaperOb, METH_VARARGS,
+ "() - assign a Taper Object to this Curve"},
{NULL, NULL, 0, NULL}
};
@@ -1318,6 +1325,54 @@
return EXPP_incr_ret( Py_None );
}
+/*****************************************************************************/
+/* Function: Curve_getTaperOb */
+/* Description: Get the taper object assign to the curve. */
+/*****************************************************************************/
+
+
+static PyObject *Curve_getTaperOb( BPy_Curve * self)
+{
+ if( self->curve->taperobj ) {
+ return Object_CreatePyObject( self->curve->taperobj );
+ }
+
+ return EXPP_incr_ret( Py_None );
+}
+
+/*****************************************************************************/
+/* Function: Curve_setTaperOb */
+/* Description: Assign a taper object to the curve. */
+/*****************************************************************************/
+
+PyObject *Curve_setTaperOb( BPy_Curve * self, PyObject * args )
+{
+ BPy_Object *pytaperobj;
+
+ /* Parse and check input args */
+ if( !PyArg_ParseTuple( args, "O", &pytaperobj) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected object or None argument" ) );
+ }
+
+ /* Accept None */
+ if( (PyObject *)pytaperobj == Py_None ) {
+ self->curve->taperobj = (Object *)NULL;
+ } else {
+ /* Accept Object with type 'Curve' */
+ if( Object_CheckPyObject( ( PyObject * ) pytaperobj ) &&
+ pytaperobj->object->type == OB_CURVE) {
+ self->curve->taperobj =
+ Object_FromPyObject( ( PyObject * ) pytaperobj );
+ } else {
+ return ( EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected Curve object type or None argument" ) );
+ }
+ }
+
+ return EXPP_incr_ret( Py_None );
+}
+
/*
* Curve_getIter
*
@@ -1469,6 +1524,8 @@
return Curve_getSize( self );
if( strcmp( name, "bevob" ) == 0 )
return Curve_getBevOb( self );
+ if( strcmp( name, "taperob" ) == 0 )
+ return Curve_getTaperOb( self );
#if 0
if( strcmp( name, "numpts" ) == 0 )
return Curve_getNumPoints( self );
@@ -1525,6 +1582,8 @@
error = Curve_setSize( self, valtuple );
else if( strcmp( name, "bevob" ) == 0 )
error = Curve_setBevOb( self, valtuple );
+ else if( strcmp( name, "taperob" ) == 0 )
+ error = Curve_setTaperOb( self, valtuple );
else { /* Error */
Py_DECREF( valtuple );
Index: api2_2x/doc/Curve.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Curve.py,v
retrieving revision 1.14
diff -u -r1.14 Curve.py
--- api2_2x/doc/Curve.py 15 Jun 2005 06:22:26 -0000 1.14
+++ api2_2x/doc/Curve.py 8 Sep 2005 18:55:30 -0000
@@ -337,6 +337,23 @@
@raise TypeError: throws exception if the parameter is not a Curve type Blender Object or PyNone
"""
+ def getTaperOb():
+ """
+ Returns the Taper Object (TaperOb) assigned to the Curve.
+ @rtype: Blender Object or PyNone
+ @return: Taper Object (TaperOb) assigned to the Curve.
+ """
+
+ def setTaperOb( object ):
+ """
+ Assign a Taper Object (TaperOb) to the Curve. Passing None as the object parameter removes the taper.
+ @rtype: PyNone
+ @return: PyNone
+ @type object: Curve type Blender Object
+ @param object: Blender Object to assign as Taper Object (TaperOb)
+ @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or PyNone
+ """
+
def update():
"""
Updates display list for a Curve.
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
92/76/fc335955802318fabd29d8195359
Event Timeline
Log In to Comment