Skip to content

Packs / 3d-blender-animation-public

export-glb-draco

Convert FBX/OBJ/GLTF/STL/.blend to a web-ready GLB with optional Draco mesh compression via headless Blender, and inspect the result (meshes, animations, extensions, size) with a stdlib script.

Install

logicpacks pack use 3d-blender-animation-public/export-glb-draco
get_pack 3d-blender-animation-public/export-glb-draco

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: local-blendergltf-transform
  • Checks: 2 in outcome/checks.yaml
  • Code: convert.pyfbx_demo.pyglb_info.py
  • Tools: blender, python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Convert FBX/OBJ/GLTF/STL/.blend to a web-ready GLB with optional Draco mesh compression via headless Blender, and inspect the result (meshes, animations, extensions, size) with a stdlib script.

Goal

One command turns whatever 3D file a client or tool hands us into a compact GLB a browser (three.js, model-viewer) can load.

Steps

  1. Convert: blender -b --factory-startup --python code/convert.py -- --in model.fbx --out model.glb --draco --level 6 (--in demo makes a test mesh).
  2. Inspect: python3 code/glb_info.py model.glb (expect KHR_draco_mesh_compression in extensionsUsed when --draco).
  3. Optional extra squeeze with gltf-transform: npx -y @gltf-transform/cli optimize model.glb model.opt.glb --compress draco --texture-compress webp.
  4. Load it in the three.js viewer pack (needs DRACOLoader when Draco is on).
  5. Keep the original source file next to the GLB in storage; GLB is a delivery format.

Edge cases

  • Draco compresses geometry only; big files are usually textures: resize to 2K and use WebP/KTX2.
  • FBX from some tools carries cm units: check scale after import (apply scale before export).
  • Animations: export with export_animations=True; Draco keeps skinning data but test playback.
  • Our product hit 'doesn't support uploading GLB and other formats' in an upload flow: check the server's allowed MIME/extension list (model/gltf-binary for .glb).

Don'ts

  • Don't ship an uncompressed 50 MB GLB to phones.
  • Don't Draco-compress a mesh you still need to edit; keep the uncompressed master.
  • Don't hotlink models from a home server on a live site; copy them to the site's own storage/CDN.