Runtimes
HTML export and player
Sometimes you need to show an animation to someone who does not have the editor and does not use a game engine: a client who reviews a character, a teammate who looks at a pose in a chat, a page in a portfolio. For that, Ligamen writes the skeleton as one HTML file with everything inside it, including its own web player. You send the file, it opens in any browser, and the animation plays. This article covers the HTML section of the Export window, the controls of the page that it writes, the options that make the file smaller, and what the player can and cannot draw.
Exporting a page#
Open File → Export… and choose the HTML tab. The Output block is the same as in other sections. The Player card has Background, the color of the page as #rrggbb, Speed from 0.1 to 4, where 1 is real time, and the Loop switch, which repeats the animation instead of stopping at its end. Click Export HTML. The result is one .html file with the skeleton data, the atlas and the player inside. It needs no server and no network, and it works when opened directly from the disk.
Features that the player does not play are listed after the export, under Details, so that you know what the viewer will not see before you send the file. The options are remembered, and they are part of the settings that Save Settings… stores.
The page and its address#
The page shows the skeleton with a selector for the animation and the skin, a play and pause button, a Loop switch and a speed control. You can open the page in a particular state by adding parameters to the address: ?anim=<name>&skin=<name> picks the animation and the skin that start. This is useful when you send a link to a hosted copy, or when you want a page that opens on the pose that you want to discuss.
The player draws with WebGL. Open the page with ?renderer=2d to force the older Canvas 2D drawing, which is also the fallback when WebGL is missing. The page stops redrawing while it is paused or hidden, so a page that is left open costs almost no processor time.
Making the file smaller#
The images go into the page as an atlas, with the pages embedded in the file as text, and that can be large. The Images card of the section has four controls. Scale shrinks every image to a share between 10 and 100 percent before it is packed, which makes the file smaller and the picture softer. Atlas size limits one atlas page. Format is PNG (lossless) or WebP (smaller), and WebP is lossy but keeps transparency and is several times smaller than PNG. Quality of WebP goes from 1 to 100 and is available only with WebP. A good start for a review page is a scale of 60 percent and WebP with a quality of 75.
Baked frames#
The live player redraws the skeleton from its data, and it does not know everything that the editor knows. Baked frames is the other way: Ligamen renders every animation to PNG frames with the renderer of the editor and puts the frames into the page. This plays everything that the editor draws, including constraints and physics. In return, the page uses the skin that is active in the editor and has no skin selector, the frame size is fixed, the file is larger, and the Images options are turned off because the frames are PNG.
Use the live player when the skeleton is simple enough and you want a skin selector and a small file, and baked frames when the result must look exactly as in the editor.
What the player draws#
The player draws bones, region, mesh and linked mesh attachments including weights and deform, clipping with its inverse mode, skins, slot colors, tint black in the setup colors, the normal, additive, multiply and screen blend modes, draw order, and the animation of bones and slots. Constraints, events and animated tint black are not played, and each one produces a warning in the list after the export, in the form not supported in HTML player. If a warning concerns something that matters for the animation, switch on Baked frames.
The same export is available from the command line, which is described in Command line, so a build script can produce pages for a whole folder of projects.