# An Xbox 360 avatar as a VTuber model (VRM)

To VTube as an Xbox 360 avatar, export it as a VRM file with `sona_export_avatar` and open it in a VRM app, or run
the SDK's VTuber kit, where your webcam drives the avatar's face and OBS captures it. The export writes VRM 1.0 by
default, or VRM 0.x for apps still on UniVRM 0.x.

![An exported VRM in three-vrm, showing its expressions](../img/vrm-three-vrm.webp)

## Steps

1. Download the SDK for your platform ([getting it](../web-api.md#sdk-download)) and have your avatar as a base64
   manifest.
2. Export it with `sona_export_avatar` (C and C++; `TryExport` in C#, `export` in Rust and Python).
3. Open the `.vrm` in your VRM app, or build the VTuber kit and run it with your webcam and microphone.

## Export a VRM

```python
data, rep = avatar.export(name="My avatar", authors="Ann",   # VRM 1.0, Unity bone names, MToon
                          licence_url="https://vrm.dev/licenses/1.0/")
with open("avatar.vrm", "wb") as f:
    f.write(data)
```

The file holds a humanoid skeleton, MToon materials, look-at and first-person settings, the licence fields you chose,
and the expressions: visemes, moods, blinks and gaze. The face is a picture, not a shape, so each expression is a
texture offset (`textureTransformBinds`), which every VRM runtime applies.

The files are read by three-vrm and pass the glTF validator; Unity, Unreal, VSeeFace and VRChat are untried. There are
no spring bones (the rig has no hair or cloth joints) and no animations in the file.

## The VTuber kit

The kit is a program where your webcam drives the avatar's head, brows, eyes and moods, your microphone drives its
mouth, and OBS captures it from a transparent window. The webcam goes through MediaPipe's face landmarker:

```sh
python3 sdk/templates/vtuber/mediapipe_track.py --webcam 0 --model face_landmarker.task --out - |
  sona_vtuber --licence sona-licence.json --avatar me.b64 --face - --mic
```

In OBS, add a Window Capture of "360sona VTuber" and keep its transparency.

## More

- [The VTuber kit tutorial](../tutorials/template-vtuber.md): building it, and making a clip from a video with no
  window.
- [VRM and glTF export](../guides/vrm.md): every option, the expressions and the limits.
- Credit: the kit's "Powered by 360sona" badge stays in the corner of what OBS captures, and a VRM's
  `asset.copyright` carries the credit unless you give your own copyright.
- 360sona is not affiliated with or endorsed by Microsoft.
