# VRM export and VRMA import

Two commands move HELIX avatars and animations to and from the VRM ecosystem. Both are offline and write
only the paths you name.

## `helix character export-vrm <avatar.glb> [-o out.vrm]`

Takes a published HELIX avatar GLB (a `helix-humanoid@1` skeleton, with `helixFace` and `helixDynamics`
in the scene extras) and writes a VRM 1.0 file.

| VRM part | Source in the HELIX avatar |
| --- | --- |
| `VRMC_vrm.humanoid` | The 52 `helix-humanoid@1` bones that VRM names (`pelvis` is `hips`, `spine_01/03/05` are `spine/chest/upperChest`, `thumb_01..03` are `Metacarpal/Proximal/Distal`, `ball` is `Toes`). The export fails with the missing bone names when the file is not a `helix-humanoid@1` avatar. |
| `VRMC_vrm.expressions` | `helixFace` channels: `vowel.*` to `aa ih ou ee oh`, `blink.left/right` to `blinkLeft/blinkRight` (plus a combined `blink`), `gaze.*` to `look*`, emotions to the presets, visemes to custom `viseme_<x>`, `jawOpen` to a custom expression. Channels driven by a bone rather than a morph target are skipped and named in the warnings. |
| `VRMC_springBone` | `helixDynamics` chains and colliders. HELIX stiffness and damping are inverted into VRM `stiffness`, `dragForce` and `gravityPower` so a 60 Hz VRM runtime settles like the HELIX solver (the round trip with the importer is tested). Plane and inside colliders use `VRMC_springBone_extended_collider` with a base shape fallback. Angle limits have no VRM equivalent and are dropped (warned). |
| `VRMC_vrm.lookAt` | Expression type, only when the avatar has gaze channels. |
| `VRMC_vrm.firstPerson` | `helixAvatar.firstPersonHide`: a mesh whose primitives are all hidden is `thirdPersonOnly`, a mixed mesh stays `auto`. |
| `VRMC_materials_mtoon` | `HELIX_materials_toon` when the material carries it; otherwise a derived MToon (shade colour 0.72 x base, no outline) so the file still reads as toon shading. `KHR_materials_unlit` is written alongside, as UniVRM does. |
| `VRMC_vrm.meta` | The source VRM's meta when the avatar was imported from one (see Round trip), then the flags below. Defaults: author `HELIX`, `onlyAuthor`, `personalNonProfit`, credit required, no redistribution, no modification. The name defaults to the file name. |

Round trip. An avatar that came in through the VRM importer carries extra blocks beside the manifests, and the
export reads each when present: `helixAvatar.meta` becomes the VRM meta (a 1.0 source passes through; a 0.x source
is migrated as UniVRM does, taking the narrower grant where 0.x is vague, so a commercial "Allow" is
`personalProfit` and a non-CC licence forbids redistribution and modification; the meta flags still override),
`helixFaceExt` restores multi-morph binds, binary and override flags and the custom expressions under their own
names and writes bone `lookAt` with the eye joints as `leftEye`/`rightEye`, `helixDynamicsCenters` becomes each
spring's `center`, and `helixConstraints` becomes `VRMC_node_constraint` (a roll about an axis that is not the
node's +X, +Y or +Z is dropped with a warning).

Pose. VRM requires a T-pose. Published HELIX avatars rest in an A-pose, so with `--rest-pose auto` (default)
the arms are rotated to the horizontal and the mesh is re-skinned (positions, normals and tangents), which
moves the inverse bind matrices. `always` forces it, `off` keeps the source pose (the file is then not a
spec T-pose). Heavy sleeves and cloth can stretch at the shoulder when the A-pose weights were not authored for a
raised arm; check the render.

Other behaviour: one LOD scene is exported (`--lod`, default 0); KTX2 and WebP textures are decoded to
PNG or JPEG; quantization and meshopt are removed.

```
helix character export-vrm vivi.glb -o vivi.vrm --name Vivi --author "Jane Doe" --commercial-usage personalProfit --json
```

The same export is a Bridge capability, `helix bridge import vivi.glb --type vrm-export -o <dir>` (and the MCP `bridge_import` with `type: "vrm-export"`), using the default options above; see `docs/bridge.md`.

Validate with the official validator (`gltf-validator` with VRM support) or load in three-vrm. The warnings
list says what did not map.

## `helix character import-vrma <clip.vrma> [-o clip.glb]`

Reads a VRM Animation file and writes a platform clip GLB on `helix-humanoid@1`. The VRMA humanoid map names
the bones, the motion goes through the same world-space retarget as Mixamo and Meshy clips
(`retargetClip`), with the T-pose source mapped onto the A-pose canonical rest. The result sits at
`character-out/anims/<clipName>.glb` (default clip name `vrma.<file>`) with a merged `clip-meta.json`, so it can
be uploaded as an emote like any other clip. `--loop` marks it looping. Expression and lookAt tracks in a VRMA
are ignored (the clip format is skeleton-only); the result lists how many were skipped.
