DocumentationCore and models

Core and models

Prepare Cubism Core and model assets safely.

Cubism Core

Use Cubism Core 5.3 with the bundled Framework 5-r.5 adapter. The script may be preloaded by coreUrl or placed before application code. Never copy Core into npm packages or public issue attachments.

html
<script src="/live2dcubismcore.min.js"></script>

Model directory

Keep the exported directory together. A model may reference moc3, textures, motions, expressions, physics, pose and user-data files.

  • Keep model3.json paths relative and case-correct.
  • Serve textures and motions with CORS when they use another origin.
  • Use /inspect before debugging rendering.

Serve assets predictably

Prefer same-origin, immutable URLs for versioned model files. When assets use another origin, enable GET and CORS for model3, moc3, textures, motions and expression files. Do not rewrite relative paths after export unless every reference in model3 is updated with the same casing.

text
public/
├─ live2dcubismcore.min.js
└─ models/avatar/
   ├─ avatar.model3.json
   ├─ avatar.moc3
   ├─ textures/
   └─ motions/

Check compatibility before rendering

Open the model in Inspector or call inspectModelSource() to find missing references, unexpected external URLs and unsupported versions before creating a Canvas. Keep licensed Core and model files out of public bug reports; share the error code, failing URL, HTTP status and export version instead.

Fit the model to the canvas

fit decides how large the model is drawn and where it sits. The default, 'upper-body', scales the model to twice the canvas and anchors it bottom center. 'full' fits the whole model inside the canvas.

'upper-body' assumes a full-body rig that fills its canvas vertically. A rig already drawn from the waist up overflows at twice the size, and a rig drawn off center in its canvas leans to one side. Two of the five official Cubism samples behave this way. model3.json records the canvas size but not where the character is drawn inside it, so neither value can correct for this on its own.

If the model looks wrong, try 'full' first. When neither is right, turn on the placement overlay and drag the model where you want it; it reports the fit value to paste back.