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-01-28 07:58:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-01-28 07:58:22 +0300
commit907d19b93d6d1b0b5bb8449a5ef56d5fff7f64db (patch)
tree6a651da0197afac3d5a461a82cfa44487b1b4b06 /source/blender/python/api2_2x/Mesh.c
parent321cafa714e582dbff9518f288487cd4cd66a086 (diff)
made Mesh.Get('foo') raise an error when foo dosnt exist rather then returning None (to work like other modules)
also update Metaball.Get() to be less messy - still functions the same.
Diffstat (limited to 'source/blender/python/api2_2x/Mesh.c')
-rw-r--r--source/blender/python/api2_2x/Mesh.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
index 466fe151bf6..9fcec7f06ac 100644
--- a/source/blender/python/api2_2x/Mesh.c
+++ b/source/blender/python/api2_2x/Mesh.c
@@ -7801,9 +7801,13 @@ static PyObject *M_Mesh_Get( PyObject * self_unused, PyObject * args )
if( name ) {
mesh = ( Mesh * ) GetIdFromList( &( G.main->mesh ), name );
- if( !mesh )
- return EXPP_incr_ret( Py_None );
-
+ if( !mesh ) {
+ char error_msg[64];
+ PyOS_snprintf( error_msg, sizeof( error_msg ),
+ "Mesh \"%s\" not found", name );
+ return ( EXPP_ReturnPyObjError
+ ( PyExc_NameError, error_msg ) );
+ }
return Mesh_CreatePyObject( mesh, NULL );
} else { /* () - return a list with all meshes in the scene */
PyObject *meshlist;