Upload a static 3D mesh. Get an animation-ready rigged model in seconds.
Features β’ Architecture β’ Pipeline β’ Tech Stack β’ Getting Started β’ Project Structure β’ API β’ License
ZamaRig is a full-stack web application that automatically rigs 3D models using a combination of machine learning classification and procedural bone fitting. Users upload a static .obj or .fbx mesh through a modern web interface, and the system:
- Renders the model from multiple camera angles
- Classifies it as humanoid or quadruped using a trained CNN
- Generates and fits a skeleton template based on the model's anatomy
- Applies automatic weight painting (skinning)
- Returns the rigged model ready for animation
No manual bone placement. No weight painting by hand. Just upload and download.
- AI Classification β EfficientNetB0-based CNN automatically determines model type (humanoid / quadruped)
- Automatic Skeleton Generation β Procedural bone placement using bounding box analysis and anatomical proportions
- Pose Detection β Detects whether humanoid models are in A-pose or T-pose for accurate fitting
- Geodesic Skinning β Advanced weight painting using geodesic distance calculations for natural deformation
- Interactive 3D Landing Page β Scroll-driven animations with dissolve effects, model transitions, and skeleton visualization using Three.js
- Real-time 3D Preview β Preview uploaded and rigged models directly in the browser with React Three Fiber
- Dark / Light Theme β Full theme support across UI and 3D viewport
- Responsive Design β Optimized layouts for desktop, tablet, and mobile
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT β
β React + TypeScript + Three.js/R3F + GSAP + Tailwind CSS β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β Landing β β Rig β β 3D View β β Theme System β β
β β Page β β Page β β (R3F) β β (Context) β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β REST API (multipart/form-data)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND β
β FastAPI + Uvicorn (Async Python) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β β API Router β β ML Service β β Blender Service β β
β β /api/v1/* β β (TF/Keras) β β (subprocess β bpy) β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β subprocess call
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BLENDER (Headless) β
β Python bpy scripts β runs without GUI β
β ββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββ β
β β Renderer β β Humanoid β β Quadruped β β
β β (renders) β β Rigging β β Rigging β β
β ββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The auto-rigging pipeline follows 6 sequential stages:
The user uploads a .obj or .fbx file. The backend saves it temporarily and validates the format.
Blender runs headlessly to import the model, center it, and render silhouette images from 4β6 camera angles (front, back, left, right, top). These renders serve as input to the classifier.
The rendered images are fed into a pre-trained EfficientNetB0 model (transfer learning on ImageNet). The CNN outputs a category with a confidence score:
humanoidβ bipedal characters (humans, robots, etc.)quadrupedβ four-legged animals (dogs, horses, etc.)
Based on the classification result, the corresponding skeleton template is loaded. The system:
- Computes the mesh's bounding box dimensions
- For humanoids: detects A-pose vs T-pose via arm angle analysis
- Scales and positions each bone proportionally using anatomical heuristics
- Handles special cases like finger joints, spine curvature, and tail bones
Vertices are assigned bone influence weights using:
- Blender's built-in Auto Weights as a baseline
- Geodesic distance-based skinning for improved deformation quality around joints
The fully rigged model is exported as .glb (glTF Binary) and served to the frontend for preview and download.
π For an in-depth technical deep-dive with mathematical foundations, bone hierarchies, and code-level explanations, see RIGGING_PIPELINE.md.
| Technology | Purpose |
|---|---|
| React 19 | UI framework with hooks & context |
| TypeScript | Type-safe development |
| Vite | Build tool & dev server |
| React Three Fiber | Declarative Three.js for 3D rendering |
| Three.js | WebGL-based 3D engine |
| GSAP + ScrollTrigger | Scroll-driven animations & transitions |
| Lenis | Smooth scroll behavior |
| Tailwind CSS 4 | Utility-first styling |
| React Router 7 | Client-side routing |
| Technology | Purpose |
|---|---|
| FastAPI | Async Python API framework |
| Uvicorn | ASGI server |
| TensorFlow / Keras | ML model inference (EfficientNetB0) |
| Pillow | Image preprocessing |
| NumPy | Numerical operations |
| Pydantic | Request/response validation |
| Technology | Purpose |
|---|---|
| Blender 5.x (bpy) | Headless 3D processing, rendering, rigging |
| EfficientNetB0 | Image classification (transfer learning) |
| Geodesic Skinning | Distance-based vertex weight calculation |
| Technology | Purpose |
|---|---|
| Vercel | Frontend hosting (SPA with rewrites) |
| Bun | JavaScript runtime & package manager |
- Node.js 18+ or Bun (recommended)
- Python 3.10+
- Blender 5.x (must be accessible from command line)
cd frontend
bun install # or npm install
bun dev # starts dev server at http://localhost:5173cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.py # starts API at http://localhost:8000Create frontend/.env:
VITE_API_URL=http://localhost:8000cd frontend
bun run build # outputs to dist/auto-rigging/
βββ frontend/ # React + TypeScript SPA
β βββ public/ # Static assets (3D models, icons)
β βββ src/
β β βββ components/
β β β βββ landing/ # Landing page components
β β β β βββ landing-canvas.tsx # Three.js canvas wrapper
β β β β βββ landing-model.tsx # 3D model with scroll animations
β β β β βββ dissolve-material.ts # Custom dissolve shader
β β β β βββ smooth-scroll.tsx # Lenis smooth scroll + progress bar
β β β β βββ loading-screen.tsx # Loading overlay
β β β β βββ footer.tsx # Site footer
β β β β βββ sections/ # Individual scroll sections
β β β βββ layout/ # Header, layout wrapper
β β β βββ ui/ # Reusable UI components
β β βββ config/
β β β βββ scroll-anim-config.ts # Responsive scroll animation values
β β βββ hooks/ # Custom React hooks (theme, etc.)
β β βββ pages/ # Route pages (Home, Rig)
β β βββ services/ # API client services
β β βββ types/ # TypeScript type definitions
β βββ vercel.json # Vercel SPA routing config
β βββ package.json
β
βββ backend/ # FastAPI Python server
β βββ main.py # App entry point
β βββ requirements.txt
β βββ app/
β β βββ api/v1/
β β β βββ endpoints/
β β β βββ rigging.py # POST /api/v1/rigging/process
β β βββ core/ # Settings, configuration
β β βββ services/
β β βββ ml_service.py # TensorFlow model inference
β β βββ blender_service.py # Blender subprocess orchestration
β βββ blender_scripts/
β β βββ common/ # Shared utilities
β β β βββ blender_utils.py
β β β βββ fitting_utils.py
β β β βββ mesh_processing.py
β β β βββ mesh_utils.py
β β β βββ profile_analysis.py
β β βββ humanoid/
β β β βββ analyzer.py # Pose detection, proportion analysis
β β β βββ rigging.py # Humanoid skeleton generation & fitting
β β βββ quadruped/
β β β βββ analyzer.py # Body segment analysis
β β β βββ rigging.py # Quadruped skeleton generation & fitting
β β βββ tools/
β β βββ take_renders.py # Multi-angle rendering script
β β βββ run_rigging.py # Rigging orchestrator
β β βββ geodesic_skinning.py # Advanced weight painting
β β βββ inspect_rig.py # Debug/inspection utility
β βββ public/ # Served static files (processed models)
β
βββ blender/ # Standalone Blender utilities
β βββ scripts/
β β βββ render_dataset.py # Batch render script for dataset creation
β β βββ export_all.py # Batch export utility
β βββ add-ons/ # Custom Blender add-ons
β
βββ ml_pipeline/ # Machine learning training
β βββ notebooks/
β β βββ model_train.ipynb # EfficientNetB0 training notebook
β β βββ test.ipynb # Model evaluation & testing
β βββ saved_models/ # Exported .keras model files
β
βββ dataset/ # Training data
β βββ models/ # Raw 3D models (organized by class)
β βββ renders/ # Multi-angle renders for training
β βββ test_renders/ # Test set renders
β
βββ RIGGING_PIPELINE.md # In-depth technical documentation
βββ TODOS.md # Development roadmap & progress
βββ README.md # β You are here
Accepts a 3D model file and returns a rigged version.
Request:
Content-Type: multipart/form-data
file: <.obj or .fbx file>
Response:
{
"status": "success",
"classification": "humanoid",
"confidence": 0.97,
"output_file": "/public/results/<id>/rigged_model.glb"
}Pipeline Steps (server-side):
- Save uploaded file β
public/uploads/ - Render silhouettes via Blender subprocess
- Classify renders via TensorFlow
- Run appropriate rigging script via Blender subprocess
- Return rigged
.glbpath
Redirects to Swagger UI documentation at /docs.
The landing page features an interactive 3D experience built with React Three Fiber and GSAP:
- Scroll-driven model animation β The 3D model moves, rotates, and scales based on scroll position with configurable breakpoint-specific values
- Dissolve effect β Custom shader-based morph transition between humanoid and quadruped models in the Classification section
- Skeleton visualization β 3D bone meshes rendered on top of the model in the Download section with emissive cyan material
- Smooth scrolling β Lenis-powered buttery smooth scroll with GSAP ScrollTrigger integration
- Responsive configs β Separate animation values for desktop (>1024px), tablet (768β1024px), and mobile (<768px)
- Loading screen β Animated overlay that displays while 3D assets are loading
This project is open source under the MIT License.
Built with β€οΈ by zamazincode