Latest published (npm at build time)@rig-c/parts 2.73.0github.com/rig-c/partsnpm

@rig-c/parts

One painting and its See-through layers in — measured parts, a drafted rig and a looping idle out.

Recorded video Character 1's 17 parts from out/parts/. The assembled figure that opens and closes the loop is drawn at the positions parts.json records, in the rig's draw order; the labelled grid and the dissolves between them are this page's illustration.

Skip to Install · Inputs and outputs · Limits · Docs

Cutting a painted character into rig parts is slow, and the mistakes show up late: a layer holds the wrong pixels, a part leaves a hole, a chain swings a skirt about its middle. rig-parts measures each of these and prints the number, so an agent that cannot see the image can still tell where it went wrong. A refusal names the object, the value found and the value required; nothing is written after a red, and no value is invented where the input is silent.

How Character 1 was made

1. Two See-through runs

A sheet of every See-through layer of Character 1, each labelled with its tag, size and opaque pixel count
The layers See-through returned — one run on the full figure, one on a square crop around the head, because a full-figure run leaves the eyes too small to separate. Each tile is labelled with its tag, size and opaque pixels.

2. Parts, and what they miss

assemble merges the two runs into rig-space parts, then lays them back together and compares the result with the painting. The error map is the point of that step: it shows, in colour, the painting that no part holds.

Character 1's painting
The painting
The 17 parts laid back together
The 17 parts, recomposited
Error map: the figure in grey with thin red and blue edges where the parts and the painting differ
The error map
Close-up of the painting: Character 1's left hand resting on her forearm
The painting, around the resting hand
The same close-up on the error map: a thin red line along the hand and sleeve edge, with a few blue pixels
The error map there: red is painting no part holds, blue is a part whose colour is more than 40 off

For this build parts.json records a mean difference of 0.873 per pixel, 98.3% of pixels within 8, and 6,041 uncovered error pixels. The largest hole it lists is 834 px along the edge of bottomwear. A clean recomposite is what lets the rig move without showing the background through.

3. A drafted rig that idles

propose drafts bones, weighted meshes, regions and a looping idle over those parts, for a person or an agent to correct; build runs assemble, rig and check in one process and stops at the first refusal.

Animation: Character 1 standing, breathing in its idle loop
Animation The idle, as build --loop wrote it: 41 frames at 12 fps, 0 to 3.33 s with both ends included. Here the same build plays the 3.33 s loop (40 frames, the 41st being where it wraps), drawn by @rig-c/play 1.12.0 over the page rather than by rigc render. With reduced motion on, the first frame stands still.
A contact sheet of the idle's 41 frames
check's contact sheet of the same idle — what the measured bars read.

The idle then goes on: Pose gives the same rig a recorded motion, and Core is the compiler every one of these builds went through.

How it works

  1. Inputs. inputs cuts the two images See-through is fed: the painting on a white square, and a square crop around the head.
  2. Layers. You run See-through by any route — a hosted demo, the upstream CLI, or ComfyUI. rig-parts reads its .psd or the ComfyUI wrapper form; an artist's own layered PSD works too, with no See-through step.
  3. Assemble. The two runs merge into rig-space parts; uncovered holes are listed and the error map shows them.
  4. Propose. Bones, meshes, regions and an idle are drafted with an overlay to correct against. It is a draft, not a step of build: you copy its sections into config.json, and LINT lines flag what still looks wrong.
  5. Build. Assemble, rig and check in one process; compiling, gating and packing are rig-c's.

Key terms. See-through layers — the painting's decomposition, one run on the full figure and one on the head. Parts — the merged, measured pieces in rig space (parts.json). Proposal — the drafted bones, meshes, regions and motion, to be corrected. Config — config.json, the character's part plan, head box, bones and idle; unknown or missing fields are refused by name. FAIL line — a refusal that names a rule and ends with (see rig-parts guide <RULE>).

Depth-driven head turns

