fix(importer): import glTF primitives that have no index accessor #840
No reviewers
Labels
No labels
Context: Bug
Context: Enhancements
Platform: Android
Platform: Linux
Platform: Web
Platform: Windows
Platform: iOS
Platform: macOS
Target: CI
Target: CLI
Target: Dependency
Target: Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SakulFlee/Orbital!840
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/gltf-non-indexed-primitives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A glTF primitive is allowed to omit its index accessor, in which case the spec defines its vertices as implicitly indexed 0..N in order. The importer treated a missing accessor as fatal for the primitive and continued, so every such primitive was dropped from the import with nothing but a "Primitive has no indices" log line. Several exporters emit unindexed primitives, so this could silently empty a model.
Keeps the accessor as an Option and resolves the implicit case once positions_vec is known, so the synthesized 0..N list feeds the same normal calculation and winding flip an explicit accessor feeds. A vertex count that isn't a whole number of triangles now logs the trailing vertices the winding flip drops.
Adds a regression test on a primitive with no NORMAL attribute and no index accessor, so the normals it asserts can only come from the synthesized indices reaching the triangle-geometry path. Verified the test fails without the fix (0 models instead of 1).