Only triangulate n-gons when necessary for calc_tangents #379
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi.
There is a problem with triangulate_mesh; it can calculate the wrong triangulation, and it can damage normals. But triangulating is necessary to calculate tangents if there are (>4)-gons in a mesh. The goal of this PR is to limit the damage caused to only (>4)-gons. In particular, meshes with only tris/quads should now be fixed.
(I am not aware of a fix that works for everything; for reference, the FBX and glTF exporters instead opt to omit tangents when there are (>4)-gons.)
What I changed:
Fixes #319 (or at least the collar); this one had its normals damaged.
Fixes #361; this one had the wrong triangulation.
Example: a Cylinder with rotated normals.