Ligamen

Export and import

Export

The editor works with the .ligamen project, and a game or another tool needs something else: skeleton data in a Spine format, an atlas with the images, or ready frames, an animated picture or a video. All of that starts in one window, File → Export… (Cmd+E, or Ctrl+E on Windows and Linux), which you can also open with the Export button of the title bar. This article covers the window, the Data section that writes skeleton data, the Image and Video sections that render animations, and the saved settings that let you repeat an export in one key press. The Atlas section has its own article, Texture packing.

The Export window#

The tabs under the header of the window choose one of five sections: Data, Atlas, Image, Video and HTML. The last one writes a web page that plays the skeleton, and it has its own article, HTML export and player. Each section starts with a row of formats and ends with the same Output block. Output has the folder, which you pick with the … button, and the file name with the extension that the export adds. The folder starts as export next to the project, and later as the last folder you used. Relative to project stores the folder in the project relative to the project file, so both can be moved together. Open folder after export shows the result when it is done.

A progress window lists every step, such as validating, reading images, packing the atlas, writing pages and writing the skeleton, with a bar. Esc or Cancel export stops it. Your choices are remembered for each section, but the folders are not. Exporting never renames the current project, never moves its image folder and never marks the project as saved.

Data#

The Data section writes the skeleton. The format row has Standard, JavaScript and Minimal JSON, which are the three variants of Spine's JSON option, and Binary, which writes a .skel.bytes file. For the binary, the Spine version picks the format that your runtime reads, from 4.0 to 4.3. Only Standard JSON and Binary can be opened back in Ligamen with File → Open. Pretty print indents the JSON so that it reads well, and Nonessential data adds what runtimes do not need but editors do, such as bone colors and image paths.

A project with additional skeletons shows a Skeleton picker, and an additional skeleton is written as JSON on its own. Scale multiplies the skeleton data, for example when the images in the game are smaller than in the editor.

The Texture atlas switch packs the images that the skeleton uses and writes the atlas next to the data, as <name>.atlas.txt, which is the name that spine-unity looks for, or as <name>.atlas. This is the export that you use for Unity. With the atlas on, the options of the packer appear: Max size, Padding, Premultiply alpha, Strip whitespace and Skip missing images, and Standard JSON is written in the dialect of the version that you chose. Pack decides what goes into the atlas: Attachments packs only the images that attachments use and ignores any pack.json, while Image folders packs the whole images folder with its subfolders and follows its pack.json. A used image that the folder lacks is listed in the export warnings. The atlas can be one per skeleton, a single atlas or one per skin, as in Spine 4.3.

When the target is an older Spine version than the project needs, Ligamen bakes what the old format cannot hold. Mappings of transform constraints and sequences are examples, and the status line and the warnings say what was changed. Check the result in the runtime if you export for a version below 4.3.

Image and Video#

Image renders the animation. The formats are PNG, JPEG and PSD frames, which go into a folder named after the export with one subfolder per animation when All animations is on, and APNG or GIF, which are one animated picture of one animation. Video writes AVI, MOV or MP4 (H.264), and WebM with transparency when ffmpeg with VP9 is installed, of one animation.

Both sections share the render options. Range is the first and last frame of the chosen animation and is off while All animations is on. Size and Scale set the pixels, Fit and Fit size frame the skeleton, and Maximum bounds frames the largest pose of the whole animation, so the picture does not jump. Crop to content trims every frame. Overlay bones bakes the bone shapes over the artwork, which by default is never done. Smoothing and Multisample AA soften edges, and the multisample renders each frame two or four times larger and scales it back down. While the window is open, the viewport shows a dashed frame with the pixel size of what will be rendered, and a preview under the options shows one exported frame, rendered the same way as the file, with a slider to pick the frame. Crop to content is the one option that the preview does not show.

For MP4, Quality picks High, Medium or Low, or a custom value from 0 to 51 where lower is better and larger. WebM uses its own scale of 0 to 63. Include audio puts the sounds of the event keys of the animation into MP4 and WebM, with the volume and balance of every key, and missing files are listed after the export. AVI and MOV have no sound. Repeat plays the animation several times inside one file, from 1 to 100, and time keeps running so that physics continues across the repeats. For APNG and GIF it is different from the loop count of the player.

Saved settings and repeating#

Save Settings… at the bottom of the window stores every option of Data, Atlas, Image and Video in a .ligamen-export.json file, and Load Settings… brings them back. The file contains no paths, so you can share it between projects and with your team. File → Repeat Last Export (Cmd+Shift+E) runs the last export of the session again with the same options and without the window, which is useful when you tweak a pose and look at the result in the game after each change.