spine-rigc 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/AUTHORING.md CHANGED
@@ -123,6 +123,8 @@ bun cli.ts check \
123
123
  # …and if nobody gave you frames, LOOK at it instead — neither needs a reference:
124
124
  bun cli.ts render --candidate path/to/spine # PNG frames + a contact sheet grid
125
125
  bun cli.ts preview --candidate path/to/spine # one .html that plays it in Spine's own player
126
+ # ↳ a green build ends by naming this command for its own --out; repeat
127
+ # --candidate for a pane per candidate on one page
126
128
 
127
129
  # …and where you have several green candidates and no instrument that separates
128
130
  # them, ask a human — the one loop step this toolchain cannot run for you:
@@ -141,6 +143,30 @@ the animation is the one in the frames, and there is no assertion that could —
141
143
  §9. The two run in that order because `check` needs artifacts on disk and `build`
142
144
  only writes them when the gate is green.
143
145
 
146
+ 🎞️ **When the source is a foreign player — a Live2D model, a Unity scene, a video —
147
+ make the reference frames first, from the source.** rigc reads none of those
148
+ formats and will not ([FACE.md](FACE.md#11-non-goals--stated-so-nobody-proposes-them-as-gaps)
149
+ §11, the paragraph that opens *No Live2D file is read or written*); what it reads
150
+ is the pictures they produce. Render the source at the rate you will check at into
151
+ one directory of `f0000.png`, `f0001.png`… named after the candidate animation it
152
+ shows (or pair the two with `--as`): `check` accepts a set with no `frames.json`
153
+ and takes its rate from `--fps` (§9). What that set cannot carry is its
154
+ **background**, which the sidecar would have recorded — so render it onto an
155
+ **opaque** background of the colour `check`'s no-`frames.json` note names, the one
156
+ after *"the background is this build's default,"*. Running `check` once on any
157
+ frame set with no sidecar prints it, so read it there before rendering rather than
158
+ from a copy here. The content box is found against that colour and alpha is not
159
+ read, so a reference that is not opaque is **refused**, naming the frames and the
160
+ first pixel whose alpha is not 255 (§9). A background that is opaque but another
161
+ colour is not refused and costs you: measured on the 24 frames of `gallery/look`'s
162
+ `turn`, the same drawn pixels read MAE mean **2.25** over the note's colour and
163
+ **5.19** over white, at exit 0 with the same notes. A port with no
164
+ reference frames is **unmeasured, not finished**: green from `build` says the file
165
+ is valid and nothing about whether it is the source's picture. And the parts are
166
+ the source's own texture cut along its drawables, **never a screenshot of it** — a
167
+ screenshot is the composed result, so a part cut from it carries every part under
168
+ it, which is what the first of the three questions under *LOOK* below finds.
169
+
144
170
  🚨 **Read `check`'s per-frame column before its MAE.** The table's headline figures
145
171
  are the MAE and the slot drift, and a reader who came for those will skip the
146
172
  `per-frame` line printed under them — but that line is the only thing in this
@@ -159,7 +185,7 @@ What the flags mean:
159
185
  | --- | --- |
160
186
  | `--rig` | the rig spec — skeleton structure |
161
187
  | `--motion` | the motion spec — time |
162
- | `--out` | directory for `skeleton.json` + `skeleton.atlas`; atlas page paths and `skeleton.images` are written relative to it |
188
+ | `--out` | directory for `skeleton.json` + `skeleton.atlas`; atlas page paths and `skeleton.images` are written relative to it. On `check` it is a directory of **pictures** instead: one per frame the table lists (every compared frame under `--all-frames`), reference · candidate · difference · overlay at the comparison grid's native size, as `<dir>/<set>/f####.png` beside a `frames.json` that says what they are pictures of. Each `<dir>/<set>/` is cleared first; a file at `<dir>`, or a directory that is or holds `--frames`, is refused by name — **§9.2.1** |
163
189
  | `--copy-images` | `build` only: also copies every page **the emitted atlas names** into `--out` and rewrites the atlas to the copies, so the directory is self-contained enough to zip or commit on its own, and points `skeleton.images` at `--out` itself so the editor's import finds the parts beside the skeleton (§3.1 says why it is spelled `../<out>/` and not `./`). Under `--atlas-in` those pages are the pack's, not one per part (**§0.2**). Without it, page paths point at the source art |
164
190
  | `--pack` | `build` only: arrange every part onto **shared** atlas page(s), written into `--out` as real PNGs, instead of one page per part. Lossless — nothing is resampled, trimmed or rotated. The default is one page per part — **§0.1** |
165
191
  | `--page-size` | `build --pack` only: the largest page edge (default `2048`). A ceiling, not the size: page edges are powers of two and the one written is the smallest that holds the pack — **§0.1** |
@@ -170,8 +196,8 @@ What the flags mean:
170
196
  | `--cut` | `build`, `explain` and `validate`: look up a named cut in `--cuts <cuts.json>`, **instead of** `--rig`/`--motion`/`--out` — the two spellings are one build stated two ways and are refused together. A `cuts.json` is `{ "<name>": { "rig": …, "motion": …, "out": …, "manifest"?: … } }`, every path in it relative to the table's own file, so the table lives with the project that owns the art |
171
197
  | `--cuts` | the `cuts.json` `--cut` names. Required beside it — `--cut` alone is refused, with no guess at where the table lives |
172
198
  | `--profile` | `spine` = the 34 validity rules (**the default**) · `spine-html` = all 49, opt-in |
173
- | `--candidate` | `check`, `bench`, `render`, `preview`, `chainfit` and `vote` only: a **compiled** artifact — the directory `build --out` wrote, or a `skeleton.json` path. `--atlas <path>` names the atlas when it does not sit beside the skeleton. **`vote` is the one command that takes it more than once** — repeat it 2–4 times, one per pane, labelled A, B, C, D in the order given; everywhere else a repeat is a typo and is refused |
174
- | `--animation` | `render`, `preview` and `vote` only: which animation to show. The default is **every** one for `render`, the **first** for `preview`, and for `vote` the first of candidate A. A name the skeleton does not have is refused, with the ones it does have listed — and for `vote`, so is a name that only *some* candidates have |
199
+ | `--candidate` | `check`, `bench`, `render`, `preview`, `chainfit` and `vote` only: a **compiled** artifact — the directory `build --out` wrote, or a `skeleton.json` path. `--atlas <path>` names the atlas when it does not sit beside the skeleton. **`vote` and `preview` take it more than once**: `vote` 2–4 times, one per pane, labelled A, B, C, D in the order given; `preview` any number of times, one pane per candidate in the order given, each headed by its path and its gate line, and the same skeleton twice (a directory and its `skeleton.json` are one) is refused by name. `--atlas` goes with one candidate only. Everywhere else a repeat is a typo and is refused |
200
+ | `--animation` | `render`, `preview` and `vote` only: which animation to show. The default is **every** one for `render`, the **first** for `preview` (each candidate's own first, with several), and for `vote` the first of candidate A. A name the skeleton does not have is refused, with the ones it does have listed — and for `vote` and a several-candidate `preview`, so is a name that only *some* candidates have, naming the one that lacks it |
175
201
  | `--record` | `vote` only: a saved vote to check against its ballot and append to the ledger, instead of writing a ballot. This is the command's second mode; it takes no `--candidate` |
176
202
  | `--ballot` | `vote --record` only: the ballot the vote answers (default `ballot.html`). Its embedded manifest is what the vote is checked against, so the ballot file is the record of the question |
177
203
  | `--ledger` | `vote --record` only: the append-only JSONL the vote lands in (default `votes.jsonl`), one vote per line |
@@ -191,7 +217,12 @@ What the flags mean:
191
217
 
192
218
  `render` also takes `--fps <n>` (the rate it samples at, default 12 — the same
193
219
  protocol rate the reference frames use) and `--max <px>` (the long side of a
194
- frame, default 256). Three commands take `--out`: a directory for `render`
220
+ frame, default 256). A clipping attachment is applied as the runtime applies it —
221
+ spine-core's own `SkeletonClipping`, in spine-webgl's call order — so a slot from
222
+ the clip's through its `end` slot draws only what falls inside the polygon, in
223
+ `render`, `check` and every other picture rigc's own rasteriser draws (`preview`
224
+ plays in Spine's player, which always clipped); the framing box still counts
225
+ what the clip removes, so adding or keying a mask moves no pixel it leaves drawn. Three commands take `--out`: a directory for `render`
195
226
  (default `render/`), the `.html` file for `preview` (default `preview.html`) and
196
227
  for `vote` (default `ballot.html`).
197
228
 
@@ -749,7 +780,8 @@ bun cli.ts diff candidate.json reference.json [--as <candidate>=<reference>]
749
780
  bun cli.ts check --candidate path/to/spine --frames path/to/frames [--skin …]
750
781
  bun cli.ts bench 3 --candidate path/to/spine [--frames path/to/frames]
751
782
  bun cli.ts render --candidate path/to/spine [--animation …] [--skin …] [--fps 12] [--max 256]
752
- bun cli.ts preview --candidate path/to/spine [--animation …] [--out preview.html]
783
+ bun cli.ts render --candidate path/to/spine --slot <name,…> | --hide <name,…> # part of the rig, same grid
784
+ bun cli.ts preview --candidate path/to/spine [--candidate path/to/another …] [--animation …] [--out preview.html]
753
785
  bun cli.ts vote --candidate path/to/a --candidate path/to/b [--out ballot.html]
754
786
  bun cli.ts vote --record vote-<id>.json [--ballot ballot.html] [--ledger votes.jsonl]
755
787
  bun cli.ts pose --images path/to/parts --frame poseA.png [--out pose.json]
@@ -824,12 +856,39 @@ bun cli.ts pose --images path/to/parts --frame poseA.png [--out pose.json]
824
856
  gate can know you did not mean them. `render` writes
825
857
  `render/<animation>/f0000.png…` with a `contact.png` grid of **every** frame
826
858
  beside them (open that one first — spacing is a comparison across frames) and a
827
- `frames.json` sidecar naming the world box they are pictures of. `preview`
859
+ `frames.json` sidecar naming the world box they are pictures of. `contact.png`
860
+ is for spacing across frames; a defect is read on **one frame at full size**,
861
+ because a tile is too small to say which part a pixel belongs to. When a frame
862
+ looks wrong, render it again with `--hide <slot>` — the **largest attachment**
863
+ first, since it covers the most and is the likeliest to hide what is under it —
864
+ and compare the two frames: `--hide` and `--slot <name,…>` draw a subset of the
865
+ slots on the **same grid** as the whole rig (the viewport is still fitted to
866
+ every slot), so the frames overlay pixel for pixel and the difference is the
867
+ part. Three questions to ask of that full-size frame, each answered that way.
868
+ **Is any picture drawn twice?** Hide the largest attachment and look for a second
869
+ copy of what it covered, since a ghost under an opaque part is invisible until the
870
+ part is gone. **Is there a straight edge where the art has none?** A part cut as a
871
+ rectangle carries a border its drawing never had, and `--slot <that slot>` shows it
872
+ alone. **Does a part cover a feature the art shows?** An eye slot drawn over the
873
+ eye is found by hiding the slot and watching the feature come back. A name the skeleton does not declare is refused with every slot it does,
874
+ in draw order; a slot whose art lives only under another skin is refused naming
875
+ that skin (pass `--skin`); the two flags together are refused. `frames.json`
876
+ records the subset as `slots` or `hidden`, and **`check` refuses such a set as
877
+ a reference** (§9). `preview`
828
878
  writes one self-contained `.html`: your skeleton, atlas and page PNGs are
829
879
  embedded in it as data URIs and played by the official **Spine Web Player**, so
830
880
  double-clicking it is also the interop proof — what plays there was played by
831
881
  Esoteric Software's runtime, not by rigc's. The player is loaded from a CDN
832
- rather than copied into the file, so the first open needs a network.
882
+ rather than copied into the file, so the first open needs a network. Its
883
+ header carries the gate's line for the candidate — the `N assertions: …`
884
+ summary `rigc validate <dir>` prints for the same files, and its first `FAIL`
885
+ line when there is one — with the rigc version, measured when the page is
886
+ written; a refused candidate is still previewed, because looking at a red
887
+ build is what the page is for. Note that it is the **bare-directory** reading:
888
+ with no rig spec and no second compile beside the files, `A09` and `A18` report
889
+ SKIP there, so its counts are not the ones `build` printed. It takes
890
+ neither `--slot` nor `--hide` — the player draws what the skeleton draws — and
891
+ refuses both by name rather than playing the whole rig as if it had obeyed.
833
892
  - 📐 **`pose` is the only command here that reads an INPUT rather than a result.**
834
893
  Everything else takes a spec or a build and tells you something about it; `pose`
835
894
  takes a picture the user already has — a key pose — and reports where each loose
@@ -6018,7 +6077,8 @@ rather than the rig (**§9.2**'s atlas floor — and note that it is *not* `--at
6018
6077
  which re-seats your geometry on that atlas's packing), `--skin <name>` to pose
6019
6078
  your candidate under one of its skins (below), `--all-frames` to list
6020
6079
  every frame instead of the worst by MAE, `--json <out>` for the whole per-frame,
6021
- per-slot report.
6080
+ per-slot report, `--out <dir>` for the picture each listed frame's figures came from
6081
+ (**§9.2.1**).
6022
6082
 
6023
6083
  🚨 **What `check` certifies is the DEFAULT skin, unless you pass `--skin`.** With no `--skin` no skin is set at all, which is `spine-core`'s own
6024
6084
  initial state: every slot resolves through `SkeletonData.defaultSkin` alone, and a
@@ -6056,6 +6116,21 @@ remember:
6056
6116
  A skin name the candidate does not declare is refused with the ones it does —
6057
6117
  `the candidate declares no skin "path"; it declares [default, patch, torn]`.
6058
6118
 
6119
+ 🚫 **A frame set of PART of a rig is not a reference.** `render --slot`/`--hide`
6120
+ (§0) records the subset in `frames.json`, and `check` refuses any set that carries
6121
+ `slots` or `hidden`, before posing anything:
6122
+
6123
+ ```
6124
+ rigc check error: --frames frames/ records a slot subset (hidden: head) in frames.json; a partial render is not a reference set — render the reference without --slot/--hide
6125
+ ```
6126
+
6127
+ It is the skin clause one step stronger: two skins are two pictures of one rig,
6128
+ while a reference with a part left out is not a picture of the whole rig at all,
6129
+ and scoring a whole candidate against it would print a real figure about art the
6130
+ reference never drew. There is no flag that makes it comparable. A set with
6131
+ neither key — every set rendered without the flags, and every set written before
6132
+ they existed — is compared exactly as before.
6133
+
6059
6134
  📌 **Deform measurement needs no such flag, because the timeline carries the
6060
6135
  name.** `A39` and the `DEFORM` block pose each key with the skin that key is keyed
6061
6136
  on — a deform timeline's address is a `skin / slot / attachment` triple — so a
@@ -6106,6 +6181,31 @@ sampled at, and without it the 12 fps protocol rate is assumed and the report sa
6106
6181
  so rather than letting the assumption look like a measurement. Passing `--fps` with
6107
6182
  a value the sidecar contradicts is an error, not an override.
6108
6183
 
6184
+ A set with no sidecar is one of two things, and the `⚠️ no frames.json` note says
6185
+ which advice goes with which: **a rigc render older than the sidecar** is fixed by
6186
+ rendering it again with `rigc render`, and **a foreign source** — a Live2D, Unity or
6187
+ video player, whose frames predate nothing — needs the three things the sidecar
6188
+ would have said, supplied by whoever made them: an opaque background of the colour
6189
+ the note names, `--fps` at the rate it was rendered, and a directory named after
6190
+ the candidate animation it shows or `--as <that animation>`. Two of those are
6191
+ refused by name when they are wrong, because a figure would come out of either:
6192
+
6193
+ ```
6194
+ rigc check error: --frames frames/turn has no frames.json, and 24 of its 24 compared reference frame(s) are not opaque (f0000.png, f0001.png, f0002.png, and 21 more): f0000.png has alpha 0 at (0, 0), where every pixel must be 255. Without a sidecar the frames are read against the background colour 232, 232, 232, 255 with alpha unread, so a pixel that is not opaque counts by its colour bytes alone: a transparent background counts as drawn and puts the figure over the whole frame, a number about the transparent area and not the rig, which --viewport does not change. Render the frames onto an opaque background of 232, 232, 232, 255.
6195
+ rigc check error: no reference frame could be compared, so there is nothing to frame against: the frames were matched to a candidate animation by name, and the candidate has no animation called "idle" (the directory's own name) — it declares [sweep, tilt, turn]. Pass --as <name> with the one these frames show, or name the directory after it
6196
+ ```
6197
+
6198
+ The test is every pixel's alpha, not the border's: a pixel that is not opaque is
6199
+ not yet a colour — what it shows depends on what it is composited over — so one
6200
+ pixel of alpha 254 in one frame is refused too, naming that frame and that pixel.
6201
+ The first is a refusal rather than a note because pinning does not rescue it:
6202
+ `--viewport` set to the box the frames were drawn in reads MAE **0.00** on the
6203
+ opaque set and **32.90** on the same set made transparent, on every one of its 24
6204
+ frames — the transparent area times its distance from the background colour, which
6205
+ is a figure about the background and not about the rig. `--as` takes **one**
6206
+ candidate animation name; the `<candidate>=<reference>` pair is `diff`'s spelling,
6207
+ and `check` refuses it as a name the candidate does not declare.
6208
+
6109
6209
  `--viewport <x>,<y>,<width>,<height>` pins your candidate's world box instead of
6110
6210
  fitting it. Two uses:
6111
6211
 
@@ -7001,6 +7101,66 @@ slots column is a parenthesis rather than a fraction, the deformation it carries
7001
7101
  already being scored inside the chain that owns the slot, and the row is telling you
7002
7102
  about your bone tree rather than about a hole in your figure.
7003
7103
 
7104
+ #### 9.2.1 Reading the pictures — `--out`
7105
+
7106
+ ```bash
7107
+ bun cli.ts check --candidate path/to/spine --frames path/to/reference/frames --out check-pictures
7108
+ ```
7109
+
7110
+ The table says **how much** a frame differs; `--out <dir>` writes **where**. For
7111
+ every frame the table lists — the frames worth reading, or every compared frame
7112
+ under `--all-frames` — it writes `<dir>/<set>/f####.png`, and beside them a
7113
+ `frames.json` recording what they are pictures of: the candidate, the frames
7114
+ directory, both skins, the framing scope, the grid, and per set the box it was
7115
+ framed in and which frames were written. Each picture is four panes, left to right:
7116
+
7117
+ | Pane | What it is | The figure in its label |
7118
+ | --- | --- | --- |
7119
+ | `REFERENCE` | the frame as read from `--frames` | `REF D` — the table's `ref Δ`: pixels the reference moved since its own previous frame (`-` when that frame was not compared) |
7120
+ | `CANDIDATE` | your candidate exactly as `check` rendered it onto that grid — same framing, same skin, same texture | `DPX` — the table's `Δpx`, the same count on your side |
7121
+ | `DIFFERENCE` | per pixel, the largest of the three channel differences between the two, on a **fixed** grey ramp: 0 is black, 255 is white. Drawn over exactly the pixels the MAE averages over — what your geometry covers or the reference drew — and transparent everywhere else | `MAE` — the frame's MAE, as the table prints it |
7122
+ | `OVERLAY` | the two at 50 % each, so a displaced edge reads as a double line and a part drawn twice reads as a ghost | `UNION` — the table's `union px` |
7123
+
7124
+ Under the panes, one row per slot of that frame: its drift at the table's
7125
+ precision and how it was matched, or why it has none (`not drawn`, `no attributable
7126
+ drift`). The frame's worst slot — the one its table row names — is marked `>`. The
7127
+ text is the tree's 5x7 bitmap font, so it prints in capitals, and a character the
7128
+ font does not carry draws as a solid block rather than disappearing.
7129
+
7130
+ - **The ramp is fixed, and deliberately not stretched to the frame's own maximum.**
7131
+ Two runs' pictures are then comparable by eye, and a quiet frame looks quiet. The
7132
+ cost is the other side of the same choice: a frame whose MAE is a texture floor
7133
+ of a few points reads as a **near-black silhouette** of the union, because 7 of
7134
+ 255 is dark. That silhouette is not nothing — it is where the two sides drew —
7135
+ and the grey you have to find is the difference you have to fix.
7136
+ - **Every pane is at the grid's native size, and there is no upscaling option.** An
7137
+ upscaled difference is a difference the instrument invented: a resampling filter
7138
+ spreads ink into pixels the comparison never measured. Open the file and zoom in
7139
+ your viewer instead, where the magnification is yours and visibly not the data.
7140
+ - **Nothing in a picture is a new number.** Every figure in it is one the report
7141
+ already holds. The rasters are the ones the figures were computed on, kept at the
7142
+ moment they were compared rather than rendered again.
7143
+
7144
+ What a picture cannot tell you, and does not try to:
7145
+
7146
+ - **Which side is right.** The difference pane is symmetric. A pixel lit there is
7147
+ a pixel the two disagree about; whether yours or the reference's is the one to
7148
+ move is yours to read off the other panes.
7149
+ - **Anything about a frame it does not show.** The set is the table's listing, so
7150
+ a frame outside it was not pictured — not pictured clean. `--all-frames` widens
7151
+ the set to every compared frame when the listing is not enough.
7152
+
7153
+ `<dir>/<set>/` is cleared and rewritten, as `render` clears its own, and nothing
7154
+ else under `<dir>` is touched. Two things are refused before anything is compared:
7155
+ a **file** at `<dir>` (`check: --out <path> is a file; it names a directory`), and a
7156
+ directory that **is `--frames` or holds it** (`check: --out <path> is --frames …` /
7157
+ `… holds --frames …`), because clearing a set directory there deletes the frames the
7158
+ pictures are of. And a `check --out` directory is not a frame set: pointed at by
7159
+ `--frames`, it is refused by the field that says so —
7160
+ `` frames.json carries "comparison": it was written by `rigc check --out` `` and the
7161
+ rest of the sentence names the frames it was made against. The reference pane inside each
7162
+ picture is a frame; the file is four panes and a table.
7163
+
7004
7164
  ### 9.3 What it still cannot see
7005
7165
 
7006
7166
  - **Anything a frame does not contain.** Bone `length`, the setup `inherit` mode,
package/docs/MOTION.md CHANGED
@@ -1007,6 +1007,7 @@ rigc build --rig semaphore.rig.json --motion semaphore.motion.json --images part
1007
1007
  .. pages=3 regions=3 bones=4 slots=3 animations=1 version=4.3.13 regionAttachments=3 meshAttachments=0 physicsConstraints=0 rig=semaphore profile=spine
1008
1008
  rigc: wrote …/semaphore/spine/skeleton.json
1009
1009
  rigc: wrote …/semaphore/spine/skeleton.atlas
1010
+ rigc: look at it: rigc preview --candidate …/semaphore/spine
1010
1011
  ```
1011
1012
 
1012
1013
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-rigc",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Rig compiler for Spine — declarative rig specs in, Spine 4.3 skeleton data out, verified by a spine-core round-trip. Built so AI agents can author rigs and check their own work; the output imports into the Spine editor.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: rigc
3
- description: Author, build and validate Spine 4.3 skeleton data (skeleton.json plus its .atlas) from loose part PNGs with rigc, the rig compiler that verifies its own output through a spine-core round-trip before writing it. Use for any request to make a Spine rig or Spine animation from PNG parts, to run or read rigc build, validate, render, preview, check or vote, or to write or fix a *.rig.json or *.motion.json spec; it says which shipped guide to open for the need at hand. Not for Live2D conversion, cutting an illustration into parts, or real-time face tracking.
3
+ description: Author, build and validate Spine 4.3 skeleton data (skeleton.json plus its .atlas) from loose part PNGs with rigc, the rig compiler that verifies its own output through a spine-core round-trip before writing it. Use for any request to make a Spine rig or Spine animation from PNG parts, or where the source is a Live2D, Unity or video model whose pictures you can render, to run or read rigc build, validate, render, preview, check or vote, or to write or fix a *.rig.json or *.motion.json spec; it says which shipped guide to open for the need at hand. Not for Live2D conversion, cutting an illustration into parts, or real-time face tracking.
4
4
  license: MIT
5
5
  compatibility: Requires Bun 1.2 or later. The tool is the npm package spine-rigc (bunx spine-rigc, or bun add -d spine-rigc); the command it installs is rigc.
6
6
  ---
@@ -55,15 +55,38 @@ skill the package ships there, and `rigc skills --help` says what it refuses.
55
55
  §4.11.2.
56
56
  4. `rigc render --candidate <out>` or `rigc preview --candidate <out>` — look at
57
57
  it. A rig with its head off its torso passes the gate; looking is what catches it.
58
- 5. `rigc check --candidate <out> --frames <dir>` when you have reference pictures;
58
+ Open one frame at full size, not only `contact.png`: the sheet is for spacing
59
+ across frames, and a defect is read on a frame. Ask it three things — is any
60
+ picture drawn twice, is there a straight edge where the art has none, does a part
61
+ cover a feature the art shows — and answer each with `render --hide <slot>` (or
62
+ `--slot <slot,…>`), which draws the frame again without that part on the same
63
+ grid, so the two frames say which part a pixel is. AUTHORING §0 holds the three.
64
+ 5. `rigc check --candidate <out> --frames <dir>` when you have reference pictures
65
+ (`--out <dir>` writes the picture each of its numbers came from — open the worst);
59
66
  `rigc vote --candidate <a> --candidate <b>` when several candidates are green and
60
67
  only a person can choose between them.
61
68
  6. `rigc validate <out>` re-gates artifacts already on disk, and
62
69
  `rigc <command> --help` is each command's own flag table.
70
+ 7. Every finished unit ends with `rigc preview --candidate <out>`, and the report
71
+ names the `.html` it wrote. The hand-off to a person is part of the work.
63
72
 
64
73
  The loop in full, with `pose` before it and `chainfit` after the first build:
65
74
  AUTHORING §0.
66
75
 
76
+ ## When the source is not loose PNGs
77
+
78
+ A Live2D model, a Unity scene or a video is a player, not a set of parts. Make the
79
+ reference frames first: render the source at the rate you will check at, into one
80
+ directory of `f0000.png`, `f0001.png`…, and `rigc check --frames <that dir> --fps <rate>`
81
+ reads them with no `frames.json`. A port with no reference frames is unmeasured,
82
+ not finished. The parts are the source's own texture cut along its drawables, never
83
+ a screenshot: a screenshot is the composed result, and a part cut from it carries
84
+ every part under it. rigc reads none of those formats — FACE §11, the paragraph
85
+ that opens *No Live2D file is read or written*
86
+ ([FACE.md](https://github.com/firejune/rigc/blob/main/docs/FACE.md#11-non-goals--stated-so-nobody-proposes-them-as-gaps)) —
87
+ only the pictures they produce. The rule, the background those frames need and
88
+ what a wrong one costs: AUTHORING §0, *When the source is a foreign player*.
89
+
67
90
  ## Which guide, for which need
68
91
 
69
92
  Read [AUTHORING.md](https://github.com/firejune/rigc/blob/main/docs/AUTHORING.md) first, whatever the need: the two
package/src/ballot.ts CHANGED
@@ -63,6 +63,9 @@ import {
63
63
  dataUri,
64
64
  embeddedJson,
65
65
  escapeHtml,
66
+ PANE_STAGE_CSS,
67
+ paneGridCss,
68
+ paneSection,
66
69
  PLAYER_LINE,
67
70
  PLAYER_SCRIPT_URL,
68
71
  PLAYER_STYLE_URL,
@@ -592,14 +595,10 @@ export function buildBallot(input: BallotInput): { html: string; manifest: Ballo
592
595
  },
593
596
  };
594
597
 
595
- const panes = manifest.candidates
596
- .map(
597
- (c) => `<section class="pane">
598
- <h2>${c.label}</h2>
599
- <div class="stage" id="rigc-player-${c.label}"></div>
600
- </section>`,
601
- )
602
- .join('\n');
598
+ // The pane markup and its grid are `preview.ts`'s since issue #837, which
599
+ // borrowed them for a page of panes that asks nothing; the bytes here are
600
+ // the ones this page always wrote.
601
+ const panes = manifest.candidates.map((c) => paneSection(`rigc-player-${c.label}`, `<h2>${c.label}</h2>`)).join('\n');
603
602
 
604
603
  const choices = [...labels, TIE]
605
604
  .map(
@@ -649,11 +648,9 @@ export function buildBallot(input: BallotInput): { html: string; manifest: Ballo
649
648
  button { font: inherit; padding: 4px 12px; border: 1px solid rgba(0, 0, 0, 0.35); border-radius: 4px; background: rgba(255, 255, 255, 0.6); cursor: pointer; }
650
649
  button:hover { background: rgba(255, 255, 255, 0.95); }
651
650
  button[aria-pressed="true"] { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
652
- #panes { display: grid; grid-template-columns: repeat(${manifest.candidates.length}, minmax(0, 1fr)); gap: 1px; background: rgba(0, 0, 0, 0.15); }
653
- @media (max-width: 720px) { #panes { grid-template-columns: minmax(0, 1fr); } }
654
- .pane { background: ${backgroundHex()}; display: flex; flex-direction: column; min-width: 0; }
651
+ ${paneGridCss(manifest.candidates.length)}
655
652
  .pane h2 { margin: 0; padding: 6px 14px; font-size: 15px; letter-spacing: 0.12em; }
656
- .stage { height: 52vh; min-height: 260px; }
653
+ ${PANE_STAGE_CSS}
657
654
  #vote { border-top: 1px solid rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; gap: 10px; }
658
655
  .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
659
656
  .row > label, .caption { opacity: 0.65; }