Ligamen

Attachments

Path

A path attachment is a Bezier curve that lives in a slot. It draws nothing in the game: its job is to be a track. Bones ride along it through a path constraint, so a chain of bones can bend like a snake, a train can follow its rails, and a tail can trace a spline. In the editor the curve is shown as an orange line with round anchors and handles. A path belongs to a bone, can be reshaped and weighted, and can be keyed in Animate. This article explains how to create a path, how its points and handles work, how to edit the curve, what the Closed and Constant speed switches do, and how a path behaves in an animation.

Edit Path

Creating a path#

In the Tree, open the New... menu on a bone and choose Path. A dialog asks for a name, and the suggestion starts with the bone name. Press Create and Ligamen adds a new slot under the bone, puts the path in it as the slot's attachment and selects it. The slot and the path share a name. You can also right-click an existing slot and choose New Path to add the curve to that slot (see Slots). Creating a path is one undo step.

The new path is an open S-curve of three anchors, 200 pixels wide and centred on the bone's origin, so it is visible at once. Its points are stored in the local space of the slot's bone (see Bones): move or rotate the bone and the whole curve moves with it. A path is not drawn in the game, so unlike a clipping it does not matter where its slot stands in the draw order.

Points, handles and curves#

A path is a chain of cubic Bezier curves. Each anchor is a point the curve passes through, and every anchor has two handles, an in-handle before it and an out-handle after it. The handles are not on the curve. They pull it: the longer a handle, the longer the curve keeps going in its direction before it turns. An open path with N anchors has N−1 curves. The first in-handle and the last out-handle are not used, since there is no curve on that side.

In the viewport the anchors are round and the handles are drawn as lines from the anchor to a small tip. The Properties panel counts the anchors for you, and the number of curves follows from it (see User interface). A path always keeps at least two anchors, because a single point is not a curve.

Editing the curve#

A new path opens in Edit Path immediately. For an existing one, select its row in the Tree and press Edit Path in the card or in the toolbar at the bottom of the viewport. The curve is edited in Setup mode. Drag an anchor to move it together with its handles. Drag a handle to turn it: by default the opposite handle turns with it, so the curve stays smooth, and its length is kept. Hold Alt while dragging to break the handle away from its twin and make a corner. Each drag is one undo step.

Double-click the curve to insert an anchor there. The curve is split at that spot with its shape unchanged, so you can add a point and then bend it. Double-click an anchor or a handle to delete the whole point, unless only two anchors are left, in which case the status line tells you that the path needs at least two points.

The Create button turns on the mode where a click on empty space appends an anchor after the last one. Hold the mouse button and drag after the click, and the handles of the new point are pulled out, as with a pen tool. The new anchor is smooth, and the previous end handle is turned toward it. When the pointer comes close to the first anchor, the cursor turns into a hand, and a click there closes the path and leaves the mode.

A click on the curve selects the path, even where the curve runs along a bone. Leave the mode with the cross in the card, with Esc, or by pressing Edit Path again. Selecting something else in the Tree or switching to Animate also leaves it. In the card, Display has a Select toggle that turns picking off once the curve is placed, and Options has Export, which leaves the path out of exported files.

Closed and Constant speed#

Two switches in the Curve section of Properties are available in Setup only, and each is one undo step. The same switches are in the card of the Tree under Options.

Closed joins the last anchor back to the first with one more curve. A closed path has as many curves as anchors, and a constraint that runs past the end wraps around to the start. Use it for a track, a wheel or a ring. On a closed path, the closing curve passes through every anchor you append afterwards.

Constant speed decides how a position along the path maps to distance. Off, Ligamen uses the lengths stored with the path in Setup and spreads motion over each curve evenly, so the speed rises where a curve is long and handles are stretched. On, lengths are measured from the current shape, curve by curve, so a bone moves at an even speed whatever the handles do. Measuring is cheap and gives the same result when you scrub, play or export. A new path has Constant speed on and Closed off. If you do not know which to choose, keep it on for anything that must travel at a steady pace.

What the panels show#

The Properties panel has a Path section with the Name and the Slot, and a Curve section with the two switches and four facts. Points is the number of anchors, or Weighted when the path is bound to several bones. Curves is the number of Bezier segments. Length is the setup length in pixels, and Used by lists the path constraints that follow this path, or none. A path that nothing uses is a quick thing to find here.

The card at the top of the Tree shows the same Length in a read-only field, together with Display, Options, Color and the Edit Path button. The Tree draws the path in its own row under the slot, and the type filter has a Path entry to show or hide these rows. Color changes the colour of the curve in the editor. The default is Spine's orange, and the colour never reaches the game.

Weights, animation and constraints#

A path can be weighted to several bones, like a mesh (see Weights). Select the slot, open the Weights panel and use Auto, Smooth and the brushes with the vertices of the curve. The points then follow the bones that move them, so a track can bend with a spine or a rope. Anchors and handles of a weighted path stay editable in Setup, and a point you add or drag keeps its weights.

In Animate mode the path follows its bone. To change the shape itself, select the path and drag a point, which records a deform key (see Keys). Between keys the curve is interpolated, and everything that rides on it follows the animated shape. The Closed and Constant speed switches are fixed in Setup and are not keyed.

A path does nothing until a path constraint uses it: select the bones that should ride along, choose New..., then Path Constraint in the Tree, and pick the slot with the path. The constraint takes the visible path of that slot in any skin. Weighted paths and their deform keys are written to Spine JSON, to the binary skeleton and to the Unity package, and a path with Export off is left out of all of them.