Red40 Clothing Repacker is a .NET CLI for analyzing GTA V/FiveM clothing resources, merging ped variation collections into a generated resource, and optionally applying those changes back to your working resource set with a reversible backup manifest.
It supports:
- Scanning resource folders for
.ymtand.ymt.xmlclothing data - Exporting binary
.ymtfiles to XML for inspection - Generating a merge plan as JSON
- Building a new merged resource without touching the originals
- Applying the plan to your resources with backup metadata
- Restoring everything from the backup manifest
Like this tool and want to support further development? Checkout our store Red40 Development
As of this commit, FiveM syncs component drawable indices with 8 bits. Runtime testing shows that streamed collection index 255 still does not load, so generated YMTs are capped at 255 drawables per component, using local indices 0-254. This change is component-only: numAvailProps is still an unsigned byte count, so generated YMTs are also capped at 255 aggregate props across all prop anchors.
-
Download the release version approriate for your architecture (Windows/Linux x86-64 builds)
-
Launch and follow the steps in the help button
-
Enable
Optimize YMT usagebefore Analyze if you want the planner to rearrange component/prop lanes across generated YMTs to reduce the target collection count. Leave it off to keep source packs grouped more conservatively. Note that if you have a large number of a single component such as JBIB this will tend to leave ymts with little to no other items in them. -
Now featuring a graphical representation of the repacked ymts
Download the release version approriate for your architecture (Windows/Linux x86-64 builds)
Copy the executable to your clothing folder
Prerequisites:
- Git
- .NET 10 SDK
Clone the repository with the CodeWalker submodule:
git clone --recurse-submodules https://github.com/Red40-Development/red40_clothing_packer.git
cd red40_clothing_packerRun the CLI directly:
dotnet run --project src/ClothingRepacker.Cli -- --helpIf you are running from source, use dotnet run --project src/ClothingRepacker.Cli -- ... instead.
ClothingRepacker.Cli analyze --resources <path> --target-resource <name> --out <plan.json>
[--max-drawables-per-component <1-255>] [--max-drawables-per-prop <1-255>]
[--optimize-ymt-usage]
ClothingRepacker.Cli analyze --resource <path_to_resource> [--resource <path_to_resource> ...]
--generated-root <folder> --target-resource <name> --out <plan.json>
[--max-drawables-per-component <1-255>] [--max-drawables-per-prop <1-255>]
[--optimize-ymt-usage]
ClothingRepacker.Cli build --plan <plan.json> --out <folder>
[--include-ymt-xml <true|false>] [--include-debug-client <true|false>]
ClothingRepacker.Cli apply --plan <plan.json> --backup-root <folder> [--copy-resources-to-output]
ClothingRepacker.Cli restore --backup-manifest <backup-manifest.json>
ClothingRepacker.Cli validate --plan <plan.json>
ClothingRepacker.Cli validate --resources <path>
ClothingRepacker.Cli validate --resource <path_to_resource> [--resource <path_to_resource> ...] --generated-root <folder>
ClothingRepacker.Cli report --plan <plan.json> [--out <report.txt>]
ClothingRepacker.Cli export-xml --folder <path> [--overwrite]By default, the CLI checks the latest GitHub release when a command starts and prints a notice if a newer version is available. Add --no-version-check to any command, or set RED40_NO_VERSION_CHECK=1, to skip the check.
Release publishing enables deterministic .NET compilation, deterministic source paths, and CI build metadata. The release workflow also publishes every target twice and compares SHA-256 hashes for all generated files. A mismatch fails the workflow before the release assets are collected.
To run the same check locally after restoring the solution, use:
python3 scripts/verify-reproducible-build.pyAssume your clothing resources live in the same directory as the executable.
Open a terminal (Powershell/Terminal) and navigate to your folder with all your clothing assets such as [clothing]
Create a merge plan:
ClothingRepacker.Cli analyze \
--resources . \
--target-resource zz_merged_clothing_meta \
--out plan.jsonOr pick exact resource folders instead of scanning every child folder under one parent:
ClothingRepacker.Cli analyze \
--resource ./gang_flags \
--resource ./gang_outfits \
--generated-root . \
--target-resource zz_merged_clothing_meta \
--out plan.jsonWhen using one or more --resource options, each value must be an actual resource folder. --generated-root controls where apply will copy the generated merged resource.
By default, analyze keeps each source YMT's component and prop lanes together unless a source exceeds the configured drawable limits. The prop limit applies to the aggregate prop metadata in a generated YMT, across all prop anchors. Add --optimize-ymt-usage to let the planner split source lanes across generated YMTs when that can produce fewer target collections. This can reduce YMT usage, but the resulting plan may mix pieces of the same source pack across multiple generated collections.
Validate the generated plan:
ClothingRepacker.Cli validate --plan plan.jsonGenerate a text report showing how source YMT component/prop ranges will land in each merged target YMT:
ClothingRepacker.Cli report --plan plan.json --out repack-report.txtBuild the merged resource into a separate output folder (disable the ymt-xml or debug commands as appropriate):
ClothingRepacker.Cli build \
--plan plan.json \
--out . \
--include-ymt-xml true \
--include-debug-client trueThis writes a generated resource like:
./zz_merged_clothing_meta/fxmanifest.lua./zz_merged_clothing_meta/stream/*.ymt./zz_merged_clothing_meta/stream/*.ymt.xml./zz_merged_clothing_meta/data/*.meta./zz_merged_clothing_meta/client/validate_collections.lua
The two optional build toggles both default to true:
--include-ymt-xml falseskips writing the previewstream/*.ymt.xmlfiles--include-debug-client falseskips generatingclient/validate_collections.luaand removes itsclient_scriptline fromfxmanifest.lua
Creature metadata is preserved and remapped when it has a matching source ShopPedApparel creatureMetaData reference. When multiple source shop metadata files share one creature metadata file, the generated shop metadata keeps that relationship and points to one shared generated creature metadata YMT. Creature metadata without a matching shop metadata reference is treated as broken, warned about during analyze, skipped during build, and only moved into the backup during apply.
pedalternatevariations.meta and first_person_alternates.meta files are detected, remapped to generated collection names and drawable indexes, written to the generated resource data folder, and declared in the generated manifest with their FiveM data file types.
Apply the plan to your actual resource set:
ClothingRepacker.Cli apply \
--plan plan.json \
--backup-root ./backupsTo leave the source resources untouched, apply against a copied output set instead:
ClothingRepacker.Cli apply \
--plan plan.json \
--backup-root ./backups \
--copy-resources-to-outputapply does three important things:
- Renames stream files according to the plan
- Copies original source
.ymtfiles into a timestamped backup folder, then removes them from the source resources - Creates the generated merged resource under the plan's generated root. For
--resources <parent>plans this remains the sibling folder next to your resources root; for repeated--resourceplans it is the--generated-rootfolder.
With --copy-resources-to-output, apply first copies the source resource folders into the plan's generated root and performs the stream renames and source .ymt removals on those copies. Use an output root separate from the original resources.
Every apply run writes a timestamped backup folder under your chosen --backup-root, including a backup-manifest.json file.
Example:
./backups/2026-06-16T103000Z/backup-manifest.json
To undo an apply, run:
ClothingRepacker.Cli restore \
--backup-manifest ./backups/2026-06-16T103000Z/backup-manifest.jsonrestore will:
- Delete the generated merged resource created by
apply - Put backed-up source
.ymtfiles back in their original locations - Move renamed stream files back to their original names
export will:
- Export
.ymtfiles to XML
ClothingRepacker.Cli export-xml --folder .NOTE:
- Keep the entire timestamped backup directory until you have verified the restore worked
- Prefer running
buildfirst so you can inspect output before modifying your real resources withapply
- Red40 Development (c) 2026
- dexyfex/CodeWalker
This project uses code and file-format handling from CodeWalker. Credit and thanks to the CodeWalker project for making GTA V/FiveM resource inspection and serialization work possible.


