From 580228b0da477365ac86e4eae126fead5517bbca Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 20 Oct 2019 18:09:31 -0400 Subject: [PATCH] Close #148. This isn't the best fix in the world. We don't really know what the user did to cause the failure because of how abstract this code is. A proper fix would be to ensure region modifiers can't get attached to non-mesh objects. That won't fix already "broken" stuff in blend files without being naughty/destructive, however. --- korman/exporter/physics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/korman/exporter/physics.py b/korman/exporter/physics.py index 311965f..840b60d 100644 --- a/korman/exporter/physics.py +++ b/korman/exporter/physics.py @@ -43,7 +43,11 @@ class PhysicsConverter: return indices def _convert_mesh_data(self, bo, physical, indices=True, mesh_func=None): - mesh = bo.to_mesh(bpy.context.scene, True, "RENDER", calc_tessface=False) + try: + mesh = bo.to_mesh(bpy.context.scene, True, "RENDER", calc_tessface=False) + except: + raise ExportError("Unable to convert object [{}] '{}' to a mesh. Make sure you didn't try to use this object as a region!", + bo.type, bo.name) mat = bo.matrix_world with TemporaryObject(mesh, bpy.data.meshes.remove):