Repository navigation
rpf9dump: models --lod N exports a drawable's other LODs (BUILD-1316) - #4548
Krashgamer wants to merge 2 commits into
Conversation
rpf9dump models decoded only the LOD model list at drawable +0x50, but most BLAS of the docs/bvh.md §4a interior are built from the one at +0x58, so bvh_match.py found no candidate for them in any export. --lod N (0 to 3) passes the LOD to the decoder (rpf9-explorer submodule bumped to the commit of breadbbbb/rpf9-explorer#24), writes the export to models_lod<N>/ with "Lod" in the manifest, skips the drawable's embedded textures there, and counts a drawable without that LOD as lod-unavailable instead of a failure. LOD 0 output is unchanged byte for byte. tests/test_rpf9dump_lod.py: option and layout tests on a synthetic archive, and a LOD 0/1 export of one levels.rpf window that runs only with LEONIDA_GAME_DIR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Checked a3b8f901 on Windows 11.
tests/test_rpf9dump_lod.py-> 4 tests, skipped with "requires a built rpf9dump (RPF9DUMP_DLL)" (this host has no .NET SDK), so the end-to-end LOD export is not exercised here.test_docs_links.py6 OK,test_docs_design_rows.py2 OK;git diff --checkclean.- The submodule pointer
third_party/rpf9-explorer->65a9b02aresolves:git submodule update --initcloned and checked out exactly65a9b02a16df23b4e0ffe97f6cd3ddc6051109dd.
The C# path looks consistent: --lod is models-only, rejects a non-None integer or >= LodCount, sends other LODs to models_lodN so models/manifest.json is not replaced, records Lod in the manifest, and reports lod-unavailable when a drawable only decodes at LOD 0. No blocking issue from the available evidence.
|
Tested a3b8f90 merged with main 98fa503 on Linux (Python 3.12.16, dotnet SDK 8.0.428) and native Windows (Python 3.13.1, .NET SDK 10.0.403): pass. Submodule at the PR's pin 65a9b02, rpf9dump rebuilt from the merged tree. tests/test_rpf9dump_lod.py: Linux 4 tests OK (1 skipped, the game-file one); Windows without the game 4 run OK (1 skipped), Windows with LEONIDA_GAME_DIR set to my own dump 4 run OK, none skipped (the LOD 0/1 window test passed; I only looked at pass/fail). tests/test_rpf9dump_exit_codes.py 2 OK on Linux, docs tests 10 OK. Negative control: restored main's tools/rpf9dump/Program.cs and rebuilt: 3 failures (1 skipped) on Linux and 3 failures (1 skipped) on Windows. Arithmetic in the docs: 709 + 406 = 1,115. The 709/406 counts themselves were not re-measured. |
|
Mergeable, low risk, with one contract mismatch.
Two gaps:
AI-assisted review, no game files, no GPU. |
…I (review) --lod 0 with textures or ttpf was accepted silently; any --lod there is now a usage error, and the test covers 0 and 1. The LOD tests need the built DLL, so CI runs them after "Build rpf9dump", like test_rpf9dump_exit_codes.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @tupacfan04, both fixed in the latest commit:
Re-run locally: the LOD tests pass with the game files (4 OK) and without them (3 OK, 1 skipped). |
Item: BUILD-1316 (claim), from my finding in ASSET-351 (#4506).
Depends on: breadbbbb/rpf9-explorer#24, merged (merge commit
7ef5c51). The submodule pointer is that PR's own commit65a9b02, now on the explorer'smain; it is based on the current pine293917, so this bump brings in only the LOD change and none of the other explorer commits since.What was missing
rpf9dump modelsdecodes only the LOD model list at drawable+0x50. A drawable header has four (+0x50,+0x58,+0x60,+0x68; the decoder's probe already walks all four). On thedocs/bvh.md§4a interior, 101 of the 124 archetypes with a BLAS are built from the list at+0x58, sobvh_match.pyfinds no candidate for them in any export, however large the window (#4506).What changed
RageModelDecoder.Decode(system, graphics, drawableOffset, lod)(RageModelDecoder: decode a drawable's other LODs breadbbbb/rpf9-explorer#24). The existing overloads keep LOD 0.tools/rpf9dump/Program.cs:models --lod N(0 to 3, default 0).<out>/<archive>/models_lod<N>/, with the LOD 0 OBJ names. It never writesmodels/manifest.json, the filemake_game.pyresumes the models stage on."Lod"(also0in a normal export).ModelDecodeFailuresaslod-unavailableand does not fail the run.--lodwith another mode, or outside 0 to 3, is a usage error (exit 2).docs/models.md(usage, the option,MeshModelsnow says "the exported LOD's list", and the failure paragraph namesModelDecodeFailures, which the manifest has had for a while);docs/bvh.md§7 (the option and the recipe's step 2).tests/test_rpf9dump_lod.py:test_rpf9dump_exit_codes.py(needsRPF9DUMP_DLL): out-of-range/missing values,textures --lod, themodels_lod1/directory and theLodfield.LEONIDA_GAME_DIR, skipped without it). It exports one 16 MiB window oflevels.rpfat LOD 0 and 1 into a temp dir and checks counts only: LOD 1 items are a subset of LOD 0 with fewer triangles each; LOD 1 +lod-unavailable= LOD 0; no embedded textures.Measured (counts only)
levels.rpfexported with the old and the new build gives the same 1,229 manifest rows and identical OBJs, byte for byte (the manifest only gains"Lod": 0).lod-unavailable.Tested
python -I tests/test_rpf9dump_lod.pywithRPF9DUMP_DLLandLEONIDA_GAME_DIR: 4 OK; without the game, 3 OK and 1 skipped; without the DLL, all 4 skipped.test_rpf9dump_exit_codes.py,test_dotnet_rollforward.py,test_bvh_match.py,test_make_game_assets_decoder.py,test_restofworld_model_join.py: OK.dotnet run --project tests/Rpf9DumpDiagnostics: passed. Alltests/test_docs_*.py: OK.python -I scripts/check_no_game_data.py: exit 0.python -m compileall -q make_game.py tools tests,python -I make_game.py --help: OK.dotnet build tools/rpf9dump/rpf9dump.csproj -c Release: 0 warnings, 0 errors. Windows 11 Pro, .NET 8, Python 3.14.7, no GPU. Data: Xbox Series package 1.0.2.1 (SHA-256 verified againstgame/xbox-1.0.2.1.json), local work folder outside the repository.Program.csand moves the submodule pointer, and rpf9-explorer: BC6H/BC7 BCPack block rebuilders and strict-mode lower-mip fallback, pin bump (ASSET-315) #4074 moves the pointer; whichever lands second takes a small rebase and a pointer that contains both explorer changes.Checklist
docs/design.md: not applicable.AI-assisted (Claude Code).
🤖 Generated with Claude Code