Browse Source

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.
pull/152/head
Adam Johnson 5 years ago
parent
commit
580228b0da
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/exporter/physics.py

6
korman/exporter/physics.py

@ -43,7 +43,11 @@ class PhysicsConverter:
return indices return indices
def _convert_mesh_data(self, bo, physical, indices=True, mesh_func=None): 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 mat = bo.matrix_world
with TemporaryObject(mesh, bpy.data.meshes.remove): with TemporaryObject(mesh, bpy.data.meshes.remove):

Loading…
Cancel
Save