A production-ready gesture recognition system that enables intuitive control of Blender's 3D viewport through hand gestures. Built with MediaPipe for robust hand tracking and featuring platform-specific optimizations for macOS, Linux, and Windows.
- π― 4 Core Gestures - Pinch, V-gesture, Open Palm, Closed Fist
- π Viewport Control - Rotate and pan Blender's 3D viewport naturally
- π¬ Animation Control - Play/stop timeline with hand gestures
- π₯οΈ Cross-Platform - Optimized for macOS (main-thread), Linux/Windows (threaded)
- β‘ Low Latency - Real-time processing with smoothing filters
- ποΈ Configurable - YAML-based configuration for sensitivity and mappings
# Python 3.8 or higher
python --version
# Install dependencies
pip install -r requirements.txt1. Start the gesture engine:
python main_orchestrator.py --config config/blender_mode.yaml --debug2. In Blender:
- Install the addon from
blender_addon/gesture_control_addon.py - Enable "Gesture Control Center" in Preferences β Add-ons
- Open the sidebar (N key) β Gesture tab
- Click "Connect Only" to link with the running engine
3. Control Blender with gestures!
The system recognizes 4 core hand gestures for Blender control:
| Gesture | Description | Action |
|---|---|---|
| π€ Pinch | Thumb + index finger touching | Rotate viewport - Move hand while pinching to orbit camera |
| βοΈ V-Gesture | Index + middle fingers extended | Pan viewport - Move hand to pan camera position |
| ποΈ Open Palm | All fingers extended | Play animation - Start timeline playback |
| β Closed Fist | All fingers closed | Stop animation - Pause timeline |
Pinch (Rotation Mode)
- Pinch thumb and index finger together
- Move your hand to rotate the viewport
- Automatic orbit around scene center
- Release to exit rotation mode
V-Gesture (Navigation Mode)
- Extend index and middle fingers (peace sign)
- Keep ring and pinky fingers closed
- Move your hand to pan the viewport
- Release to exit navigation mode
Animation Control
- Open palm to start playback
- Closed fist to stop
- Works independently of viewport modes
βββββββββββββββ
β Camera β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββ
β MediaPipe β
β Hand Tracking β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Gesture β
β Detector β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Filters & β
β Validators β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Event Bus β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Gesture β
β Handlers β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Blender Output β
β (Socket) β
ββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββ
β Blender Addon β
β (Viewport) β
βββββββββββββββββββ
Gesture Detection (gestures/)
- MediaPipe-based hand landmark tracking
- Confidence validation and quality checks
- Smoothing filters for stable detection
Event System (core/)
- Central EventBus for message routing
- Type-safe event handling
- Modular handler registration
Handlers (handlers/)
blender_viewport_handler.py- Viewport rotation and panningblender_animation_handler.py- Timeline control- Configurable sensitivity and behavior
Blender Integration (blender_addon/)
- Socket-based communication (port 8888)
- Real-time viewport manipulation
- Simplified rotation and pan functions
Edit config/blender_mode.yaml to customize behavior:
# Gesture detection settings
inputs:
gesture:
enabled: true
camera_index: 0
show_preview: true
min_confidence: 0.6
filter_window: 3
# Blender output
outputs:
blender:
enabled: true
host: localhost
port: 8888In the Blender addon panel, adjust:
- Rotation Sensitivity - Controls viewport rotation speed (default: 0.5)
- Pan Sensitivity - Controls viewport panning speed (default: 0.1)
lauzhack2025/
βββ config/ # YAML configuration files
βββ core/ # Event system and orchestration
β βββ event_system.py # EventBus implementation
β βββ gesture_handler.py # Handler base classes
β βββ launcher.py # Application launcher
βββ gestures/ # Gesture recognition
β βββ detector.py # Main detection engine
β βββ filters.py # Smoothing filters
β βββ validators.py # Quality validation
β βββ library/
β βββ navigation.py # Core gesture definitions
βββ handlers/ # Gesture handlers
β βββ blender_viewport_handler.py
β βββ blender_animation_handler.py
βββ inputs/ # Input modules
β βββ gesture_input_production.py
βββ outputs/ # Output modules
β βββ blender_output.py # Blender socket communication
βββ blender_addon/ # Blender addon
β βββ gesture_control_addon.py
βββ main_orchestrator.py # Main entry point
βββ requirements.txt # Python dependencies
- Main-thread camera mode - Required for camera permissions
- Camera window displays in foreground
- Launched via Terminal.app for proper access
- Threaded camera mode - Background processing
- Standard OpenCV camera access
- Preview window optional
The system automatically detects your platform and uses the appropriate mode.
Camera doesn't open?
- Check camera permissions in System Preferences (macOS)
- Try a different camera:
--camera-index 1 - Ensure no other app is using the camera
Gestures not detected?
- Improve lighting conditions
- Position hand clearly in frame
- Adjust
min_confidencein config (lower = more sensitive) - Check debug output with
--debugflag
Blender not responding?
- Verify addon is installed and enabled
- Check port 8888 is available:
lsof -i :8888 - Ensure "Connect Only" button was clicked in Blender
- Check Blender's system console for errors
Viewport movement too fast/slow?
- Adjust sensitivity in Blender addon panel
- Modify
sensitivityin handler config - Fine-tune in real-time without restarting
# Run all tests
python -m pytest tests/ -v
# Test specific components
python -m pytest tests/test_gestures.py
python -m pytest tests/test_handler_system.py- Define gesture in
gestures/library/navigation.py:
@register("navigation")
class MyGesture(Gesture):
@property
def name(self) -> str:
return "MY_GESTURE"
def detect(self, landmarks, context):
# Detection logic
return GestureResult(name=self.name, confidence=0.9)- Add handler in
handlers/ - Configure mapping in YAML
Gesture Detection Pipeline:
- MediaPipe extracts hand landmarks (21 points per hand)
- Landmarks filtered through smoothing window (reduces jitter)
- Quality validator checks landmark visibility and confidence
- Gesture detector matches against registered patterns
- Confidence validator ensures stable detection
- Event published to EventBus
- Handlers process and route to outputs
Movement Tracking:
- Pinch: Tracks midpoint of thumb/index, calculates deltas
- V-Gesture: Tracks midpoint of index/middle, applies smoothing
- Sensitivity multipliers: Rotation (20x), Navigation (150x)
- Deadzone filtering to ignore micro-movements
mediapipe>=0.10.0
opencv-python>=4.8.0
PyYAML>=6.0
numpy>=1.24.0
MIT License - See LICENSE file for details.
Built for LauzHack 2025
Made with β€οΈ by the gesture control team
