Metadata-Version: 2.4
Name: rigyd-mujoco
Version: 1.0.0
Summary: Convert any 3D model, text prompt, or image into a physics-enabled MuJoCo (MJCF) asset with Rigyd, and load it straight into MuJoCo.
Author-email: Rigyd <hello@rigyd.com>
License: MIT
Project-URL: Homepage, https://rigyd.com
Project-URL: Repository, https://github.com/ARTLabs-Engineering/rigyd-mujoco
Keywords: rigyd,mujoco,mjcf,simready,robotics,simulation
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mujoco>=3.0
Dynamic: license-file

# rigyd-mujoco

Python SDK for [Rigyd](https://rigyd.com) that converts any **3D model, text
prompt, or image** into a physics-enabled **MuJoCo (MJCF)** asset and loads it
straight into MuJoCo as a `mujoco.MjModel`.

> Rigyd emits a complete MJCF package — `.xml` + per-material visual STLs + CoACD
> collision hulls + textures, with inertials, friction, a free joint and a ground
> plane — so this SDK is a thin API client + loader, not a converter.
>
> Note: MuJoCo has no asset-import *plugin* hook (engine plugins only add
> actuators/sensors/forces/SDF), so the idiomatic integration is this SDK, not a
> compiled plugin.

## Install

```bash
pip install rigyd-mujoco        # or, from a clone:  pip install -e .
export RIGYD_API_KEY=rgyd_live_xxx
```

## Use

```python
import rigyd
rigyd.configure()                                  # reads RIGYD_API_KEY

# one call: convert + wait + return a loaded model
model = rigyd.load_model(prompt="a wooden dining chair")     # text  (2 credits)
model = rigyd.load_model(images=["front.png"])               # image (3 credits)
model = rigyd.load_model(file="chair.glb",
                         target_triangle_count=50_000)        # 3D file (1 credit)

# lower level
job = rigyd.convert(prompt="a wooden dining chair")
job.wait(on_progress=lambda j: print(j.status, j.stage, j.progress))
xml = job.download(fmt="mjcf")                     # path to the .xml package
model = rigyd.load_model(...) ; print(rigyd.account())   # user + credit balance
```

Run it:

```bash
python examples/quickstart.py "a wooden dining chair"   # opens the MuJoCo viewer
```

| Flow | Input | Cost |
|------|-------|------|
| Text → SimReady | `prompt=` | 2 credits |
| Image → SimReady | `images=` (1 or 4: front, right, back, left) | 3 credits |
| 3D file → SimReady | `file=` (`.glb/.gltf/.fbx/.obj/.stl/.ply/.usd*`) | 1 credit |

## How it works

Submits to `api.rigyd.com`, polls the job to completion, downloads the
`format=mjcf` result ZIP, extracts it (preserving the `meshes/` + `textures/`
layout MuJoCo expects), and returns `mujoco.MjModel.from_xml_path(...)`.

## Layout

```
rigyd/
  __init__.py   # configure / convert / generate / load_model / account
  client.py     # stdlib urllib client for the Rigyd API
  job.py        # Job: status, wait(), download(), load()
  cache.py      # result-ZIP extraction + local cache
  errors.py     # RigydError
examples/quickstart.py
scripts/smoke_test.py
```

## License

MIT — see [LICENSE](./LICENSE).
