Files
nanakura dc26878386
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
chore: prune unused apps and services for the moeka fork
- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs
- Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock
- Rewrite remaining product references to Moeka
2026-09-14 16:40:49 +07:00
..
2026-08-26 20:13:10 +08:00

@proj-airi/stage-ui-mmd

MMD (MikuMikuDance) scene components, composables, and stores for Project Moeka.

What it does

Renders PMX/PMD models with VMD/VPD motion support inside Moeka's stage, reaching feature parity with the Live2D and VRM renderers:

  • Model loading for .pmx/.pmd, from a packaged ZIP (model + textures) or a bare model URL.
  • Physics for hair, skirts, and custom rigs via Bullet (Ammo.js) — rigid bodies and 6-DOF spring joints, toggleable at runtime.
  • IK (CCD solver) and append-bone ("grant") propagation for standard and custom rigs.
  • Importable, mappable motions: import VMD clips (persisted to IndexedDB, synced across windows), set one as the looping idle, preview any as a one-shot, remove them, and map Moeka emotions to gesture motions.
  • Morph-based lip-sync driven by the shared wLipSync profile, mapping phonemes to the canonical あいうえお mouth morphs, with per-slot morph remapping for non-standard models.
  • Emotion expressions via morph cross-fades.
  • Looking-at modes (camera / cursor / disabled) with idle saccades, plus procedural blink.
  • Scene settings: model transform, camera FOV, ambient + directional lights, albedo glow, render scale, physics gravity, and per-material opacity — all live, persisted, and synced across windows.

It builds on @moeru/three-mmd for PMX/PMD loading, VMD animation building, IK, append-bone propagation, toon materials, outlines, and the shared runtime update order. Physics comes from @moeru/three-mmd-physics-ammo and is loaded lazily, so the Ammo WASM runtime is initialized only after a live MMD model is mounted.

How to use

The package exposes the same scene contract as the other renderers, so it is wired through @proj-airi/stage-ui's Stage.vue automatically when the selected model resolves to the mmd renderer:

import { MMDScene, useMMD } from '@proj-airi/stage-ui-mmd'
<MMDScene
  v-model:state="state"
  :audio-context="audioContext"
  :model-src="modelUrl"
  :cursor-position="cursorPosition"
  :current-audio-source="audioSource"
  :enable-orbit-controls="true"
  @error="onError"
/>

The component exposes canvasElement(), captureFrame(), setEmotion(name, intensity), listMorphs(), and listMotions().

Runtime configuration (physics/IK/grant toggles, gaze tracking, scale, morph overrides, emotion→motion mapping) lives in the useMMD Pinia store and is edited through the model settings panel.

When to use it

  • Displaying MMD/MikuMikuDance characters (.pmx/.pmd) on the Moeka stage.
  • When you need physics-driven secondary motion, IK, and VMD playback.

When not to use it

  • For VRM avatars use @proj-airi/stage-ui-three; for Live2D use @proj-airi/stage-ui-live2d; for Spine use @proj-airi/stage-ui-spine.
  • In environments without WebGL/WASM support (MMD physics requires Ammo WASM).