You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ASSET-522: Preserve GLB strip and fan topology - #6199
The ped GLB importer ignored each primitive's mode and grouped every three indices into a triangle. A six-vertex strip or fan therefore imported as two disconnected triangles instead of four. The actual assembly CLI exited successfully with the incomplete geometry. Four-vertex strips and fans failed with the triangle-list length error.
Change
Expand indexed and non-indexed triangle strips and fans into explicit triangle lists before the existing assembly path. The helper keeps primitive order, strip parity across degenerate triangles, and vertex attributes. An omitted mode and explicit TRIANGLES keep the existing path. Point and line modes now report an unsupported-mode error before output publication.
The winding and fan center follow Khronos' Topology and Connectivity rules. Whole-number JSON modes such as 5.0 remain accepted, as allowed by the same revision's JSON Encoding rules. JSON and OBJ triangle-list normalization is unchanged.
Validation
Windows, Python 3.14.6, current main 561b65a832218fbb9e6d2effd392a8eef093a3f8. Synthetic writer fixtures only; no game files or GPU.
Eight new methods pass. The identical final tests against unchanged main produce 36 failed and four error subcases.
Eight actual CLI comparisons produce byte-identical GLBs for strip/fan input and independently triangulated controls. Inputs remain unchanged.
Default and whole-number modes preserve the expected behavior. Unsupported modes fail with exit 2 while retaining an existing output file.
Existing ped assembly suite: 14 passed. CI registration: 14 passed. Text line endings: three passed. Compileall, both help commands and diff checks pass.
Independent peer review read the full change and reran all eight new methods successfully.
Exact integration
The topology delta applies cleanly to the combination of:
All 51 combined test methods pass. Every published test file matches its exact head byte for byte. The combination retains the previously documented #5999/#6119 parser resolution, including the full precheck and JSON diagnostic wrapper.
Six additional actual CLI controls combine strip/fan input with a 90-degree parent matrix and positive or mirrored child scale. Every result matches an independently constructed triangle-list GLB with literal world coordinates and winding. These checks exercise static transform integration, not GPU rendering.
Tested 82d19e3 merged with main 916a2e8 on Linux/Python 3.12.16: pass
Merge was clean (tools/ped_assemble.py, new tests/test_ped_glb_topology.py). The test file is new, so the control is the tool restored from main.
python -I tests/test_ped_glb_topology.py: Ran 8 tests, OK.
Negative control (tools/ped_assemble.py restored from upstream/main, new test kept): Ran 8 tests, FAILED (failures=36, errors=4) across every test in the file: strips and fans mis-read as plain triangle lists, non-surface modes accepted, and incomplete strips and fans dropped. PR version restored afterwards.
Diff read: read_glb_parts now expands the primitive by its mode through _glb_triangles: 4 as before, 5 (strip) with alternating index order, 6 (fan) as (i+1, i+2, 0), a whole-number float mode accepted as the integer, and any other mode (points, lines, bool, string, fractional, out of range) or fewer than three vertices a PedAssembleError (exit 2 from the CLI with the output file left alone). The expected triangle lists in the tests are written out literally, and I checked the strip parity and fan rule in the code against the glTF 2.0 topology rules the test cites (odd strip triangles swap their last two indices).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
ASSET-522: preserve GLB triangle-strip and triangle-fan topology
Claim: #6089 (comment)
Problem
The ped GLB importer ignored each primitive's
modeand grouped every three indices into a triangle. A six-vertex strip or fan therefore imported as two disconnected triangles instead of four. The actual assembly CLI exited successfully with the incomplete geometry. Four-vertex strips and fans failed with the triangle-list length error.Change
Expand indexed and non-indexed triangle strips and fans into explicit triangle lists before the existing assembly path. The helper keeps primitive order, strip parity across degenerate triangles, and vertex attributes. An omitted mode and explicit TRIANGLES keep the existing path. Point and line modes now report an unsupported-mode error before output publication.
The winding and fan center follow Khronos' Topology and Connectivity rules. Whole-number JSON modes such as
5.0remain accepted, as allowed by the same revision's JSON Encoding rules. JSON and OBJ triangle-list normalization is unchanged.Validation
Windows, Python 3.14.6, current main
561b65a832218fbb9e6d2effd392a8eef093a3f8. Synthetic writer fixtures only; no game files or GPU.Exact integration
The topology delta applies cleanly to the combination of:
ffc26593d7e09285c602332ac3fbe9db6686883d0c78397849daae849733468acf9521b48530bf710afc791474f4be8ab2fe72e5dde877b6b3f0173bf9e2ff3ebec61a632a7aed51b57413fa368f196d7f17f7f6eeb9b45ce9f3f90603687e51a65bf83aAll 51 combined test methods pass. Every published test file matches its exact head byte for byte. The combination retains the previously documented #5999/#6119 parser resolution, including the full precheck and JSON diagnostic wrapper.
Six additional actual CLI controls combine strip/fan input with a 90-degree parent matrix and positive or mirrored child scale. Every result matches an independently constructed triangle-list GLB with literal world coordinates and winding. These checks exercise static transform integration, not GPU rendering.
AI-assisted: yes