vibephysics 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ """
2
+ VibePhysics - Physics Simulation and Annotation Tools for Blender
3
+
4
+ A Python library for creating physics-based simulations in Blender,
5
+ with support for water dynamics, rigid body physics, robot animation,
6
+ and comprehensive annotation tools.
7
+
8
+ Usage:
9
+ from vibephysics import foundation, annotation
10
+
11
+ # Or import specific modules
12
+ from vibephysics.foundation import scene, physics, water
13
+ from vibephysics.annotation import AnnotationManager
14
+
15
+ Note: This package requires Blender 5.0's Python environment (bpy).
16
+ Run scripts through Blender:
17
+ blender -b -P your_script.py
18
+ """
19
+
20
+ __version__ = "0.1.0"
21
+ __author__ = "Your Name"
22
+
23
+ # Check if running inside Blender
24
+ def _check_blender_environment():
25
+ """Check if bpy is available and provide helpful error if not."""
26
+ try:
27
+ import bpy
28
+ return True
29
+ except ImportError:
30
+ import sys
31
+
32
+ error_message = """
33
+ ╔══════════════════════════════════════════════════════════════════════════════╗
34
+ ║ VibePhysics - Blender 5.0 Required ║
35
+ ╠══════════════════════════════════════════════════════════════════════════════╣
36
+ ║ This package requires Blender 5.0's Python environment (bpy module). ║
37
+ ║ ║
38
+ ║ ⚠️ You are running Python outside of Blender! ║
39
+ ║ ║
40
+ ║ To use vibephysics, run your scripts through Blender: ║
41
+ ║ ║
42
+ ║ # Run in background mode: ║
43
+ ║ blender -b -P your_script.py ║
44
+ ║ ║
45
+ ║ # Run with GUI: ║
46
+ ║ blender -P your_script.py ║
47
+ ║ ║
48
+ ║ # Pass arguments to your script: ║
49
+ ║ blender -b -P your_script.py -- --your-arg value ║
50
+ ║ ║
51
+ ╠══════════════════════════════════════════════════════════════════════════════╣
52
+ ║ REQUIREMENTS: ║
53
+ ║ • Blender 5.0 ║
54
+ ║ • Download: https://www.blender.org/download/ ║
55
+ ║ • Install guide: https://docs.blender.org/manual/en/latest/ ║
56
+ ║ getting_started/installing/ ║
57
+ ║ ║
58
+ ║ Verify Blender is installed: ║
59
+ ║ blender --version ║
60
+ ╚══════════════════════════════════════════════════════════════════════════════╝
61
+ """
62
+ print(error_message, file=sys.stderr)
63
+ raise ImportError(
64
+ "vibephysics requires Blender 5.0's Python environment. "
65
+ "Run your script with: blender -b -P your_script.py"
66
+ )
67
+
68
+ # Check environment before importing submodules
69
+ _check_blender_environment()
70
+
71
+ # Import subpackages for convenient access
72
+ from . import foundation
73
+ from . import annotation
74
+
75
+ # Quick access to commonly used classes
76
+ from .annotation import AnnotationManager, quick_annotate
77
+
78
+ __all__ = [
79
+ "__version__",
80
+ "foundation",
81
+ "annotation",
82
+ "AnnotationManager",
83
+ "quick_annotate",
84
+ ]
@@ -0,0 +1,139 @@
1
+ """
2
+ Annotation Utilities
3
+
4
+ Point tracking, bounding boxes, motion trails, and visualization tools
5
+ for annotating Blender simulations.
6
+
7
+ Unified API:
8
+ from annotation import manager
9
+ mgr = manager.AnnotationManager()
10
+ mgr.add_bbox(cube)
11
+ mgr.add_motion_trail(cube)
12
+ mgr.add_point_tracking([cube, sphere])
13
+ mgr.finalize()
14
+
15
+ Or use the quick API:
16
+ from annotation import manager
17
+ manager.quick_annotate([cube, sphere], bbox=True, trail=True)
18
+
19
+ Individual modules:
20
+ from annotation import bbox, motion_trail, point_tracking, viewport
21
+ """
22
+
23
+ # Base utilities (for extension)
24
+ from .base import (
25
+ DEFAULT_COLLECTION_NAME,
26
+ ensure_collection,
27
+ create_emission_material,
28
+ create_vertex_color_material,
29
+ register_frame_handler,
30
+ unregister_frame_handler,
31
+ create_embedded_script,
32
+ get_object_world_bounds,
33
+ get_evaluated_object,
34
+ get_depsgraph,
35
+ BaseAnnotation,
36
+ AnnotationType,
37
+ create_annotation,
38
+ # Tracking configuration
39
+ TrackingTarget,
40
+ TrackingConfig,
41
+ )
42
+
43
+ # Individual annotation modules
44
+ from .point_tracking import (
45
+ setup_point_tracking_visualization,
46
+ create_point_cloud_tracker,
47
+ register_frame_handler as register_point_tracking_handler,
48
+ create_embedded_tracking_script,
49
+ sample_mesh_surface_points,
50
+ generate_distinct_colors,
51
+ )
52
+
53
+ from .bbox import (
54
+ create_bbox_annotation,
55
+ update_bbox,
56
+ update_all_bboxes,
57
+ register as register_bbox,
58
+ create_embedded_bbox_script,
59
+ )
60
+
61
+ from .motion_trail import (
62
+ create_motion_trail,
63
+ create_motion_trails,
64
+ )
65
+
66
+ from .viewport import (
67
+ setup_dual_viewport,
68
+ split_viewport_horizontal,
69
+ configure_viewport_shading,
70
+ configure_viewport_overlays,
71
+ enter_local_view,
72
+ register_viewport_restore_handler,
73
+ create_viewport_restore_script,
74
+ )
75
+
76
+ # Manager (unified API)
77
+ from .manager import (
78
+ AnnotationManager,
79
+ get_manager,
80
+ reset_manager,
81
+ quick_annotate,
82
+ )
83
+
84
+ __all__ = [
85
+ # Constants
86
+ 'DEFAULT_COLLECTION_NAME',
87
+
88
+ # Base utilities
89
+ 'ensure_collection',
90
+ 'create_emission_material',
91
+ 'create_vertex_color_material',
92
+ 'register_frame_handler',
93
+ 'unregister_frame_handler',
94
+ 'create_embedded_script',
95
+ 'get_object_world_bounds',
96
+ 'get_evaluated_object',
97
+ 'get_depsgraph',
98
+ 'BaseAnnotation',
99
+ 'AnnotationType',
100
+ 'create_annotation',
101
+
102
+ # Tracking configuration
103
+ 'TrackingTarget',
104
+ 'TrackingConfig',
105
+
106
+ # BBox
107
+ 'create_bbox_annotation',
108
+ 'update_bbox',
109
+ 'update_all_bboxes',
110
+ 'register_bbox',
111
+ 'create_embedded_bbox_script',
112
+
113
+ # Motion Trail
114
+ 'create_motion_trail',
115
+ 'create_motion_trails',
116
+
117
+ # Point Tracking
118
+ 'setup_point_tracking_visualization',
119
+ 'create_point_cloud_tracker',
120
+ 'register_point_tracking_handler',
121
+ 'create_embedded_tracking_script',
122
+ 'sample_mesh_surface_points',
123
+ 'generate_distinct_colors',
124
+
125
+ # Viewport
126
+ 'setup_dual_viewport',
127
+ 'split_viewport_horizontal',
128
+ 'configure_viewport_shading',
129
+ 'configure_viewport_overlays',
130
+ 'enter_local_view',
131
+ 'register_viewport_restore_handler',
132
+ 'create_viewport_restore_script',
133
+
134
+ # Manager (unified API)
135
+ 'AnnotationManager',
136
+ 'get_manager',
137
+ 'reset_manager',
138
+ 'quick_annotate',
139
+ ]