diff options
author | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2019-12-04 07:46:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-12-04 14:01:36 +0300 |
commit | 2d192b40050e63b198c3287d9a7ada5f3352c589 (patch) | |
tree | a6eaed9b92f6c9f5320cf89fc632f7cd1e59124b | |
parent | ed5b81f501ea4ef89623ac745497e125ef4ba273 (diff) |
STL: fix T72145 crash exporting object without datav2.81ablender-v2.81-release
-rw-r--r-- | io_mesh_stl/blender_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index d1b14cf6..63f0c4f2 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -78,7 +78,8 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False): """ # get the editmode data - ob.update_from_editmode() + if ob.mode == "EDIT": + ob.update_from_editmode() # get the modifiers if use_mesh_modifiers: @@ -92,6 +93,7 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False): mesh = mesh_owner.to_mesh() except RuntimeError: return + if mesh is None: return |