ohao 0.1.0__tar.gz

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.
ohao-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OhaoTech
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ohao-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.4
2
+ Name: ohao
3
+ Version: 0.1.0
4
+ Summary: Retarget animations onto any humanoid character — CLI & Python SDK for game developers
5
+ Author: OhaoTech
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://mogen3d.ohao.tech
8
+ Project-URL: Documentation, https://github.com/OhaoTech/ohao-sdk#readme
9
+ Project-URL: Repository, https://github.com/OhaoTech/ohao-sdk
10
+ Project-URL: Issues, https://github.com/OhaoTech/ohao-sdk/issues
11
+ Keywords: motion-capture,mocap,bvh,fbx,retarget,blender,game-dev,animation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
20
+ Classifier: Topic :: Games/Entertainment
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: httpx>=0.24.0
25
+ Requires-Dist: click>=8.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: pytest-httpx; extra == "dev"
29
+ Requires-Dist: ruff; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ <p align="center">
33
+ <img src="https://raw.githubusercontent.com/OhaoTech/ohao-sdk/master/logo.png" alt="ohao" width="80" />
34
+ </p>
35
+
36
+ <h1 align="center">ohao</h1>
37
+
38
+ <p align="center">
39
+ <strong>Retarget animations onto any humanoid character</strong><br>
40
+ CLI & Python SDK for game developers
41
+ </p>
42
+
43
+ <p align="center">
44
+ <a href="https://github.com/OhaoTech/ohao-sdk/actions"><img src="https://img.shields.io/github/actions/workflow/status/OhaoTech/ohao-sdk/test.yml?style=flat-square" alt="CI"></a>
45
+ <a href="https://pypi.org/project/ohao/"><img src="https://img.shields.io/pypi/v/ohao?style=flat-square&color=blue" alt="PyPI"></a>
46
+ <a href="https://pypi.org/project/ohao/"><img src="https://img.shields.io/pypi/pyversions/ohao?style=flat-square" alt="Python"></a>
47
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/OhaoTech/ohao-sdk?style=flat-square" alt="License"></a>
48
+ </p>
49
+
50
+ ---
51
+
52
+ **ohao** retargets BVH / FBX animations onto your characters — Mixamo, UE5 Mannequin, or any humanoid rig.
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ pip install ohao
58
+ ```
59
+
60
+ > Retargeting requires [Blender](https://www.blender.org/download/) (3.6+) installed locally.
61
+
62
+ ## Quick Start
63
+
64
+ ### Python
65
+
66
+ ```python
67
+ from ohao.mogen3d import retarget
68
+
69
+ retarget("dance.bvh", "MyCharacter.fbx")
70
+ ```
71
+
72
+ ### CLI
73
+
74
+ ```bash
75
+ ohao mogen3d retarget dance.bvh MyCharacter.fbx --preset mixamo
76
+ ```
77
+
78
+ ## Retargeting
79
+
80
+ The SDK auto-detects your character's rig type and maps bones automatically.
81
+
82
+ | Rig Type | Detection | Characters |
83
+ |----------|-----------|------------|
84
+ | **Mixamo** | `Hips` bone (with optional prefix like `mixamorig:`) | X Bot, Y Bot, any Mixamo character |
85
+ | **UE5 Mannequin** | `pelvis` bone | Quinn, Manny, Quaternius models |
86
+
87
+ ```python
88
+ # Auto-detect (works for most characters)
89
+ retarget("dance.bvh", "XBot.fbx")
90
+
91
+ # Explicit preset
92
+ retarget("dance.bvh", "Quinn.gltf", preset="ue5")
93
+
94
+ # Custom Blender path
95
+ retarget("dance.bvh", "MyChar.fbx", blender_path="/path/to/blender")
96
+
97
+ # Open in Blender GUI to inspect
98
+ retarget("dance.bvh", "MyChar.fbx", background=False)
99
+ ```
100
+
101
+ ### Supported Formats
102
+
103
+ | Input | Output |
104
+ |-------|--------|
105
+ | Animation: `.bvh`, `.fbx` | Retargeted `.blend` file |
106
+ | Character: `.fbx`, `.glb`, `.gltf` | |
107
+
108
+ ## API Reference
109
+
110
+ ### `retarget()`
111
+
112
+ ```python
113
+ retarget(
114
+ bvh_path, # Path to BVH file
115
+ character_path, # Path to character (.fbx / .glb / .gltf)
116
+ *,
117
+ output_path=None, # Output .blend path (default: auto-named)
118
+ preset=None, # "mixamo", "ue5", or path to JSON
119
+ blender_path=None, # Blender executable (default: auto-detect)
120
+ background=True, # Run headless (default: True)
121
+ )
122
+ ```
123
+
124
+ ## Examples
125
+
126
+ See the [`examples/`](examples/) directory for runnable scripts:
127
+
128
+ | Example | Description |
129
+ |---------|-------------|
130
+ | [`basic_retarget.py`](examples/basic_retarget.py) | Minimal one-liner retarget |
131
+ | [`batch_retarget.py`](examples/batch_retarget.py) | Apply one BVH to a folder of characters |
132
+ | [`retarget_with_preset.py`](examples/retarget_with_preset.py) | Force a specific rig preset |
133
+ | [`inspect_in_blender.py`](examples/inspect_in_blender.py) | Open result in Blender GUI |
134
+ | [`custom_blender_path.py`](examples/custom_blender_path.py) | Use a specific Blender install |
135
+
136
+ ## Adding a Custom Rig Preset
137
+
138
+ If your character uses a non-standard skeleton, create a JSON preset:
139
+
140
+ ```json
141
+ {
142
+ "name": "My Rig",
143
+ "bone_map": {
144
+ "Hips": "my_pelvis",
145
+ "Spine": "my_spine_01",
146
+ "Head": "my_head",
147
+ "LeftArm": "my_upper_arm_L",
148
+ "LeftForeArm": "my_lower_arm_L",
149
+ "RightArm": "my_upper_arm_R",
150
+ "RightForeArm": "my_lower_arm_R",
151
+ "LeftUpLeg": "my_thigh_L",
152
+ "LeftLeg": "my_shin_L",
153
+ "RightUpLeg": "my_thigh_R",
154
+ "RightLeg": "my_shin_R"
155
+ },
156
+ "root_bone": "Hips"
157
+ }
158
+ ```
159
+
160
+ Keys on the left are the BVH bone names. Values on the right are your character's bone names. Then pass it:
161
+
162
+ ```python
163
+ retarget("dance.bvh", "MyRig.fbx", preset="my_rig.json")
164
+ ```
165
+
166
+ ```bash
167
+ ohao mogen3d retarget dance.bvh MyRig.fbx --preset my_rig.json
168
+ ```
169
+
170
+ ## License
171
+
172
+ MIT
ohao-0.1.0/README.md ADDED
@@ -0,0 +1,141 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/OhaoTech/ohao-sdk/master/logo.png" alt="ohao" width="80" />
3
+ </p>
4
+
5
+ <h1 align="center">ohao</h1>
6
+
7
+ <p align="center">
8
+ <strong>Retarget animations onto any humanoid character</strong><br>
9
+ CLI & Python SDK for game developers
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://github.com/OhaoTech/ohao-sdk/actions"><img src="https://img.shields.io/github/actions/workflow/status/OhaoTech/ohao-sdk/test.yml?style=flat-square" alt="CI"></a>
14
+ <a href="https://pypi.org/project/ohao/"><img src="https://img.shields.io/pypi/v/ohao?style=flat-square&color=blue" alt="PyPI"></a>
15
+ <a href="https://pypi.org/project/ohao/"><img src="https://img.shields.io/pypi/pyversions/ohao?style=flat-square" alt="Python"></a>
16
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/OhaoTech/ohao-sdk?style=flat-square" alt="License"></a>
17
+ </p>
18
+
19
+ ---
20
+
21
+ **ohao** retargets BVH / FBX animations onto your characters — Mixamo, UE5 Mannequin, or any humanoid rig.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install ohao
27
+ ```
28
+
29
+ > Retargeting requires [Blender](https://www.blender.org/download/) (3.6+) installed locally.
30
+
31
+ ## Quick Start
32
+
33
+ ### Python
34
+
35
+ ```python
36
+ from ohao.mogen3d import retarget
37
+
38
+ retarget("dance.bvh", "MyCharacter.fbx")
39
+ ```
40
+
41
+ ### CLI
42
+
43
+ ```bash
44
+ ohao mogen3d retarget dance.bvh MyCharacter.fbx --preset mixamo
45
+ ```
46
+
47
+ ## Retargeting
48
+
49
+ The SDK auto-detects your character's rig type and maps bones automatically.
50
+
51
+ | Rig Type | Detection | Characters |
52
+ |----------|-----------|------------|
53
+ | **Mixamo** | `Hips` bone (with optional prefix like `mixamorig:`) | X Bot, Y Bot, any Mixamo character |
54
+ | **UE5 Mannequin** | `pelvis` bone | Quinn, Manny, Quaternius models |
55
+
56
+ ```python
57
+ # Auto-detect (works for most characters)
58
+ retarget("dance.bvh", "XBot.fbx")
59
+
60
+ # Explicit preset
61
+ retarget("dance.bvh", "Quinn.gltf", preset="ue5")
62
+
63
+ # Custom Blender path
64
+ retarget("dance.bvh", "MyChar.fbx", blender_path="/path/to/blender")
65
+
66
+ # Open in Blender GUI to inspect
67
+ retarget("dance.bvh", "MyChar.fbx", background=False)
68
+ ```
69
+
70
+ ### Supported Formats
71
+
72
+ | Input | Output |
73
+ |-------|--------|
74
+ | Animation: `.bvh`, `.fbx` | Retargeted `.blend` file |
75
+ | Character: `.fbx`, `.glb`, `.gltf` | |
76
+
77
+ ## API Reference
78
+
79
+ ### `retarget()`
80
+
81
+ ```python
82
+ retarget(
83
+ bvh_path, # Path to BVH file
84
+ character_path, # Path to character (.fbx / .glb / .gltf)
85
+ *,
86
+ output_path=None, # Output .blend path (default: auto-named)
87
+ preset=None, # "mixamo", "ue5", or path to JSON
88
+ blender_path=None, # Blender executable (default: auto-detect)
89
+ background=True, # Run headless (default: True)
90
+ )
91
+ ```
92
+
93
+ ## Examples
94
+
95
+ See the [`examples/`](examples/) directory for runnable scripts:
96
+
97
+ | Example | Description |
98
+ |---------|-------------|
99
+ | [`basic_retarget.py`](examples/basic_retarget.py) | Minimal one-liner retarget |
100
+ | [`batch_retarget.py`](examples/batch_retarget.py) | Apply one BVH to a folder of characters |
101
+ | [`retarget_with_preset.py`](examples/retarget_with_preset.py) | Force a specific rig preset |
102
+ | [`inspect_in_blender.py`](examples/inspect_in_blender.py) | Open result in Blender GUI |
103
+ | [`custom_blender_path.py`](examples/custom_blender_path.py) | Use a specific Blender install |
104
+
105
+ ## Adding a Custom Rig Preset
106
+
107
+ If your character uses a non-standard skeleton, create a JSON preset:
108
+
109
+ ```json
110
+ {
111
+ "name": "My Rig",
112
+ "bone_map": {
113
+ "Hips": "my_pelvis",
114
+ "Spine": "my_spine_01",
115
+ "Head": "my_head",
116
+ "LeftArm": "my_upper_arm_L",
117
+ "LeftForeArm": "my_lower_arm_L",
118
+ "RightArm": "my_upper_arm_R",
119
+ "RightForeArm": "my_lower_arm_R",
120
+ "LeftUpLeg": "my_thigh_L",
121
+ "LeftLeg": "my_shin_L",
122
+ "RightUpLeg": "my_thigh_R",
123
+ "RightLeg": "my_shin_R"
124
+ },
125
+ "root_bone": "Hips"
126
+ }
127
+ ```
128
+
129
+ Keys on the left are the BVH bone names. Values on the right are your character's bone names. Then pass it:
130
+
131
+ ```python
132
+ retarget("dance.bvh", "MyRig.fbx", preset="my_rig.json")
133
+ ```
134
+
135
+ ```bash
136
+ ohao mogen3d retarget dance.bvh MyRig.fbx --preset my_rig.json
137
+ ```
138
+
139
+ ## License
140
+
141
+ MIT
@@ -0,0 +1,47 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ohao"
7
+ version = "0.1.0"
8
+ description = "Retarget animations onto any humanoid character — CLI & Python SDK for game developers"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{ name = "OhaoTech" }]
13
+ keywords = ["motion-capture", "mocap", "bvh", "fbx", "retarget", "blender", "game-dev", "animation"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Multimedia :: Graphics :: 3D Modeling",
23
+ "Topic :: Games/Entertainment",
24
+ ]
25
+ dependencies = [
26
+ "httpx>=0.24.0",
27
+ "click>=8.0",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ dev = ["pytest", "pytest-httpx", "ruff"]
32
+
33
+ [project.scripts]
34
+ ohao = "ohao._cli:main"
35
+
36
+ [project.urls]
37
+ Homepage = "https://mogen3d.ohao.tech"
38
+ Documentation = "https://github.com/OhaoTech/ohao-sdk#readme"
39
+ Repository = "https://github.com/OhaoTech/ohao-sdk"
40
+ Issues = "https://github.com/OhaoTech/ohao-sdk/issues"
41
+
42
+ [tool.setuptools.packages.find]
43
+ where = ["src"]
44
+
45
+ [tool.setuptools.package-data]
46
+ "ohao.mogen3d.presets" = ["*.json"]
47
+ "ohao.mogen3d" = ["_blender_script.py"]
ohao-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """ohao — CLI & SDK for game developers."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,68 @@
1
+ """ohao CLI — entry point for all ohao tools."""
2
+
3
+ import click
4
+
5
+
6
+ @click.group()
7
+ @click.version_option(package_name="ohao")
8
+ def main():
9
+ """ohao — CLI & SDK for game developers."""
10
+
11
+
12
+ @main.group()
13
+ def mogen3d():
14
+ """Motion capture: video -> BVH/FBX."""
15
+
16
+
17
+ @mogen3d.command()
18
+ @click.argument("video_path", type=click.Path(exists=True))
19
+ @click.option("--api-key", envvar="OHAO_API_KEY", required=True, help="MoGen3D API key (or set OHAO_API_KEY).")
20
+ @click.option("--pipeline", type=click.Choice(["2d", "3d"]), default="2d", help="Processing pipeline.")
21
+ @click.option("--fps", type=int, default=30, help="Output FPS.")
22
+ @click.option("--format", "fmt", type=click.Choice(["bvh", "fbx", "json"]), default="bvh", help="Download format.")
23
+ @click.option("--output", "-o", type=click.Path(), default=None, help="Output file path.")
24
+ @click.option("--base-url", envvar="OHAO_BASE_URL", default=None, help="API base URL override.")
25
+ def process(video_path, api_key, pipeline, fps, fmt, output, base_url):
26
+ """Upload a video, process it, and download the result."""
27
+ from ohao.mogen3d.client import MoGen3DClient
28
+
29
+ kwargs = {"api_key": api_key}
30
+ if base_url:
31
+ kwargs["base_url"] = base_url
32
+
33
+ with MoGen3DClient(**kwargs) as client:
34
+ click.echo(f"Uploading {video_path}...")
35
+ job = client.upload(video_path, pipeline=pipeline, fps=fps)
36
+ click.echo(f"Job {job.id} created. Waiting for completion...")
37
+
38
+ job = job.wait()
39
+ if job.status == "failed":
40
+ click.echo(f"Job failed: {job.error}", err=True)
41
+ raise SystemExit(1)
42
+
43
+ click.echo(f"Done! {job.frames} frames extracted.")
44
+ path = job.download(format=fmt, output_path=output)
45
+ click.echo(f"Saved to {path}")
46
+
47
+
48
+ @mogen3d.command()
49
+ @click.argument("bvh_path", type=click.Path(exists=True))
50
+ @click.argument("character_path", type=click.Path(exists=True))
51
+ @click.option("--output", "-o", type=click.Path(), default=None, help="Output .blend file path.")
52
+ @click.option("--preset", type=str, default=None, help="Rig preset: 'mixamo', 'ue5', or path to JSON.")
53
+ @click.option("--blender", type=click.Path(), default=None, help="Path to Blender executable.")
54
+ @click.option("--gui", is_flag=True, help="Open Blender with GUI (default: background mode).")
55
+ def retarget(bvh_path, character_path, output, preset, blender, gui):
56
+ """Retarget a BVH animation onto a character model using Blender."""
57
+ from ohao.mogen3d.retarget import retarget as do_retarget
58
+
59
+ click.echo(f"Retargeting {bvh_path} -> {character_path}...")
60
+ path = do_retarget(
61
+ bvh_path,
62
+ character_path,
63
+ output_path=output,
64
+ preset=preset,
65
+ blender_path=blender,
66
+ background=not gui,
67
+ )
68
+ click.echo(f"Saved to {path}")
@@ -0,0 +1,22 @@
1
+ """Shared exception hierarchy."""
2
+
3
+
4
+ class OhaoError(Exception):
5
+ """Base exception for ohao SDK."""
6
+
7
+
8
+ class MoGenError(OhaoError):
9
+ """Raised when the MoGen3D API returns an error."""
10
+
11
+ def __init__(self, status_code: int, detail: str):
12
+ self.status_code = status_code
13
+ self.detail = detail
14
+ super().__init__(f"HTTP {status_code}: {detail}")
15
+
16
+
17
+ class RetargetError(OhaoError):
18
+ """Raised when Blender retargeting fails."""
19
+
20
+
21
+ class BlenderNotFoundError(RetargetError):
22
+ """Raised when Blender executable cannot be found."""
@@ -0,0 +1,6 @@
1
+ """ohao.mogen3d — motion capture SDK."""
2
+
3
+ from ohao.mogen3d.client import MoGen3DClient
4
+ from ohao.mogen3d.retarget import retarget
5
+
6
+ __all__ = ["MoGen3DClient", "retarget"]