From a3fc2cdabf33741d7b7cf4dab53fa47c0cc4e76f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 25 Jun 2022 20:15:55 -0400 Subject: [PATCH] Refuse to export triangle mesh regions to MOUL. --- korman/exporter/physics.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/korman/exporter/physics.py b/korman/exporter/physics.py index a8e397f..1e5e133 100644 --- a/korman/exporter/physics.py +++ b/korman/exporter/physics.py @@ -264,6 +264,17 @@ class PhysicsConverter: self._report.warn("{}: Physical memberGroup overwritten!", bo.name, indent=2) physical.memberGroup = member_group + # Sanity checking: only TPotS/Havok fully supports triangle mesh detector regions. + # ODE and PhysX 4.1 outright do not support them, and PhysX 2.6 only offers partial support, + # so warn or explode as appropriate. Note that we test against the physical itself in case + # shenanigans were performed by some of the exporters. + if physical.memberGroup == plSimDefs.kGroupDetector and physical.boundsType in (plSimDefs.kExplicitBounds, plSimDefs.kProxyBounds): + msg = f"'{bo.name}': Triangle mesh regions are poorly supported. Use a convex hull or box instead." + if ver <= pvPots: + self._report.port(msg, indent=2) + else: + raise ExportError(msg) + self._apply_props(simIface, physical, kwargs) def _export_box(self, bo, physical, local_space, mat):