pantin

Images and meshes

The skeleton is dressed with images: each is hung on a bone and moves with it. A mesh cuts an image into triangles carried by several bones, so that it bends at a joint instead of breaking.

15 minutesSetup modeExamples: robot, tail, flag, banner

Images on the bones

The tab Images lists the PNG and SVG files of the project folder, with a thumbnail and the pieces that use each. Drag one onto a bone of the canvas: it becomes a piece of that bone, centred where you let it go. + Image… under Pieces, in the panel of a bone, takes a file too.

Once a piece is chosen (in the tree, under its bone, or in Pieces), Move, Rotate and Scale act on the piece and not on its bone. An image stands as it is drawn, whichever way its bone points: draw your pieces upright. A file changed by another program is read again within half a second: draw in your usual tool and see it in pantin.

From a PSD, or another tool

File › Import › PSD layers… makes a piece of each visible layer of a PSD, where it was drawn; what pantin cannot read of a layer is said, never dropped in silence.

Tags in brackets in the names of layers and groups say more, and are taken out of the names:

  • [bone] on a group makes a bone of its name, the layers in it put on it, inside the bone of a group around it; on a layer, a bone for that layer alone. The bone is at the centre of what the group holds, or at the centre of a layer of it tagged [origin], which is not imported. A bone of that name already in the project is used as it is.
  • [merge] on a group draws its layers together as one image, named after the group.
  • [scale:0.5] writes the image at that many times its pixels, shown at the same size: a PSD painted large gives lighter images.
  • [rotate:30] says the layer was painted turned by that many degrees, counter-clockwise: its image is written upright and its piece turned to show it as it was painted.
  • [ignore] leaves a layer or a group out. A tag pantin does not know is said.

The project remembers each PSD it imported, and which layer each image is: the panel of a piece says its file and its layer. Painted over, the PSD is read again by File › Import › Read the PSD files again, or by importing it again: a changed layer replaces the image of its piece, which keeps its bone, its mesh and its keys; a new layer comes as a new piece; and the pieces whose layer is gone are listed, to be deleted in one click or kept. Each reading is one undo.

File › Import › A skeleton exported as JSON… makes a project of a character exported by another tool of skeletal animation (versions 2 to 4.2 of that export), its images cut out of its atlas; a skeleton exported as binary (.skel) is chosen in the same window. The command line does the same, pantin import-json skeleton.json.

Colours, blending, order

The panel of a piece gives it a Colour that tints it, a Dark colour that its dark parts take, and a Blend mode: normal, additive (a glow), multiply (a shadow) or screen. Pieces are drawn back to front: To front and To back move a piece in the order.

  • Skins: + Skin makes another set of images for the same skeleton, a costume. A skin is not keyed: a game chooses one and changes it when it likes. In the editor, Shown in the section Skins, at the bottom of the right panel, chooses the one the viewport shows; it is open when the project has several. The example outfits is a knight in the skin default and a wizard in the skin wizard. With several, Compare shows a table of what each skin gives each piece; a skin dragged onto another (or Merge into…) adds the images that one has not, one undo, those both have kept and said; a click on a skin pins it, and Pinned only narrows the lists to the skins pinned.
    A bone or a constraint can belong to some skins: Skins, in the panel of a bone or under a constraint, chooses them, and the panel of a skin lists what it has (Give it the selected bone, Take out). It is there only while one of them is shown: a bone that is not there draws nothing, nor does what hangs from it, and a constraint that is not there is not solved. The wizard of outfits has a beard on a bone only his skin has. With Any shown, nothing that names skins is there.
  • Frames: + Frames… lets a piece step through more images, as a flipbook, keyed in Animate mode.

