Add a tool to ingest mod entity art into the CDN layout#494
Closed
ptrlrd wants to merge 1 commit into
Closed
Conversation
The run and live pages fall back to modded art after main and beta by fetching a mod repo's id-named images. tools/ingest_mod.py takes a mod key from data/mods.json plus a source (a loose image folder or a Godot .pck unpacked statically with GDRE), normalizes each per-type folder to id-named webp, and stages it under extraction/mods/<key>/<type>/<id>.webp ready for CDN upload. It reads the per-type subpaths and source extension from data/mods.json so the input matches the layout the frontend already expects, ignores Godot .import sidecars, and lowercases ids to match the in-game id convention. Verified on WatcherMod: 92 cards and 9 relics staged.
Owner
Author
|
Folded into #496, which delivers the whole modded-card feature (directory, ingest, parse, bake, backend serving, and frontend resolution) in one MR. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to the mod-asset directory (#493). This adds the tool that turns a community mod's art into the id-named layout the site falls back to.
What it does
tools/ingest_mod.pytakes a mod key fromdata/mods.jsonand a source, and stages normalized art ready for CDN upload:.pck. A.pckis unpacked statically with GDRE Tools, the same wayupdate.pyextracts the main game, so nothing needs the game running.pathsmap, it converts every image toextraction/mods/<key>/<type>/<id>.webp..importsidecars and non-image files are ignored.The per-type subpaths and the source extension come from
data/mods.json, so the input matches the layout the frontend expects. Output lands inextraction/, which is gitignored, so nothing binary gets committed.Verified
Ran it against WatcherMod (
github.com/lamali292/WatcherMod):The card and relic counts match the repo once the
.importsidecars are excluded. The potions folder holds only subfolders and a script, so it is correctly skipped. Sample output is valid RGBA webp.Notes
Stacked on #493 for the directory and
/api/modsendpoint. The frontend wiring that resolves modded art on the live and run pages (main then beta then mod) is a separate change.