The released 2.x package gives a rig a per-part depth sheet for every part that turns, so a painted head reads as having volume when its yaw_dial and pitch_dial move — the effect the head-turn demo shows. The feature page, written for a person deciding and trying, is docs/DEPTH.md; the two routes it describes are:

  1. See-through's own sheets. Enable config.depth and declare the sheets' polarity (near) and positive world-unit scale (zScale). See-through's sheets use near: "black"; a fallback sheet declares its own polarity and scale. A filename hint alone does not enable depth input, and a missing declared sheet is an error. assemble registers the sheets with the parts.
  2. Per-part maps from a depth model you run. Two explicit stages sit between assemble and rig: depth-prepare writes one inference image per part on neutral grey with a source-hashed manifest, and depth-apply turns the model's floating-point maps (or signed normals for the face) into sheets at the medians and reliefs you declare, writing a relocated assembled directory and depth-report.json. Neither stage carries a model, weights or downloads. In side-by-side review this route read better than a single map of the whole painting.

Either way, declare config.turn.roles: at least one surface becomes a depth-sampled Core grid (or an authored weighted mesh keeps its skinning and takes per-vertex depth offsets); unit features move together at sampled or declared depths; rear parts follow the rear carrier. turn.body.roles adds an independent body yaw. The rig stage writes padded sheets and depth_sheets.json, and turn and tilt animations driven by yaw_dial / pitch_dial (body_yaw_dial for the body).

The config contract documents the grid, pivot, rear counter-motion and refusals; the per-part map contract documents the recipe, the map format and the DEPTH_* refusals. All turn-bound sheets in a group must share a polarity and scale. Surface grids default to 13 × 16 cells and are limited to 2,400 triangles per slot and 4,000 across surfaces. These are producer limits; the much denser standalone head-turn demo is a separate implementation. An upright head is an input requirement: the rig stage warns by name (RIG_TURN_HEAD_ROLL) when the eye line it reads is rolled.

Install

npm i -D @rig-c/parts
rig-parts --help

The published package declares Bun 1.4.0 or later; @rig-c/core comes with it as a dependency. Which Spine terms apply depends on what plays the output: see Licensing.

Inputs and outputs

InOut
One character painting (painting.png)check/build/skeleton.json, skeleton.atlas, skeleton.png — Spine 4.3 data and one packed page
Two See-through layer sets (full, head), as the ComfyUI wrapper form or a .psdparts/*.png, parts.json, the recomposite and its error map
A character config (config.json)rig/rig.json, rig/motion.json in rig-c's spec
Optional body-18 keypoints for propose --keypointscheck/: both gate files, the idle's frames, contact.png, check.json; with --loop, the idle as APNG and GIF

Limits

From the 2.0.3 README, authoring contract and depth feature page:

  • Legacy turns use one ordering depth per layer. A layer that crosses another can look right in the still and wrong in motion. The opt-in depth-sheet producer samples a surface per pixel instead; it does not turn the layer stack into unrestricted 3D geometry or supply unseen artwork. An authored weighted mesh becomes a depth-sampled surface only when turn.roles declares it one.
  • A single drawing has a turn range. The default rated band is ±15° yaw and ±12° pitch. Going beyond it requires a declared alternate face drawing; depth samples alone do not draw the hidden side.
  • Depth is estimated elsewhere. depth-prepare and depth-apply carry no model; the author runs the depth estimation and declares each part's median and relief. The report measures the sheet it wrote, not the shape's quality.
  • No expression or lip-sync, and no jiggle. The mouth is one layer; nothing here proposes, keys or judges a soft region.
  • Occluded pixels are See-through's synthesis, not the artist's.
  • No success rate is claimed — ten characters measured stage by stage is an existence proof, not a rate.
  • No WebP: loop writes GIF and APNG.
  • The proposer reads tags, not pictures, and reads the torso by screen y unless it is given keypoints; it does not estimate a pose itself.

Go deeper