Docs Output

Exporting a skeleton for game engines

File ▸ Export ▸ Skeleton (JSON)… writes a bone rig and its animations as data a game engine can play back, instead of rendering them to pictures.

A sprite sheet stores every frame as a picture. A skeleton export stores the rig instead: the bones, the images hung on them and how the bones move over time. The engine then draws the character itself, so the animation stays small and plays smoothly at any size and frame rate.

Exporting

  1. Choose File ▸ Export ▸ Skeleton (JSON)….
  2. Pick a folder. The export writes several files, so it asks for a folder rather than a file name.
  3. The files are written straight away. There are no settings to choose.

The folder receives skeleton.json, an atlas image skeleton.png holding the images attached to bones, and one PNG per mesh, named after the mesh layer. A character a file name cannot hold is replaced, and when two meshes share a name the second file gets a number added. The names are fixed, so exporting the same project again replaces the same files.

What the file contains

The layout is modelled on Spine's: bones, slots, attachments and animations. It is not a Spine file, and no official Spine runtime reads it, but the shape is familiar enough that an importer for your engine only needs to be written once.

PartWhat it holds
BonesEvery bone of every bone layer, with its rest pose relative to its parent. Static bones, the IK targets, are left out: their effect is already in the bones they drive
Mesh attachmentsEach mesh layer, with its rest vertices, its triangles and the weight each bone has on each vertex
Region attachmentsLayers that ride a bone rigidly through Link Layer, placed on the atlas with their fixed offset from the bone
AnimationsOne animation per group marker on the timeline, named after the marker. With no group markers there is a single animation called default, from the in point to the out point

Everything the engine would otherwise have to reproduce is baked into plain numbers: IK, bone dynamics, control bones and actions all become ordinary rotation, translation and scale keys. Where an action reshapes a mesh in a way bone weights cannot express, that animation stores the mesh's vertex positions frame by frame instead, so the engine does not need to know how actions work.

What is not included yet

  • Layers that move with their own keyframes and are not linked to a bone. Export those as a sprite sheet or a PNG sequence.
  • Automatic following inside a bone layer. Only weights you bound or painted, and layers linked with Link Layer, are exported, so a layer that follows the rig only through Flexible or Region binding does not move in the export.
  • A mesh that also has its own position, rotation or scale on top of its bones.
  • IK, transform, path and physics constraints as live constraints, events, and skins for swapping costumes.
Only bones that move are given translation and scale keys; most bones only rotate, so their animations carry rotation alone. That keeps the file small.