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/Mesh.c | |
parent | 684869fd74a3a908a5df5802f440bfa823f6c802 (diff) |
remove unneeded checks from the python API
Diffstat (limited to 'source/blender/python/api2_2x/Mesh.c')
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index db92536779d..164fdb4b372 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -4138,8 +4138,6 @@ static int MFace_setFlag( BPy_MFace *self, PyObject *value ) static PyObject *MFace_getMode( BPy_MFace *self ) { - PyObject *attr; - if( !self->mesh->mtface ) return EXPP_ReturnPyObjError( PyExc_ValueError, "face has no texture values" ); @@ -4147,13 +4145,7 @@ static PyObject *MFace_getMode( BPy_MFace *self ) if( !MFace_get_pointer( self ) ) return NULL; - attr = PyInt_FromLong( self->mesh->mtface[self->index].mode ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "PyInt_FromLong() failed" ); + return PyInt_FromLong( self->mesh->mtface[self->index].mode ); } /* @@ -7653,34 +7645,23 @@ static int Mesh_setSubDivLevels( BPy_Mesh *self, PyObject *value ) static PyObject *Mesh_getFlag( BPy_Mesh * self, void *type ) { - PyObject *attr; - switch( (long)type ) { case MESH_HASFACEUV: - attr = self->mesh->mtface ? EXPP_incr_ret_True() : + return self->mesh->mtface ? EXPP_incr_ret_True() : EXPP_incr_ret_False(); - break; case MESH_HASMCOL: - attr = self->mesh->mcol ? EXPP_incr_ret_True() : + return self->mesh->mcol ? EXPP_incr_ret_True() : EXPP_incr_ret_False(); - break; case MESH_HASVERTUV: - attr = self->mesh->msticky ? EXPP_incr_ret_True() : + return self->mesh->msticky ? EXPP_incr_ret_True() : EXPP_incr_ret_False(); - break; case MESH_HASMULTIRES: - attr = self->mesh->mr ? EXPP_incr_ret_True() : + return self->mesh->mr ? EXPP_incr_ret_True() : EXPP_incr_ret_False(); - break; default: - attr = NULL; - } - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, + return EXPP_ReturnPyObjError( PyExc_RuntimeError, "couldn't get attribute" ); + } } static int Mesh_setFlag( BPy_Mesh * self, PyObject *value, void *type ) |