Meshes

  1. Choose a piece. Under the bar, set a Grid of columns and rows and press Make mesh: the image is cut into a grid of triangles. Or Trace follows the edge of what is opaque; Evenness says how even its vertices are, none inside at the left, small even triangles at the right.
  2. The Mesh tool (M) shows its vertices. A click on one chooses it (Shift: several); a frame drawn off them chooses those inside (Alt: a lasso). A click on the mesh adds a vertex, Delete takes the chosen ones away.
  3. Move drags the chosen vertices together; Rotate and Scale turn and scale them around their centre. The panel types their place, and lines them up as it lines up bones.
  4. Symmetry, in the line under the bar, gives a vertex added or moved its twin across the bone, or across an upright line.

Several at once

With several bones selected (Shift and a click), the options under the bar act on every image of theirs: Make 4 meshes cuts them all into grids, Trace 4 traces them all, in one undo. With Every mesh under the brush, in the Weights panel, a stroke of the Weights tool paints every mesh it passes over, also one undo.

Linked meshes

Another image can bend as a mesh that is there: the other side of a flag, a sleeve of another colour, a face for each expression. It takes the vertices, the triangles and the weights of that mesh, with its own image of the same size, and a change to the mesh is seen in both.

  1. Choose the piece of the image. In its panel, Bends as chooses the mesh: it is linked.
  2. Its keys of vertices move this one too: the keys of the vertices of that mesh, on the same piece, move it as well. It is ticked when it is linked.
  3. Its vertices are edited on the mesh it bends as. Unlink gives it a copy of its own.

A mesh that others bend as cannot be deleted while they do. The MCP's link_mesh does the same, and the example banner shows it.

Weights

Each vertex of a mesh is carried by one or more bones, each by a share; the shares of a vertex add up to one. Bind to bones, in the panel of the mesh, shares it between the bones near it.

  1. Choose the mesh, then the Weights tool (J).
  2. Select in the tree the bone whose share you paint: with this tool the mesh stays chosen.
  3. Paint over the vertices: the share of that bone grows there, warm where it carries all, and the other bones keep theirs in their proportion. A click on a vertex types its shares. A stroke is one undo. Every mesh under the brush paints the other meshes it passes over too.

The panel works them out too, on the chosen vertices or on every one, each one undo: Even out gives each vertex the mean of itself and its neighbours; Prune leaves no share under its threshold and at most so many bones a vertex, what is taken going to the bones kept; Weld gives the vertices at one place one weighting. Lock the selected bone keeps its shares while the others are painted, worked out or bound again. The MCP's weigh_mesh does the same.

Parameters that deform meshes

A parameter is a number that deforms meshes, set by a game or by the graph of states rather than keyed in time: a head that turns, a mouth that opens, a chest that breathes. For each key of a parameter, at one of its values, the meshes take a shape; between keys the shapes are blended, from nothing at the value it rests at, and the shapes of all the parameters are added to the keys of the vertices of the animation.

  1. Open the tab Deform and press + Parameter: a number from -1 to 1, at rest at 0. Its panel names it and sets its range and its value at rest.
  2. Choose a mesh in the tree, and set the parameter at a value with its slider.
  3. The Shape tool (V) drags a vertex of the mesh: the shape at that value, a key made there when there is none. Each drag is one undo.
  4. The slider of every parameter shows the character at those values in every workspace; All at rest puts them back. They are not saved: a game sets them, with set_parameter, or a number of its graph of the same name. The example turn shows it.

Masks

+ Mask, in the panel of a bone, puts a shape on it that cuts the pieces drawn after it, every one or up to the one Cuts up to says: a mouth inside a head, a hand in a pocket.

Under Keeps, What is outside it turns a mask round: it hides what is inside it, a hole or a window seen from the other side; By its convex hull cuts by the shape that wraps its corners, whatever their order. A mask imported from another tool may have its corners carried by several bones, as the vertices of a mesh are: the panel says so, and Carried by its bone only puts them back on the bone of the mask, where they are, to be moved by hand.

Keys

MThe Mesh tool
JThe Weights tool
Shift, Alt with the Mesh toolSeveral vertices; a lasso instead of a frame