diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
commit | e192e7e02452c70511f688582d8d95d0a6267ee5 (patch) | |
tree | 75698ba122c3820668888ab38958e5c7e5cbb591 /source/blender/python/api2_2x/Curve.c | |
parent | 684869fd74a3a908a5df5802f440bfa823f6c802 (diff) |
remove unneeded checks from the python API
Diffstat (limited to 'source/blender/python/api2_2x/Curve.c')
-rw-r--r-- | source/blender/python/api2_2x/Curve.c | 104 |
1 files changed, 13 insertions, 91 deletions
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c index 109a4572387..eeaeebbbae8 100644 --- a/source/blender/python/api2_2x/Curve.c +++ b/source/blender/python/api2_2x/Curve.c @@ -138,13 +138,7 @@ struct chartrans *text_to_curve( Object * ob, int mode ); PyObject *Curve_getName( BPy_Curve * self ) { - PyObject *attr = PyString_FromString( self->curve->id.name + 2 ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.name attribute" ); + return PyString_FromString( self->curve->id.name + 2 ); } static int Curve_newsetName( BPy_Curve * self, PyObject * args ) @@ -164,13 +158,7 @@ static int Curve_newsetName( BPy_Curve * self, PyObject * args ) static PyObject *Curve_getPathLen( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->pathlen ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.pathlen attribute" ); + return PyInt_FromLong( ( long ) self->curve->pathlen ); } @@ -191,25 +179,13 @@ static int Curve_newsetPathLen( BPy_Curve * self, PyObject * args ) static PyObject *Curve_getTotcol( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->totcol ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.totcol attribute" ); + return PyInt_FromLong( ( long ) self->curve->totcol ); } PyObject *Curve_getMode( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->flag ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.flag attribute" ); + return PyInt_FromLong( ( long ) self->curve->flag ); } @@ -230,13 +206,7 @@ static int Curve_newsetMode( BPy_Curve * self, PyObject * args ) PyObject *Curve_getBevresol( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->bevresol ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.bevresol attribute" ); + return PyInt_FromLong( ( long ) self->curve->bevresol ); } static int Curve_newsetBevresol( BPy_Curve * self, PyObject * args ) @@ -263,13 +233,7 @@ static int Curve_newsetBevresol( BPy_Curve * self, PyObject * args ) PyObject *Curve_getResolu( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->resolu ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.resolu attribute" ); + return PyInt_FromLong( ( long ) self->curve->resolu ); } @@ -301,13 +265,7 @@ static int Curve_newsetResolu( BPy_Curve * self, PyObject * args ) PyObject *Curve_getResolv( BPy_Curve * self ) { - PyObject *attr = PyInt_FromLong( ( long ) self->curve->resolv ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.resolv attribute" ); + return PyInt_FromLong( ( long ) self->curve->resolv ); } static int Curve_newsetResolv( BPy_Curve * self, PyObject * args ) @@ -333,13 +291,7 @@ static int Curve_newsetResolv( BPy_Curve * self, PyObject * args ) PyObject *Curve_getWidth( BPy_Curve * self ) { - PyObject *attr = PyFloat_FromDouble( ( double ) self->curve->width ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.width attribute" ); + return PyFloat_FromDouble( ( double ) self->curve->width ); } @@ -367,13 +319,7 @@ static int Curve_newsetWidth( BPy_Curve * self, PyObject * args ) PyObject *Curve_getExt1( BPy_Curve * self ) { - PyObject *attr = PyFloat_FromDouble( ( double ) self->curve->ext1 ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.ext1 attribute" ); + return PyFloat_FromDouble( ( double ) self->curve->ext1 ); } @@ -400,13 +346,7 @@ static int Curve_newsetExt1( BPy_Curve * self, PyObject * args ) PyObject *Curve_getExt2( BPy_Curve * self ) { - PyObject *attr = PyFloat_FromDouble( ( double ) self->curve->ext2 ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.ext2 attribute" ); + return PyFloat_FromDouble( ( double ) self->curve->ext2 ); } @@ -535,14 +475,8 @@ static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args ) static PyObject *Curve_getLoc( BPy_Curve * self ) { - PyObject *attr = Py_BuildValue( "[f,f,f]", self->curve->loc[0], + return Py_BuildValue( "[f,f,f]", self->curve->loc[0], self->curve->loc[1], self->curve->loc[2] ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.loc attribute" ); } static int Curve_newsetLoc( BPy_Curve * self, PyObject * args ) @@ -573,14 +507,8 @@ TypeError: static PyObject *Curve_getRot( BPy_Curve * self ) { - PyObject *attr = Py_BuildValue( "[f,f,f]", self->curve->rot[0], + return Py_BuildValue( "[f,f,f]", self->curve->rot[0], self->curve->rot[1], self->curve->rot[2] ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.rot attribute" ); } static int Curve_newsetRot( BPy_Curve * self, PyObject * args ) @@ -611,14 +539,8 @@ TypeError: static PyObject *Curve_getSize( BPy_Curve * self ) { - PyObject *attr = Py_BuildValue( "[f,f,f]", self->curve->size[0], + return Py_BuildValue( "[f,f,f]", self->curve->size[0], self->curve->size[1], self->curve->size[2] ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Curve.size attribute" ); } static int Curve_newsetSize( BPy_Curve * self, PyObject * args ) |