Page Menu
Home
Search
Configure Global Search
Log In
Files
F1611
Curve.c-bevob.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Gergely Erdelyi (dyce)
Nov 13 2013, 12:58 PM
Size
3 KB
Subscribers
None
Curve.c-bevob.patch
View Options
Index: Curve.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Curve.c,v
retrieving revision 1.24
diff -d -u -r1.24 Curve.c
--- Curve.c 6 Mar 2005 14:55:00 -0000 1.24
+++ Curve.c 7 Mar 2005 13:27:16 -0000
@@ -1,5 +1,5 @@
/*
- * $Id: Curve.c,v 1.24 2005/03/06 14:55:00 stiv Exp $
+ * $Id: Curve.c,v 1.23 2005/02/09 15:53:34 ianwill Exp $
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -46,6 +46,7 @@
#include "CurNurb.h"
#include "Material.h"
+#include "Object.h"
#include "gen_utils.h"
@@ -115,6 +116,9 @@
static PyObject *Curve_getMaterials( BPy_Curve * self );
+PyObject *Curve_getBevOb( BPy_Curve * self );
+PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args );
+
static PyObject *Curve_getIter( BPy_Curve * self );
static PyObject *Curve_iterNext( BPy_Curve * self );
static PyObject *Curve_update( BPy_Curve * self );
@@ -218,6 +222,10 @@
"( ) - updates display lists after changes to Curve"},
{"getMaterials", ( PyCFunction ) Curve_getMaterials, METH_NOARGS,
"() - returns list of materials assigned to this Curve"},
+ {"getBevOb", ( PyCFunction ) Curve_getBevOb, METH_NOARGS,
+ "() - returns Bevel Object assigned to this Curve"},
+ {"setBevOb", ( PyCFunction ) Curve_setBevOb, METH_VARARGS,
+ "() - assign a Bevel Object to this Curve"},
{NULL, NULL, 0, NULL}
};
@@ -1223,7 +1231,50 @@
}
+/*****************************************************************************/
+/* Function: Curve_getBevOb */
+/* Description: Get the bevel object assign to the curve. */
+/*****************************************************************************/
+PyObject *Curve_getBevOb( BPy_Curve * self)
+{
+ if( self->curve->bevobj ) {
+ return Object_CreatePyObject( self->curve->bevobj );
+ }
+
+ return EXPP_incr_ret( Py_None );
+}
+/*****************************************************************************/
+/* Function: Curve_setBevOb */
+/* Description: Assign a bevel object to the curve. */
+/*****************************************************************************/
+PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args )
+{
+ BPy_Object *pybevobj;
+
+ /* Parse and check input args */
+ if( !PyArg_ParseTuple( args, "O", &pybevobj) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected object or None argument" ) );
+ }
+
+ /* Accept None */
+ if( (PyObject *)pybevobj == Py_None ) {
+ self->curve->bevobj = (Object *)NULL;
+ } else {
+ /* Accept Object with type 'Curve' */
+ if( Object_CheckPyObject( ( PyObject * ) pybevobj ) &&
+ pybevobj->object->type == OB_CURVE) {
+ self->curve->bevobj =
+ Object_FromPyObject( ( PyObject * ) pybevobj );
+ } else {
+ return ( EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected Curve object type or None argument" ) );
+ }
+ }
+
+ return EXPP_incr_ret( Py_None );
+}
/*
* Curve_getIter
@@ -1374,6 +1425,8 @@
return Curve_getRot( self );
if( strcmp( name, "size" ) == 0 )
return Curve_getSize( self );
+ if( strcmp( name, "bevob" ) == 0 )
+ return Curve_getBevOb( self );
#if 0
if( strcmp( name, "numpts" ) == 0 )
return Curve_getNumPoints( self );
@@ -1426,6 +1479,8 @@
error = Curve_setRot( self, valtuple );
else if( strcmp( name, "size" ) == 0 )
error = Curve_setSize( self, valtuple );
+ else if( strcmp( name, "bevob" ) == 0 )
+ error = Curve_setBevOb( self, valtuple );
else { /* Error */
Py_DECREF( valtuple );
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
00/8b/fe60e01b8190ea49e180617de114
Event Timeline
Log In to Comment