Skip to content

Packs / game-engines-public

blender-glb-export

Export game-ready GLB assets from Blender headless (applied transforms, Y-up, materials) and gate them on triangle and size budgets before they enter an engine

Install

logicpacks pack use game-engines-public/blender-glb-export
get_pack game-engines-public/blender-glb-export

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-blender
  • Checks: 1 in outcome/checks.yaml
  • Code: export_glb.py
  • Tools: blender, python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Any .blend becomes a GLB that loads the same in three.js, Godot, Unity (glTFast) and Unreal (glTF importer), checked against budgets in one command.

Steps

  1. Model/animate in Blender (see 3d-blender-animation).
  2. Export headless: blender -b scene.blend --python code/export_glb.py -- out.glb --apply-scale.
  3. Gate: python3 ../tools/glbtool.py inspect out.glb --max-tris 100000 --max-bytes 10000000.
  4. Optional compression for the web: npx gltf-transform optimize out.glb web.glb --compress draco --texture-compress ktx2.
  5. Import: three.js GLTFLoader (threejs/scene-with-glb-model), Godot drag-in, Unity glTFast, Unreal Interchange glTF.

Edge cases

  • Unapplied scale makes physics/colliders wrong in engines: use --apply-scale.
  • Blender shader node setups beyond Principled BSDF don't export; bake them to textures.

Don'ts

  • Don't export hidden helper objects (keep them in a separate collection excluded from export).
  • Don't skip the budget gate for mobile/web targets.