From 86c7ca5639d9a9d07ee88177a6ec6109db206a06 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Fri, 1 Aug 2025 03:10:41 -0700 Subject: [PATCH] Added comment about bad normals caused by overlapping vertices --- io_scene_ase/builder.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/io_scene_ase/builder.py b/io_scene_ase/builder.py index 9d221b7..83f5a34 100644 --- a/io_scene_ase/builder.py +++ b/io_scene_ase/builder.py @@ -192,6 +192,15 @@ def build_ase(context: Context, options: ASEBuildOptions, dfs_objects: Iterable[ del face_material_indices + # TODO: There is an edge case here where if two different meshes have identical or nearly identical + # vertices and also matching smoothing groups, the engine's importer will incorrectly calculate the + # normal of any faces that have the shared vertices. + # The get around this, we could detect the overlapping vertices and display a warning, though checking + # for unique vertices can be quite expensive (use a KD-tree!) + # Another thing we can do is; when we find an overlapping vertex, we find out the range of smoothing + # groups that were used for that mesh. Then we can simply dodge the smoothing group by offseting the + # smoothing groups for the current mesh. This should work the majority of the time. + # Faces for face_index, loop_triangle in enumerate(mesh_data.loop_triangles): face = ASEFace()