AI 3D Factory, a 3D Asset Pipeline
AI agents drive a local Blender through MCP: modelling, import, automatic rigging, animation, rendering and quality checks, ending in GLB files ready for the web.
Sole designer, coded with AI assistance
- Python
- Blender 5.2.4 bpy
- MCP
- SQLite
- glTF / GLB
- gltf-transform
- three.js
Background
The 3D figure on this site’s home page started as an image-to-3D model with 1.5 million triangles, 81.5 MB and no skeleton: too heavy for a web page and unable to move. Doing the decimation, rigging, animation and export by hand in Blender meant starting over every time the model changed. So the process became a pipeline that an AI agent such as Claude Code can call in one sentence.
What the system does
- Generates characters and props procedurally, or imports an external model
- Decimates, cleans up, rigs automatically and creates standard animations (idle, wave, scan, success, warning, error, sleep)
- Renders multi-angle previews and animation frames, runs quality checks and repairs failures automatically
- Exports GLB with web / standard / high presets, keeping a version at every step for rollback
- Further down this page you can turn the home-page figure around; it is the decimated, rigged output of this pipeline
My work
- Architecture: an MCP server exposes 31 factory_ tools to the agent; jobs go into a SQLite (WAL) queue and a single worker drives a portable Blender 5.2.4, so one project never runs two jobs at once. The server itself calls no language model.
- Automatic rigging: bone heat is computed on the original mesh first; when coverage is below 60%, weights are computed on a voxel-remeshed proxy and transferred back with Data Transfer. That is how fragmented image-to-3D meshes get rigged.
- Quality checks: eight categories (geometry, budget, material, rig, animation, glb, reimport, visual). Exports are re-imported into Blender and checked again, animations get a deformation check, and animations that fail are removed.
- Export presets: web / standard / high map to 1024 / 2048 / 4096 textures (WebP), with triangle and size budgets.
- About 2,950 lines of host-side and 3,260 lines of Blender-side Python; 11/11 unit tests and 2/2 Blender integration tests.
Problems and fixes
Fragmented meshes would not rig. hoodie_boy’s mesh is split along its UV seams, leaving 84,000 non-manifold edges; bone heat failed on the raw mesh and again on a welded proxy. Computing weights on a voxelised proxy and transferring them back brought coverage to 100%.
Exporting is not the same as working. An animation that generates and exports may still deform the mesh badly. Every animation goes through a deformation check; hoodie_boy’s wave and scan failed it, so only idle was kept.
Results
- Home-page figure: 1.5 million triangles / 81.5 MB → 80k triangles / 5.3 MB, 20 bones rigged automatically, an idle animation and all 24 checks passed; gltf-transform then brings it to 1.16 MB for desktop and 0.72 MB for mobile.
- gatekeeper: a procedurally generated guardian character with 20 bones and 7 animations, 95k triangles and 3.09 MB, passing all 48 checks after one automatic repair round.
- A similar character generated from one natural-language sentence took 23 seconds and passed all 44 checks.
Retrospective
- Procedural characters are stylised base models; faces, hands and clothing fall short of hand modelling.
- Automatic rigging suits meshes with close-fitting limbs and small movements only.
- Adapters for image-to-3D services such as Tripo and Meshy are written but have not been tested against the real APIs.