Skip to content
AlbaditPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Live Mocap - Real-Time Motion Capture for Blender

Blender 3.6+ Python 3.10+ MediaPipe OpenCV MIT License

Real-time webcam-based motion capture for Blender using MediaPipe and OpenCV

Transform your webcam into a motion capture studio! Live Mocap captures your body movements in real-time and retargets them to any Blender armature β€” no expensive suits or sensors required.


✨ Features

  • πŸŽ₯ Real-Time Capture β€” Non-blocking, live motion tracking at 30 FPS
  • 🦴 Auto Bone Mapping β€” Automatic detection for Rigify, Unity, and common rigs
  • πŸ’Ύ Save/Load Mappings β€” Reuse bone configurations across projects
  • 🎚️ Smoothing Filters β€” EWMA smoothing for natural, jitter-free motion
  • πŸ“Š Confidence Gating β€” Reject low-quality tracking data automatically
  • 🦢 Foot Lock Filter β€” Reduce foot sliding in animations
  • ⏺️ Live Recording β€” Insert keyframes in real-time
  • 🎬 Bake to Action β€” Export captured motion as reusable Actions
  • πŸ“· Camera Feed Overlay β€” Optional viewport preview of webcam feed
  • πŸ”§ Modular Design β€” Easy to extend and customize

πŸ“¦ Installation

Prerequisites

  • Blender 3.6 or higher (4.x recommended)
  • Webcam (built-in or USB)

Step 1: Install Python Dependencies

Open a terminal/command prompt and navigate to Blender's Python directory:

Windows:

cd "C:\Program Files\Blender Foundation\Blender 4.x\4.x\python\bin"
python.exe -m pip install opencv-python mediapipe

macOS:

cd /Applications/Blender.app/Contents/Resources/4.x/python/bin
./python3.11 -m pip install opencv-python mediapipe

Linux:

cd /path/to/blender/4.x/python/bin
./python3.11 -m pip install opencv-python mediapipe

Step 2: Install the Add-on

Option A: Install as Folder (Recommended for Development)

  1. Copy the live_mocap_addon folder to your Blender add-ons directory:

    • Windows: %APPDATA%\Blender Foundation\Blender\4.x\scripts\addons\
    • macOS: ~/Library/Application Support/Blender/4.x/scripts/addons/
    • Linux: ~/.config/blender/4.x/scripts/addons/
  2. Restart Blender

Option B: Install as ZIP

  1. Zip the live_mocap_addon folder
  2. In Blender: Edit β†’ Preferences β†’ Add-ons β†’ Install
  3. Select the .zip file
  4. Restart Blender

Step 3: Enable the Add-on

  1. Go to Edit β†’ Preferences β†’ Add-ons
  2. Search for "Live Mocap"
  3. Enable Animation: Live Mocap

πŸš€ Quick Start

1. Open the Panel

  • In the 3D Viewport, press N to open the sidebar
  • Click the Mocap tab

2. Set Up Your Rig

  • Select your armature in the scene
  • Click Select Target in the Mocap panel
  • Click Auto-Fill Bone Map to automatically map landmarks to bones

3. Start Capturing

  • Click Start Capture
  • Your webcam will activate and your character will mirror your movements!

4. Record Animation

  • Click Start Recording to insert keyframes
  • Perform your movements
  • Click Stop Recording when done
  • Click Bake to Action to create a reusable Action

πŸŽ›οΈ Panel Overview

Section Description
Target Select armature, adjust scale and offset
Bone Mapping Configure landmark β†’ bone assignments
Capture Camera settings, FPS, module toggles
Record Start/stop keyframing, bake to Action
Filters Smoothing, confidence threshold, foot lock
Utilities Reset pose, help dialog, dependency check

🦴 Bone Mapping

Auto-Mapping

Works out of the box with:

  • Rigify rigs
  • Unity Humanoid rigs
  • Standard naming conventions (spine, arm, leg, etc.)

Manual Mapping

  1. Click + to add a mapping
  2. Select a MediaPipe landmark (e.g., LEFT_SHOULDER)
  3. Select the target bone
  4. Enable the checkbox to activate

