diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-08-28 00:05:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-08-28 00:05:05 +0400 |
commit | 7b0098bd04bfd6ad0033b148002b53c776fb0fca (patch) | |
tree | a80f4e7c952b3a11974a061a08ba79970217d559 /source/blender/python/api2_2x/Mesh.c | |
parent | ca843fd2f873a774e5faea4a82bde03c96594081 (diff) |
getting the mesh for all curves/surfs/text raised an error every time because it was checking the wrong object was converted to a mesh. might be own fault.
Diffstat (limited to 'source/blender/python/api2_2x/Mesh.c')
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index afc78267fa8..7afd2f07e37 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -6146,13 +6146,16 @@ static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args ) /* get updated display list, and convert to a mesh */ makeDispListCurveTypes( tmpobj, 0 ); nurbs_to_mesh( tmpobj ); - tmpmesh = tmpobj->data; - free_libblock_us( &G.main->object, tmpobj ); - if (ob->type != OB_MESH) + /* nurbs_to_mesh changes the type tp a mesh, check it worked */ + if (tmpobj->type != OB_MESH) { + free_libblock_us( &G.main->object, tmpobj ); return EXPP_ReturnPyObjError( PyExc_RuntimeError, "cant convert curve to mesh. Does the curve have any segments?" ); - break; + } + tmpmesh = tmpobj->data; + free_libblock_us( &G.main->object, tmpobj ); + break; case OB_MBALL: /* metaballs don't have modifiers, so just convert to mesh */ ob = find_basis_mball( ob ); |