Optimize ToastPRP.ps1 and fix pipeline bugs#2
Conversation
- Fix missing comma that merged PackMeshVis and CreateZip in the step list - Fix undefined variables (scriptPath, meshesSubdir, jsonFileDestinationPath) - Fix DLBSArch to validate existing bsarch instead of re-downloading every run - Fix Execute resume menu numbering and PSG cleanup paths - Optimize texture archive discovery (Data root only, single regex) - Deduplicate PackMesh/PackMeshVis staging and improve error reporting Co-authored-by: CannibalToast <CannibalToast@users.noreply.github.com>
|
Warning Review limit reached
More reviews will be available in 43 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
General review and optimization of
ToastPRP.ps1, the Fallout 4 precombine/previs automation script. Focus was on correctness bugs that could break the pipeline, plus targeted performance and maintainability improvements.What the script does
ToastPRP.ps1automates the full Precombine → PSG compression → mesh archive → CDX → Previs → final pack → zip workflow for Fallout 4 modding. It orchestrates:ckpe_loader/f4ck_loader/creationkit.exe).ba2↔.ba22for CK compatibility)Prerequisites: Mod Organizer 2, script in the FO4 install directory, PJM script already run on the target ESP.
Bugs fixed
PackMeshVisandCreateZipin$functionsCreateZipwas never a separate step; one-off/resume could call a non-existent function$scriptPath/$jsonFileDestinationPath/$meshesSubdirundefinedDLBSArchre-downloaded on every run when file existed$_.Indexon strings$EXTpathsfinallyalways reported successOptimizations
Get-TextureArchiveFiles: Scans only the Data folder root (not recursive tree walk) with one combined regex — faster on large mod lists.$script:MeshesSubdirand stops after first file found instead of listing entire trees twice.QueryESP/DLBSArchnow throw on fatal setup issues so the maincatch/finallypath reports accurately.Testing
ParseFile) passes on Linux/pwsh.Follow-ups (not in this PR)
Invoke-xEditstill uses busy-polling on window titles; could useWait-Processwhere CK exposes exit codes.Rename-Texture-Waitloop is largely redundant after synchronousRename-Item(could be removed in a future cleanup).