Skip to content

Commit cfcd1fc

Browse files
committed
Disallow exporting colliders with no vertices.
Trying to give PhysX a null triangle mesh gives it heartburn. The poor dear.
1 parent eb250b0 commit cfcd1fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

korman/exporter/physics.py

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def _convert_mesh_data(self, bo, physical, local_space, mat, indices=True):
8282
mesh.update(calc_tessface=indices)
8383
vertices = [hsVector3(*i.co) for i in mesh.vertices]
8484

85+
# Trying to export a collider with no vertices, eh?
86+
if not vertices:
87+
raise ExportError(f"[{bo.name}]: Cannot export a collision mesh with no vertices!")
88+
8589
if indices:
8690
return (vertices, self._convert_indices(mesh))
8791
else:

0 commit comments

Comments
 (0)