Rig a character from a picture or PSD

Turn your character art into a rigged Rive character: cut into parts along its own outlines, joints placed where the parts meet, bones built, bending parts meshed, and an idle to start with. A set of walk frames can become one rig with bone keyframes instead of a flipbook.

You bring
A layered PSD (best), a parts sheet from your image model, one character picture, or a set of animation frames.
You get
A .riv with bones, meshes and animation, plus the parts as PNGs and a manifest.
Needs
The npm install to cut pictures and read PSDs. Assembling parts you already have works in the one-click extension too.

Ask your assistant

  • Rig this character (hero.png) so the head and arms move, and give it an idle.
  • Turn my layered PSD into a rigged Rive character.
  • These 8 walk frames: make one rigged character that walks, not a flipbook.
  • Make the fox's tail wag and its ears twitch.

How it works

From a layered PSD

import_psd_layers makes each layer (or each group) a part, in place and in its stacking order, with shading layers clipped to a part merged into it. assemble_character builds the rig.

From a parts sheet

sprite_art_brief in parts mode asks your image model to draw the character's parts apart on one sheet, and lists the follow-up steps.

From one picture

  1. figure_regions numbers the picture's regions, following its strokes and colour changes. Your assistant looks at the numbered picture and decides which regions make each part, and whether each part is drawn over its parent (a near arm) or behind it (a far leg, a tail).
  2. segment_character cuts each part along its own regions. Every pixel goes to exactly one part, so at rest the rig looks exactly like the picture. Where an arm covered the body, the body is filled in, so turning the arm shows body, not a hole. Joints are placed where parts meet; a picture marks each one, and a wrong one gets a pivot by hand.
  3. assemble_character adds the bones, meshes and an idle animation.

From animation frames

frames_to_rig cuts one frame, where the limbs are apart, into parts, then poses that rig to draw every other frame. The result is one .riv with a bone animation: one set of art, a much smaller file, and motion that eases between the drawn poses.

  • Parts found by how they move. Game sprites often draw an arm in the body's own colours and outline, so cutting by colour leaves arm, body and leg as one piece. Give no parts and frames_to_rig finds them from the clip itself: pixels that move together are one part, whatever their colour. Each part hangs from the one it turns against, with its joint where the two meet, drawn in front or behind as the frames show it. figure_regions with the clip's frames numbers these parts, so your assistant can name them (head, near arm…).
  • Nothing left behind. Where an arm covered the body in the frame the rig was cut from, the body under it is taken from the frames where the arm has swung away, so a moving arm shows the real body, not a guess or a hole.
  • No limb flipping. Each frame is fitted again from the pose of the frame most like it, and a limb that jumps against the frames either side is fitted again between them.
  • An honest score. The answer opens with a verdict: GOOD (every frame at least 0.93 outline overlap, close in colour, and the lines across the body where the frame has them), FAIR or POOR, and why. The fit sheet shows each frame beside the rig posed to match it, the frames that are off marked in red.
  • A one-shot (a slash, a jump) is written to play once with loop: false.

Bending parts: hair, tails, cloth, ears

Check it

Good to know

  • Characters with limbs clearly apart from the body cut cleanest. From a clip, pick (or let it pick) a frame where the limbs are apart: a part hidden in that frame can't be cut from it. A far arm that stays behind the body in every frame comes out as just its hand, so half a step later the hands can swap; the verdict says which frames.
  • A line you add to split two parts (figure_regions cuts) must run from edge to edge. One that stops short is reported, with where to extend it.
  • Parts turn only at their joints. A frame where a limb bends, gets shorter or turns toward the camera can't be drawn by turning parts; the verdict and the fit sheet show which. Pixel walks often repaint the legs every frame: those fit only roughly (FAIR). Keep that animation as a flipbook (Video clip to sprite animation).
  • Pixel-art characters have their own rig, with crisp turns and no blur: Animate a pixel character.

Related