diff options
author | M Bouchard Guillaume <guillaume.bouchard@liris.cnrs.fr> | 2010-09-08 16:46:40 +0400 |
---|---|---|
committer | M Bouchard Guillaume <guillaume.bouchard@liris.cnrs.fr> | 2010-09-08 16:46:40 +0400 |
commit | 3f2f9e4d628dd5a178e4ffaaaf879f70ee0eee69 (patch) | |
tree | 9384051114acf3c6e7f8bb2ac14bb58431163cbf /io_mesh_stl | |
parent | 481a8384913259c1073006d90b37615221db87b6 (diff) |
better use of blender api
Diffstat (limited to 'io_mesh_stl')
-rw-r--r-- | io_mesh_stl/blender_utils.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index 0177d0d6..76dc86b9 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -31,12 +31,12 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True): Split the quad into two triangles ''' - if ob.type not in ('MESH', 'CURVE', 'SURFACE', 'META'): - return () - # get the modifiers - mesh = ob.create_mesh(bpy.context.scene, - True, "PREVIEW") if apply_modifier else ob.data + try: + mesh = ob.create_mesh(bpy.context.scene, + apply_modifier, "PREVIEW") + except SystemError: + return () def iter_face_index(): ''' |