Physics simulation and annotation tools for Blender
Project description
VibePhysics
A Blender physics simulation framework for creating realistic robot animations, rigid body physics, water dynamics, and comprehensive annotation (point cloud track, bounding box, motion trails, ...) tools.
Requirements
- Python 3.11 (required for bpy compatibility)
- bpy (Blender as a Python module)
Installation
# Create conda environment with Python 3.11
conda create -n vibephysics python=3.11
conda activate vibephysics
# Install bpy (Blender as Python module)
pip install bpy
# Install vibephysics
pip install vibephysics
# Or install from source
pip install -e .
Quick Start
# Run water simulation
python examples/water/water_float.py --output output/water_float.blend
# Run robot simulation
./run_robot.sh
# Run all simulations
./run_water.sh
Project Structure
vibephysics/
├── src/vibephysics/
│ ├── foundation/ # Core simulation modules
│ │ ├── physics.py # Rigid body world, force fields
│ │ ├── ground.py # Terrain generation
│ │ ├── water.py # Water surfaces, ripples
│ │ ├── objects.py # Floating objects
│ │ ├── materials.py # Shaders (water, mud, etc.)
│ │ ├── lighting.py # Lighting and camera
│ │ ├── open_duck.py # Open Duck robot integration
│ │ ├── trajectory.py # Waypoint paths
│ │ └── scene.py # Scene initialization
│ └── annotation/ # Visualization tools
│ ├── bbox.py # Bounding box annotations
│ ├── motion_trail.py # Motion path visualization
│ ├── point_tracking.py # Point cloud tracking
│ ├── viewport.py # Dual viewport setup
│ └── manager.py # Unified annotation API
├── examples/
│ ├── basics/ # Annotation demos
│ ├── water/ # Water simulations
│ └── robot/ # Robot simulations
├── run_water.sh # Run water examples
├── run_robot.sh # Run robot examples
└── run_annotation.sh # Run annotation demos
Examples
Water Simulations
# Floating objects
python examples/water/water_float.py --output output/water_float.blend
# Rising water
python examples/water/water_rise.py --output output/water_rise.blend
# Storm with debris
python examples/water/storm.py --output output/storm.blend
# Water puddles
python examples/water/water_puddles.py --output output/water_puddles.blend
Robot Simulations
# Robot walking through puddles
python examples/robot/robot_walking_water_puddle.py --output output/robot_walk.blend
# Duck following waypoints
python examples/robot/duck_waypoint_walk.py --waypoint-pattern exploration --output output/duck.blend
Annotation Demos
# Bounding boxes
python examples/basics/demo_bbox.py
# Motion trails
python examples/basics/demo_motion_trail.py
# Point tracking
python examples/basics/demo_point_tracking.py
# All annotations combined
python examples/basics/demo_all_annotations.py
Annotation System
VibePhysics includes a unified annotation system for visualizing simulations:
from vibephysics.annotation import AnnotationManager
mgr = AnnotationManager()
# Add bounding boxes
mgr.add_bbox(cube, color=(1.0, 0.0, 0.0, 1.0))
# Add motion trails
mgr.add_motion_trail(sphere, color=(0.0, 1.0, 0.0, 1.0))
# Add point tracking
mgr.add_point_tracking([cube, sphere], points_per_object=50)
# Finalize (registers handlers, creates scripts)
mgr.finalize()
Foundation Modules
physics.py - Core Physics
setup_rigid_body_world()- Initialize Bullet physicscreate_buoyancy_field()- Upward force for floatingcreate_underwater_currents()- Turbulence forces
water.py - Water Visuals
create_flat_surface()- Flat water planesetup_robot_water_interaction()- Ripple effects
objects.py - Objects
create_falling_spheres()- Physics-enabled spheresgenerate_scattered_positions()- Random non-overlapping positions
open_duck.py - Robot Integration
load_open_duck()- Load Open Duck robot modelanimate_duck_walking()- Walking animation along pathsetup_duck_collision()- Physics collision setup
Shell Scripts
# Run all water simulations
./run_water.sh
# Run robot simulations (auto-downloads Open Duck model)
./run_robot.sh
# Run annotation demos
./run_annotation.sh
Common Arguments
| Argument | Description |
|---|---|
--output |
Output .blend file path |
--start-frame |
Animation start frame |
--end-frame |
Animation end frame |
--num-spheres |
Number of floating objects |
--wave-scale |
Wave intensity |
--no-annotations |
Disable annotations |
License
AGPL-3.0 - See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vibephysics-0.1.0.tar.gz.
File metadata
- Download URL: vibephysics-0.1.0.tar.gz
- Upload date:
- Size: 59.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac988e398e71439ac9c4f33c4e22ba120337424926e617ba5e8dcf050f2e53df
|
|
| MD5 |
d717e30bae7ddf557fa877f758ff2d0b
|
|
| BLAKE2b-256 |
3ed4e05b9ce04147f76d2b4ecf6235b2bf86360cab60ad7b4c056645ec7e2e69
|
File details
Details for the file vibephysics-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vibephysics-0.1.0-py3-none-any.whl
- Upload date:
- Size: 67.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
540887fa8e3d82f4a2776acee8b2e1f50440d0ae24d15a39076c85046ea9bfb5
|
|
| MD5 |
0f2bbc6891616d06594d7c3e6b76097f
|
|
| BLAKE2b-256 |
6fd081e82738e1e11bd0d0a01707d3663e526d693bb33296e01b9a621af6dd1d
|