Docs
Player
The Layer2D Player runs entirely in the browser on WebGL2. Nothing is uploaded.
- Drag an
.l2dfile onto the page to load it. - Webcam tracking drives head turn, gaze and blinks.
- Microphone input drives lip sync from vowel shapes.
- Expressions, outfits and holds are selected from the panel.
Keyboard
| Key | Action |
|---|---|
M | Toggle microphone lip sync |
C | Toggle webcam tracking |
A | Toggle idle animation |
B | Cycle background: light, dark, transparent |
OBS Browser Source
Add a Browser source in OBS and point it at the player with ?obs=1. OBS mode renders on a transparent background and hides the interface.
https://layer2d.com/player/?model=demo.l2d&obs=1&mic=1
- Set width and height to match your canvas, for example
1080 × 1920. - Enable Control audio via OBS only if you want OBS to own the microphone.
- Use Interact on the source to grant webcam or microphone permission once.
URL parameters
| Parameter | Effect |
|---|---|
obs=1 | Transparent background, interface hidden. |
bg=transparent | Same as obs=1. |
mic=1 | Start microphone lip sync on load. |
cam=1 | Start webcam tracking on load. |
auto=0 | Disable idle animation. |
face=<name> | Start on a named expression, for example face=Happy. |
.l2d bundles
An .l2d file is a ZIP archive with an open manifest, a runtime pack, textures and checksums. Full reference: Format.
demo.l2d├─ layer2d.json├─ pack.json├─ tex/├─ preview.png└─ SHA256SUMS.json
CLI
The rigkit.format module packs, inspects, validates and unpacks bundles. Standard-library Python only.
# pack a viewer directory (pack.json + tex/)python -m rigkit.format pack models/demo/viewer demo.l2d \ --meta avatar_spec.json --preview preview.png# print the manifest summarypython -m rigkit.format inspect demo.l2d# verify structure, textures and SHA-256 digestspython -m rigkit.format validate demo.l2d# extract safely after validationpython -m rigkit.format unpack demo.l2d out/
validate exits with status 1 on any error, so it can gate CI.