Overview
MeshCraft supports keyframe animations via named actions. Each action contains channels, and each channel animates one scalar property of one named object over time using keyframes.
Complete Example
<actions>
<action name="Bounce" duration="2.0" loop="true">
<channel target="BouncingBox" property="position.y">
<keyframe time="0.0" value="0.0" interp="cubic">
<handle_left dt="-0.2" dv="0.0"/>
<handle_right dt=" 0.2" dv="2.0"/>
</keyframe>
<keyframe time="1.0" value="3.0" interp="cubic">
<handle_left dt="-0.2" dv="2.0"/>
<handle_right dt=" 0.2" dv="-2.0"/>
</keyframe>
<keyframe time="2.0" value="0.0" interp="linear"/>
</channel>
</action>
<action name="Spin" duration="3.0" loop="true">
<channel target="SpinningSphere" property="rotation.y">
<keyframe time="0.0" value="0.0" interp="linear"/>
<keyframe time="3.0" value="360.0" interp="linear"/>
</channel>
</action>
<action name="Flash" duration="2.0" loop="true">
<channel target="FadingPlane" property="visible">
<keyframe time="0.0" value="1.0" interp="step"/>
<keyframe time="0.5" value="0.0" interp="step"/>
<keyframe time="1.0" value="1.0" interp="step"/>
</channel>
</action>
</actions>
action attributes
| Attribute | Type | Default | Description |
name | string | — | Unique clip name |
duration | float | 1.0 | Clip length in seconds |
loop | boolean | false | Loop when end is reached |
channel attributes
| Attribute | Description |
target | Name of the scene object (Mc3Object.name) to animate. |
property | Which property to animate (see table below). |
keyframe attributes
| Attribute | Type | Description |
time | float | Time in seconds (keyframes sorted ascending on load) |
value | float | Property value at this time |
interp | linear|step|cubic | Interpolation to the next keyframe |
For interp="cubic", optional child elements specify tangent handles (offsets from the keyframe's (time, value)):
<handle_left dt="-0.2" dv="0.0"/> <!-- in-tangent -->
<handle_right dt=" 0.2" dv="1.5"/> <!-- out-tangent -->
Animatable Properties
| Property name | Unit | glTF export |
position.x/y/z | world units | translation VEC3 |
rotation.x/y/z | degrees | quaternion VEC4 |
scale.x/y/z | factor | scale VEC3 |
visible | 0=false, ≥0.5=true | not exported |
deform.x/y/z | factor | not exported |
material.baseColor.r/g/b/a | 0–1 | not exported |
material.roughness | 0–1 | not exported |
material.metallic | 0–1 | not exported |
material.emissive.r/g/b | 0–1 | not exported |
glTF Export Notes
- Position, rotation, and scale channels are exported as glTF
animations[].
- Per-component channels (e.g.,
position.y only) are merged into VEC3/VEC4; non-animated components fall back to the base transform value.
- Cubic Bézier channels are sampled at 30 fps and exported as
LINEAR interpolation (glTF has no native cubic Bézier).
visible, deform.*, and material.* channels have no glTF equivalent and are silently skipped.