gltf-transform –width 256 –height 256

batch

for f in *.fbx; do
  base="${f%.fbx}"
  
  # 1. Convert FBX to a temporary GLB
  fbx2gltf -i "$f" -o "${base}_raw.glb"
  
  # 2. Complete optimization pipeline: Resize textures, clear empty animations, apply Draco
  gltf-transform resize "${base}_raw.glb" "${base}.glb" --width 512 --height 512 && \
  gltf-transform draco "${base}.glb" "${base}.glb" --quantizePosition 10 --quantizeTexcoord 10
  
  # 3. Clean up the large intermediate file
  rm "${base}_raw.glb"
done

This updated command downscales all textures to 256×256 pixels and combines geometry quantization with animation thinning. This pipeline will maximize your file savings, likely bringing your 25 MB models down to under 1.5 MB each.

Run this loop in your Debian terminal:

bash

for f in *.fbx; do
  base="${f%.fbx}"
  
  # 1. Convert FBX to a raw GLB
  fbx2gltf -i "$f" -o "${base}_raw.glb"
  
  # 2. Resize textures to 256x256, prune empty elements, and aggressively compress geometry
  gltf-transform resize "${base}_raw.glb" "${base}.glb" --width 256 --height 256 && \
  gltf-transform prune "${base}.glb" "${base}.glb" && \
  gltf-transform draco "${base}.glb" "${base}.glb" --quantizePosition 10 --quantizeTexcoord 10 --quantizeNormal 8
  
  # 3. Remove the heavy source file
  rm "${base}_raw.glb"
done

Use code with caution.

What makes this code compress so aggressively?

  • resize --width 256 --height 256: Shrinks texture memory overhead by up to 98% compared to standard Mixamo 2K textures.
  • prune: This automatically detects and removes unused nodes, empty animations (like that dead Take 001 track in your log), and duplicate materials.
  • --quantizeNormal 8: Adds normal vector quantization to the Draco step, stripping extra floating-point precision data from the model’s lighting data where the human eye won’t notice it.

Let me know what your final file sizes look like after running this loop! If they are still too large, we can add animation sampling reduction to strip out heavy keyframes, or switch the texture format to KTX2. Would you like to check the final sizes first?