Skip to content

Fix invalid normal indices in binary FBX export - #288

Open
ProgLuis wants to merge 1 commit into
makehumancommunity:masterfrom
ProgLuis:fix/fbx-binary-normals-index
Open

ProgLuis wants to merge 1 commit into
makehumancommunity:masterfrom
ProgLuis:fix/fbx-binary-normals-index

Conversation

@ProgLuis

Copy link
Copy Markdown

This fixes invalid normal indices generated by the binary FBX exporter.

PolygonVertexIndex uses FBX negative index encoding to mark the last vertex of each polygon. The binary exporter was also using this modified index array for NormalsIndex, causing the last normal index of every polygon to be negative.

NormalsIndex uses ByPolygonVertex / IndexToDirect mapping, so it should reference the original vertex-normal indices instead of the polygon-termination encoded indices.

This change keeps the negative termination encoding in PolygonVertexIndex unchanged and uses the original face indices for NormalsIndex.

The fix was checked with both triangles and quads. It was also tested by exporting from MakeHuman 1.3.0 and importing the binary FBX into Autodesk 3ds Max, where geometry that previously failed to import correctly was restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant