/qadri-3d:3d-asset-optimizationfrom qadri-3d
Optimize 3D models (glTF/GLB) for the web so product pages load fast on phones. Covers mesh compression (Meshopt, Draco), texture compression (KTX2, WebP, AVIF), resizing, simplification, validation and size budgets with the glTF-Transform CLI. Use when a GLB/glTF file is too large or slow, the user asks to compress, optimize, shrink or convert a 3D model, when converting from FBX/OBJ/Blender for the web, or when setting up a 3D asset pipeline.
Ships in qadri-3d. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Raw exports from CAD or Blender are often 20–200 MB. A product page needs a few MB at most. Optimize every model before it goes on a page, and keep the original as the source of truth.
glTF-Transform is a well-maintained CLI and library for glTF. One command covers most cases:
npx @gltf-transform/cli optimize input.glb output.glb --compress meshopt --texture-compress webp
optimize runs a sequence of cleanups:
Useful options:
| Option | Values | Notes |
|---|---|---|
--compress | meshopt (default), draco, quantize, false | Geometry compression |
--texture-compress | auto (default), webp, avif, ktx2, false | ktx2 saves GPU memory; webp and avif save download size |
--texture-size | number (default 2048) | Maximum texture dimension |
--simplify | true or false | Mesh simplification with meshoptimizer; tune with --simplify-ratio and --simplify-error |
Two optimize steps are on by default and change the model's structure:
| Option | Default | What it does |
|---|---|---|
--join | on | Merges meshes that share a material, to reduce draw calls |
--palette | on | Can merge simple materials into one material with a palette texture |
That is fine for a static viewer. It breaks configurators and hotspots that find parts or materials by name.
Measured on this repo's demo mug (glTF-Transform 4.5.1):
| Command | Size | Meshes | Material names |
|---|---|---|---|
| Original export | 129 KB | 8 | kept |
optimize --compress meshopt --texture-compress webp | 27 KB | 4: parts merged | kept |
the same plus --palette false --join false | 31.5 KB | 8 | kept |
For anything a script manipulates by name, use:
npx @gltf-transform/cli optimize input.glb output.glb --compress meshopt --texture-compress webp --palette false --join false
Run npx @gltf-transform/cli optimize --help to see the options of the installed version. Inspect a file with npx @gltf-transform/cli inspect model.glb: it lists meshes, materials, textures and their sizes.
| Meshopt | Draco | |
|---|---|---|
| Compression ratio | Good; better with gzip or brotli on the server | Usually smaller for dense meshes |
| Decode speed | Very fast | Slower; the decoder is a WASM download |
| Animations and morph targets | Supported | Geometry only |
| three.js | loader.setMeshoptDecoder(MeshoptDecoder) | loader.setDRACOLoader(dracoLoader) |
Default to Meshopt for product viewers. Use Draco when the file size is paramount and the mesh is static.
| Texture format | Choose when |
|---|---|
| WebP or AVIF | You want the smallest download and simple tooling |
| KTX2 (Basis Universal) | GPU memory matters: textures stay compressed on the GPU. Best for large texture sets, many products on one page, or low-end phones. Needs KTX2Loader with detectSupport(renderer). |
| Item | Target |
|---|---|
| File size (compressed) | ≤ 2–3 MB; under 1 MB is excellent |
| Triangles | ≲ 100k (simplify further if it doesn't show) |
| Textures | ≤ 2048² each; 1024² for small parts; as few as possible |
| Materials | As few as possible; merge where the look allows |
| Draw calls | ≲ 50 |
.glb) from the source tool, e.g. Blender's File → Export → glTF 2.0.
validate command.Content-Type: model/gltf-binary for .glb..blend, the original .glb) in the repository or in storage. Never optimize an already optimized file repeatedly.inspect shows the expected size, triangle count and texture sizes.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub qadri-uk/claude-skills --plugin qadri-3d71 skills in this plugin
/360-product-spinAdd a 360° product spin (a draggable image sequence) to a product page, and produce the frames by photographing the product on a turntable or rendering a 3D model with three.js. Use when the user wants a 360 view, a spin or rotating product photos, "turn the product around", a 360 product viewer, sprite sheets for product rotation, or has product photos but no 3D model. Uses the zero-dependency Spin360 web component./3d-3d-cloth-materialBuild convincing woven cloth in Three.js, with a thread-level weave normal map, sheen and anisotropic highlights, folds that never stretch the texture, hems with thickness, stitches, seams, frayed edges, fold occlusion, dye and wear variation, and light passing through thin fabric. Use for linen, silk, wool, canvas, curtains, banners, cloaks, tablecloths, tapestries or any 3D drape that currently looks like a plastic sheet, a stretched texture, or a flat coloured plane./3d-3d-falling-leavesBuild recognizable falling leaves in world space using instanced geometry, independent tumble, coupled sideways drift, shared wind, scene occlusion, and camera-aware recycling. Use for 3D autumn leaves or drifting foliage in Three.js and similar scenes; use falling-leaves for a 2D canvas overlay./3d-3d-four-seasonsAdd coordinated spring, summer, fall, and winter states to a 3D scene, blending foliage, sunlight, sky, ground materials, snow, and particles without rebuilding the world. Use for seasonal controls, architectural walkthroughs, and outdoor scenes with four-season transitions./3d-3d-high-poly-modelsCreate or integrate highly detailed 3D models with smooth silhouettes, shaped surfaces, believable bevels, and close-up geometry, then prepare suitable runtime LODs and loading. Use when a user requests high polygon counts, ultra-realistic models, detailed architectural assets, or removal of visibly faceted geometry./3d-3d-high-resolution-texturesBuild sharp, physically coherent high-resolution materials for 3D rendering with appropriate PBR maps, texel density, UV direction, mipmaps, anisotropic filtering, and progressive asset delivery. Use for detailed wood, stone, fabric, foliage, and architectural close-ups without excessive download or GPU memory costs.