threejs-model-optimize
Installation
SKILL.md
Optimize a model
gltf-transform optimize with default flags joins named meshes, merges materials into palettes and flattens the
hierarchy. That is right for scenery and silently breaks any code that finds parts by name, swaps materials or
attaches objects to nodes. Pick a preset from what the app does with the model, then check that the names it uses
survived.
Paths: <this-skill-dir> is the directory containing this SKILL.md and <inspect-skill-dir> the one containing
threejs-model-inspect's; replace them with absolute paths and quote them. The script needs Node 22+ and npx
with network access; its before/after report needs threejs-model-inspect installed next to this skill.
Process
- Run
threejs-model-inspecton the source and note where the bytes are (geometry, textures, animation) and which names, materials and clips the app references (search the code forgetObjectByName,nodes.,materials., clip names). Check for an existing pipeline first (package.json scripts runninggltfpackorgltf-transform, a generator ofgltfpackin the report): files it already compressed rarely shrink further. Improve that pipeline's flags instead of replacing it, and keep the original whenever the script reports no meaningful gain. - Choose a preset: