Skip to main content

Retarget animations onto any humanoid character — CLI & Python SDK for game developers

Project description

ohao

ohao

Process animations and retarget them onto any humanoid character
CLI & Python SDK for game developers

CI PyPI Python License


ohao is the SDK for MoGen3D — process videos into animation files (BVH / FBX) and retarget them onto your characters.

Install

pip install ohao

Retargeting requires Blender (3.6+) installed locally.

Quick Start

# Set your API key once
export OHAO_API_KEY=mg_your_key_here
from ohao.mogen3d import MoGen3DClient, retarget

client = MoGen3DClient(api_key="mg_your_key")

# Check sparks balance (each job costs 1 spark)
sparks = client.sparks()
print(f"{sparks.balance} sparks available")

# Claim daily free sparks
if sparks.can_claim:
    client.claim_sparks()

# Process a video → download BVH
job = client.process("dance.mp4", wait=True)
bvh = job.download(format="bvh")

# Retarget onto your character (runs locally via Blender)
retarget(str(bvh), "MyCharacter.fbx")

CLI

# Check balance & claim daily sparks
ohao mogen3d sparks
ohao mogen3d claim

# Process a video (costs 1 spark)
ohao mogen3d process dance.mp4 --format bvh -o dance.bvh

# Retarget onto a character (free, runs locally)
ohao mogen3d retarget dance.bvh MyCharacter.fbx --preset mixamo

# Account info
ohao mogen3d status
ohao mogen3d bundles

Sparks

Sparks are the credits that power processing jobs. 1 spark = 1 job. Retargeting is free (runs locally).

Free Pro
Daily sparks 1/day 15/day (accumulates up to 100)
Exports BVH BVH + FBX
Daily job limit 5 50

Need more? Purchase spark bundles:

Bundle Price
30 sparks $3.99
100 sparks $9.99
1,000 sparks $59.99
# Check available bundles
for bundle in client.bundles():
    print(f"{bundle.label}: {bundle.price}")

# Purchase (opens Stripe checkout)
url = client.purchase_bundle("sparks_100")

Sparks are refunded automatically if a job fails.

Retargeting

The SDK auto-detects your character's rig type and maps bones automatically.

Rig Type Detection Characters
Mixamo Hips bone (with optional prefix like mixamorig:) X Bot, Y Bot, any Mixamo character
UE5 Mannequin pelvis bone Quinn, Manny, Quaternius models
# Auto-detect (works for most characters)
retarget("dance.bvh", "XBot.fbx")

# Explicit preset
retarget("dance.bvh", "Quinn.gltf", preset="ue5")

# Custom Blender path
retarget("dance.bvh", "MyChar.fbx", blender_path="/path/to/blender")

# Open in Blender GUI to inspect
retarget("dance.bvh", "MyChar.fbx", background=False)

Supported Formats

Input Output
Video: .mp4, .mov, .webm .bvh, .fbx (via cloud processing)
Animation: .bvh, .fbx Retargeted .blend file (local)
Character: .fbx, .glb, .gltf

API Reference

MoGen3DClient

client = MoGen3DClient(api_key="mg_...", base_url="https://...")
Method Description
client.sparks() Get sparks balance and claim status
client.claim_sparks() Claim daily sparks
client.bundles() List purchasable spark bundles
client.purchase_bundle(id) Start Stripe checkout for a bundle
client.status() Account tier, usage, subscription info
client.process(path, *, wait=False) Upload video, start processing (1 spark)
client.list_jobs() List all jobs
client.get_job(id) Get job by ID
client.download(id, format="bvh") Download result file
client.delete_job(id) Delete a job

retarget()

retarget(
    bvh_path,            # Path to BVH file
    character_path,      # Path to character (.fbx / .glb / .gltf)
    *,
    output_path=None,    # Output .blend path (default: auto-named)
    preset=None,         # "mixamo", "ue5", or path to JSON
    blender_path=None,   # Blender executable (default: auto-detect)
    background=True,     # Run headless (default: True)
)

Examples

See the examples/ directory for runnable scripts:

Example Description
basic_retarget.py Minimal one-liner retarget
batch_retarget.py Apply one BVH to a folder of characters
retarget_with_preset.py Force a specific rig preset
inspect_in_blender.py Open result in Blender GUI
custom_blender_path.py Use a specific Blender install

Adding a Custom Rig Preset

If your character uses a non-standard skeleton, create a JSON preset:

{
  "name": "My Rig",
  "bone_map": {
    "Hips": "my_pelvis",
    "Spine": "my_spine_01",
    "Head": "my_head",
    "LeftArm": "my_upper_arm_L",
    "LeftForeArm": "my_lower_arm_L",
    "RightArm": "my_upper_arm_R",
    "RightForeArm": "my_lower_arm_R",
    "LeftUpLeg": "my_thigh_L",
    "LeftLeg": "my_shin_L",
    "RightUpLeg": "my_thigh_R",
    "RightLeg": "my_shin_R"
  },
  "root_bone": "Hips"
}

Keys on the left are the BVH bone names. Values on the right are your character's bone names. Then pass it:

retarget("dance.bvh", "MyRig.fbx", preset="my_rig.json")
ohao mogen3d retarget dance.bvh MyRig.fbx --preset my_rig.json

Environment Variables

Variable Description
OHAO_API_KEY API key (alternative to api_key= param)
OHAO_BASE_URL API base URL override

Get an API Key

  1. Go to mogen3d.ohao.tech
  2. Sign in and navigate to Settings > API Keys
  3. Create a new key (starts with mg_)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ohao-0.2.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ohao-0.2.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file ohao-0.2.0.tar.gz.

File metadata

  • Download URL: ohao-0.2.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ohao-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bd2e9fbef30bb55797f9762bc21cc78d9670d74c6474f7735b913c01f5ba0d7c
MD5 8a9439aaea8081b573fc5f7f1b4fd3a8
BLAKE2b-256 cd201630bcbf2a4b512117a7e926c871493773a49ca37e135598a39e9ccf3d09

See more details on using hashes here.

Provenance

The following attestation bundles were made for ohao-0.2.0.tar.gz:

Publisher: publish.yml on OhaoTech/ohao-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ohao-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ohao-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ohao-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 674f0a1ff7deebc3c1397419385b4f7dd9d6cf140a495e009f3d0a74de63fac8
MD5 d9862cc9d788fc9f2d5ccaf333de016d
BLAKE2b-256 45fff2f6f2929dbf34058fd009c974b384f02128933547028645327305c0c407

See more details on using hashes here.

Provenance

The following attestation bundles were made for ohao-0.2.0-py3-none-any.whl:

Publisher: publish.yml on OhaoTech/ohao-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page