Save/Load Mappings

  • Save Map: Export your bone configuration as JSON
  • Load Map: Import a saved configuration

βš™οΈ Settings & Filters

Capture Settings

Setting Default Description
Camera Index 0 Webcam device number
Target FPS 30 Capture frame rate
Pose Module βœ“ Enable body tracking
Hands Module βœ— Enable hand tracking
Face Module βœ— Enable face tracking

Filters

Filter Default Description
Smoothing 0.5 EWMA smoothing factor (0 = no smoothing, 1 = max)
Confidence 0.5 Minimum confidence threshold
Foot Lock βœ“ Reduce foot sliding artifacts

πŸ“ Project Structure

live_mocap_addon/
β”œβ”€β”€ __init__.py           # Blender add-on entry point
β”œβ”€β”€ addon_prefs.py        # User preferences
β”œβ”€β”€ properties.py         # Data models (PropertyGroups)
β”‚
β”œβ”€β”€ operators/            # User actions (15 operators)
β”‚   β”œβ”€β”€ capture_start.py  # ⭐ Main modal operator
β”‚   β”œβ”€β”€ autofill_map.py   # Auto bone mapping
β”‚   β”œβ”€β”€ record_start.py   # Start keyframing
β”‚   └── ...
β”‚
β”œβ”€β”€ panels/               # UI components
β”‚   β”œβ”€β”€ main.py           # Main N-panel
β”‚   └── ...
β”‚
β”œβ”€β”€ runtime/              # Live capture systems
β”‚   β”œβ”€β”€ capture.py        # OpenCV camera
β”‚   β”œβ”€β”€ trackers.py       # MediaPipe tracking
β”‚   β”œβ”€β”€ retarget.py       # Landmark β†’ bone math
β”‚   β”œβ”€β”€ filters.py        # Smoothing, confidence, foot lock
β”‚   └── ...
β”‚
β”œβ”€β”€ io/                   # File operations
β”‚   β”œβ”€β”€ json_maps.py      # Save/load bone mappings
β”‚   └── export.py         # FBX export
β”‚
└── utils/                # Shared utilities
    β”œβ”€β”€ coords.py         # Coordinate transforms
    └── naming.py         # Bone name matching

πŸ”§ Troubleshooting

Dependencies Not Found

  1. Click Help / Dependency Check in the panel
  2. If OpenCV or MediaPipe shows βœ—, reinstall using the commands above
  3. Make sure you're using Blender's bundled Python, not system Python

Camera Not Opening

  • Check that no other application is using the webcam
  • Try a different camera index (0, 1, 2...)
  • Verify camera permissions (especially on macOS)

Tracking Quality Issues

  • Ensure good lighting (natural light works best)
  • Stand back so your full body is visible
  • Wear contrasting colors against your background
  • Increase smoothing factor for jittery motion

Performance Issues

  • Lower target FPS to 24 or 20
  • Disable unused modules (hands, face)
  • Close other resource-intensive applications

🎯 Use Cases

  • Animation Pre-viz β€” Quick blocking and movement reference
  • Indie Game Dev β€” Affordable motion capture for characters
  • Education β€” Learn animation and rigging concepts
  • Content Creation β€” VTuber-style live animation
  • Prototyping β€” Rapidly test animation ideas

πŸ—ΊοΈ Roadmap

  • Multi-person tracking
  • Hand gesture recognition
  • Facial expression capture
  • IK solving integration
  • Video file input (not just webcam)
  • Motion retargeting presets

πŸ“š Documentation

Document Description
QUICKSTART.md 10-minute setup guide
STRUCTURE.md Code architecture
DEVELOPMENT.md Developer guide
PROJECT_OVERVIEW.md Complete project overview

🀝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See DEVELOPMENT.md for extension points and code guidelines.


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ™ Acknowledgments

  • MediaPipe β€” Google's ML framework for real-time pose detection
  • OpenCV β€” Open source computer vision library
  • Blender β€” The free and open-source 3D creation suite
  • Rokoko Studio Live β€” Inspiration for plugin architecture

Built with ❀️ for the Blender community
Happy Motion Capturing! 🎬✨

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages