Ligamen

Attachments

Region

A region is the simplest attachment: one rectangular picture taken from an image in the project. It hangs on a slot, so it follows the slot's bone, takes the slot's colour and blend mode, and is drawn at the slot's place in the draw order. Most characters are built from regions alone, one per body part. This article shows how to select a region, how to place it, what its Properties offer, how a numbered image sequence turns a region into a flip-book, and how a region becomes a mesh when a flat rectangle is not enough.

Region properties

Selecting a region#

Importing a folder of images or a PSD makes a region for every file, and New Region Attachment… in the slot's context menu in the Tree (see Slots) adds one by hand. A region can be selected in two ways. Clicking the slot row selects the slot, and Properties shows the slot's colour, blend mode and attachments. Clicking the picture in the viewport, or the region's own row under the slot, selects the region, and Properties switches to the picture panel described below.

The header of that panel holds the region's icon, its name, its size in pixels and a slot link that selects the owning slot again. Two buttons sit on the right. The magnifier opens a menu of the project's images with a tick on the current one; choosing another image points the region at it as one undo step, and the region keeps its name. The crosshair reveals the current image in the Images panel (see Images).

Placing a region#

A region has a position, a rotation and a scale, all measured from its slot's bone, and a width and a height taken from the image. In Setup mode a selected region gets the same Translate, Rotate and Scale handles as a bone, centred on the image's origin. Drag an axis handle to move or scale along that axis, drag the ring to rotate, and drag the picture itself to move it freely. Shift constrains or snaps the drag and Alt scales uniformly. The Local, Parent and World switch (see Tools) decides whether the handles follow the image, its bone or the screen.

Scale changes the region's scale, not its width and height, so the size in the header stays the size of the image. Ctrl+C and Ctrl+V copy a region's transform onto another region, using the same Local, Parent or World choice, and every drag or paste is one undo step. When pixel art must stay sharp, turn on Pixels in the View menu: regions are then drawn and picked with their top-left corner on whole world units. The data and the exports do not change. In Animate mode a region moves with its bone, and the bone is what you key.

Region properties#

Below the header, the first row of the panel holds four controls. Color is a swatch that opens the colour dialog; it tints the region's own pixels, and white leaves the image unchanged. This tint belongs to the attachment and is combined with the colour of its slot. The word Sequence and its switch are covered in the next section.

The two small buttons on the right of the row are switches. Select in viewport is on by default; turn it off and clicks in the viewport pass through the region to whatever lies behind it, which helps with a large backdrop that keeps getting in the way. It is the same lock as in the Tree, and the region stays selected. Export is also on by default. With it off, the region stays in the .ligamen file but is left out of Spine exports, which is useful for guides and reference drawings. The status bar reports the change.

The bottom row, Mesh and Edit Mesh, is described at the end of this article. There are no numeric position fields in the picture panel: the handles in the viewport and the copy and paste of transforms are the way to place a region.

Image sequences#

A region can show one frame out of a run of numbered images instead of a single picture, which is how an explosion, a spark or a flame is made without swapping attachments. Turn on the Sequence switch in Setup mode. Ligamen looks in the project's images for files named after the region's image path with a number added, such as fx/spark01.png to fx/spark04.png, and takes the count, the first number and the zero padding from them. When no such files exist, the count is one.

Three fields appear under the row. Count is the number of frames, Pad is the width the number is zero-padded to (0 means no padding, so spark1, spark2), and Setup is the frame shown in Setup mode and before the first key, counted from 0. A warning in the panel names the frames that are missing from the images folder. All three fields work in Setup mode only, and each edit is an undo step of its own.

In Animate mode a Key row appears for a region whose Sequence is on. Mode says how frames advance after the key: hold stays on one frame; once plays to the last frame and stops; loop repeats; pingpong plays forward and back; and onceReverse, loopReverse and pingpongReverse run the same patterns from the end. Index is the frame at the key and FPS is the speed, with 0 meaning hold. Press the key button to place a key at the playhead; changing a field while the playhead is on a key rewrites that key, and pressing the button on a key removes it. The Dopesheet shows a Sequence sub-row for the region. The frame is worked out from the time passed since the key, so scrubbing backwards shows the same frame as playing forwards.

When a project is exported for Spine 4.0, which has no sequences, Ligamen bakes them: the Setup frame becomes the image, and the keys become attachment keys at the skeleton's frame rate. Exports for 4.1 and later keep the sequence as it is.

From region to mesh#

A region is a rigid rectangle. To weight it to several bones or deform it by hand, it has to become a mesh. The Mesh half of the segment at the bottom of the panel does this: it replaces the region with a four-vertex mesh that looks exactly the same, in one undo step, and pressing it again returns a plain image. The same command is Convert region to mesh in the Add… menu of the slot's attachments, and Convert Region to Mesh in the Mesh panel. Edit Mesh is available once the picture is a mesh, and it enters vertex editing (M; Esc leaves).

Meshes, their vertices and their weights are the subject of the next article, Mesh.