Browse Source

Disallow exporting colliders with no vertices.

Trying to give PhysX a null triangle mesh gives it heartburn. The poor
dear.
pull/422/merge
Adam Johnson 2 months ago
parent
commit
cfcd1fcb06
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 4
      korman/exporter/physics.py

4
korman/exporter/physics.py

@ -82,6 +82,10 @@ class PhysicsConverter:
mesh.update(calc_tessface=indices)
vertices = [hsVector3(*i.co) for i in mesh.vertices]
# Trying to export a collider with no vertices, eh?
if not vertices:
raise ExportError(f"[{bo.name}]: Cannot export a collision mesh with no vertices!")
if indices:
return (vertices, self._convert_indices(mesh))
else:

Loading…
Cancel
Save