[Bf-extensions-cvs] [2d192b40] blender-v2.81-release: STL: fix T72145 crash exporting object without data

Mikhail Rachinskiy noreply at git.blender.org
Wed Dec 4 12:10:37 CET 2019


Commit: 2d192b40050e63b198c3287d9a7ada5f3352c589
Author: Mikhail Rachinskiy
Date:   Wed Dec 4 08:46:23 2019 +0400
Branches: blender-v2.81-release
https://developer.blender.org/rBA2d192b40050e63b198c3287d9a7ada5f3352c589

STL: fix T72145 crash exporting object without data

===================================================================

M	io_mesh_stl/blender_utils.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list