Назад към всички

mml

// Build 3D scenes and interactive experiences using MML (Metaverse Markup Language) for the Otherside metaverse and other MML-compatible environments. Use when creating 3D objects, worlds, interactive elements, animations, models, characters, audio/video, labels, collision-based interactions, position

$ git log --oneline --stat
stars:1,933
forks:367
updated:March 4, 2026
SKILL.mdreadonly
SKILL.md Frontmatter
namemml
descriptionBuild 3D scenes and interactive experiences using MML (Metaverse Markup Language) for the Otherside metaverse and other MML-compatible environments. Use when creating 3D objects, worlds, interactive elements, animations, models, characters, audio/video, labels, collision-based interactions, position tracking, chat integration, or any MML document. Triggers on: MML, metaverse markup, 3D scene building, Otherside world building, m-cube, m-model, m-character, m-group, m-frame, m-attr-anim.

MML (Metaverse Markup Language)

Full compiled reference: /home/ubuntu/.openclaw/workspace/research/mml-reference.md Source: mml.io + DashBODK Studio (dashbodk.vercel.app/docs). All elements, attrs, events, collision patterns.

MML is an HTML-like markup language for building 3D scenes. Documents are served via WebSocket and rendered by clients (Web/Three.js or Unreal Engine). MML supports scripting via inline <script> tags (standard DOM APIs).

Key Concepts

  • Units: Positions in meters, rotations in degrees, font sizes in centimeters
  • Coordinate system: x (right), y (up), z (forward)
  • Common attributes: All visible elements share x y z rx ry rz sx sy sz visible id class
  • Collision system: Set collision-interval (ms) on an element to receive collisionstart, collisionmove, collisionend events
  • Document time: Animations and media use document lifecycle time (ms since document start)
  • Scripting: Standard DOM manipulation via <script> tags. Use document.getElementById(), addEventListener(), setAttribute(), etc.

Elements Quick Reference

ElementPurposeKey Attrs
m-groupContainer, transforms children as unit(transform only)
m-cube3D boxwidth height depth color opacity
m-sphere3D sphereradius color opacity
m-cylinder3D cylinderradius height color opacity
m-planeFlat surfacewidth height color opacity
m-modelLoad 3D model (GLTF/OBJ/FBX)src anim-src anim-loop anim-enabled start-time pause-time
m-character3D character (composable with m-model children)src anim-src anim-loop anim-enabled start-time pause-time
m-lightPoint or spotlighttype intensity distance angle enabled cast-shadows color
m-imageDisplay image in 3Dsrc width height emissive opacity
m-videoDisplay video in 3D (supports WHEP streaming)src width height emissive loop enabled volume start-time pause-time
m-audioSpatial audiosrc loop loop-duration enabled volume cone-angle cone-falloff-angle start-time pause-time
m-labelText on a planecontent width height font-size font-color padding alignment color emissive
m-frameEmbed another MML documentsrc min-x max-x min-y max-y min-z max-z load-range unload-range
m-linkClickable link (no visual)href target
m-promptUser text input on clickmessage placeholder prefill onprompt
m-interactionAction at a point in spacerange in-focus line-of-sight priority prompt oninteract
m-position-probeTrack user positionsrange interval onpositionenter onpositionmove onpositionleave
m-chat-probeReceive chat messagesrange onchat
m-attr-animKeyframe animation (doc-time synced)attr start end start-time pause-time duration loop easing ping-pong ping-pong-delay
m-attr-lerpSmooth attribute transitionsattr duration easing

Common Patterns

Basic scene with transforms

<m-group x="0" y="1" z="-5">
  <m-cube color="red" width="2" height="0.5" depth="2"></m-cube>
  <m-sphere color="blue" radius="0.3" y="1"></m-sphere>
</m-group>

Animation (looping rotation)

<m-cube color="green" y="2">
  <m-attr-anim attr="ry" start="0" end="360" duration="3000" loop="true"></m-attr-anim>
</m-cube>

Smooth transitions on attribute changes

<m-cube id="box" color="red" y="1">
  <m-attr-lerp attr="x,y,z" duration="500" easing="easeInOutQuad"></m-attr-lerp>
</m-cube>

Click interaction

<m-cube id="btn" color="blue" onclick="
  this.setAttribute('color', this.getAttribute('color') === 'blue' ? 'red' : 'blue');
"></m-cube>

Collision detection

<m-cube id="platform" width="5" height="0.2" depth="5" color="green" collision-interval="100">
</m-cube>
<script>
  const platform = document.getElementById("platform");
  platform.addEventListener("collisionstart", (e) => {
    platform.setAttribute("color", "yellow");
  });
  platform.addEventListener("collisionend", (e) => {
    platform.setAttribute("color", "green");
  });
</script>

Position tracking

<m-position-probe id="probe" range="20" interval="500"></m-position-probe>
<m-label id="info" content="Waiting..." y="3" width="3" height="1"></m-label>
<script>
  const probe = document.getElementById("probe");
  const info = document.getElementById("info");
  probe.addEventListener("positionenter", (e) => {
    info.setAttribute("content", `User ${e.detail.connectionId} entered`);
  });
</script>

Load 3D model with animation

<m-model src="https://example.com/character.glb" 
         anim-src="https://example.com/dance.glb"
         anim-loop="true" y="0" sx="1" sy="1" sz="1">
</m-model>

Composing documents with m-frame

<m-frame src="https://example.com/other-scene.html" 
         x="10" y="0" z="0"
         min-x="-5" max-x="5" min-y="0" max-y="10" min-z="-5" max-z="5">
</m-frame>

Spatial audio

<m-audio src="https://example.com/music.mp3" 
         loop="true" volume="0.5" 
         x="0" y="2" z="0">
</m-audio>

Chat-reactive elements

<m-chat-probe id="chat" range="10"></m-chat-probe>
<m-label id="msg" content="" y="3" width="4" height="1"></m-label>
<script>
  document.getElementById("chat").addEventListener("chat", (e) => {
    document.getElementById("msg").setAttribute("content", e.detail.message);
  });
</script>

Easing Functions

Available for m-attr-anim and m-attr-lerp: easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInSine, easeOutSine, easeInOutSine, easeInExpo, easeOutExpo, easeInOutExpo, easeInCirc, easeOutCirc, easeInOutCirc, easeInElastic, easeOutElastic, easeInOutElastic, easeInBack, easeOutBack, easeInOutBack, easeInBounce, easeOutBounce, easeInOutBounce

Omit easing for linear interpolation.

Events Reference

EventSourceKey Properties
clickAny clickable elementdetail.connectionId, detail.position
collisionstartElements with collision-intervaldetail.connectionId, detail.position
collisionmoveElements with collision-intervaldetail.connectionId, detail.position
collisionendElements with collision-intervaldetail.connectionId
positionenterm-position-probedetail.connectionId, detail.position, detail.rotation
positionmovem-position-probedetail.connectionId, detail.position, detail.rotation
positionleavem-position-probedetail.connectionId
chatm-chat-probedetail.message, detail.connectionId
interactm-interactiondetail.connectionId
promptm-promptdetail.value, detail.connectionId
connected / disconnectedDocument-leveldetail.connectionId

Platform Support

Most elements work on both Web and Unreal. Notable exceptions:

  • m-link: Web only
  • m-attr-lerp: Web only
  • m-frame bounds/load-range: Web only
  • socket attribute: Web only

Full Element Docs

For detailed attribute lists per element, see references/elements.md.