rig-parts 2.55.0 → 2.57.0
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/README.md +83 -196
- package/cli.ts +55 -9
- package/docs/AUTHORING.md +221 -25
- package/docs/MIGRATION.md +2 -2
- package/docs/PAINTING.md +1 -1
- package/docs/STABILITY.md +76 -15
- package/package.json +1 -1
- package/src/build.ts +27 -8
- package/src/bustlandmarks.ts +118 -22
- package/src/check.ts +9 -9
- package/src/config.ts +134 -3
- package/src/configrelocation.ts +3 -0
- package/src/depthworkflow.ts +7 -1
- package/src/outputpaths.ts +107 -0
- package/src/rig.ts +56 -5
- package/src/runstamp.ts +176 -19
- package/src/scene.ts +112 -25
- package/src/sceneclips.ts +83 -2
- package/src/scenerepeat.ts +111 -0
- package/src/turn.ts +225 -2
- package/src/turnoverlap.ts +23 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="
|
|
2
|
+
<img src="assets/banner.svg" alt="@rig-c/parts — 2D character parts, weighted meshes and bone chains from one painting" width="100%" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -24,47 +24,26 @@ numeric findings, a refusal names the object, the value found and the value
|
|
|
24
24
|
required, nothing is written after a red, and no value is invented where the
|
|
25
25
|
input is silent.
|
|
26
26
|
|
|
27
|
+
New to the rig-c toolchain? The [getting-started guide](https://github.com/rig-c/getting-started#the-whole-thing-in-one-glance) shows what each package takes and gives.
|
|
28
|
+
|
|
27
29
|
## What you get
|
|
28
30
|
|
|
29
31
|
<p align="center">
|
|
30
|
-
<img src="
|
|
31
|
-
<img src="
|
|
32
|
+
<img src="assets/demo-source.png" alt="The demo painting: a generated full-body character in a white and pink idol dress with a layered skirt and long pink twin tails, standing with her arms held away from her body and her hands open" height="420" />
|
|
33
|
+
<img src="assets/demo-idle.png" alt="The same character rigged, breathing, blinking once and swaying her hair, sleeves and skirt in a 3.3-second loop" height="420" />
|
|
32
34
|
</p>
|
|
33
35
|
|
|
34
36
|
<p align="center">
|
|
35
|
-
<img src="
|
|
37
|
+
<img src="assets/demo-parts.png" alt="Contact sheet of the painting and the 23 assembled parts it was split into: hair, sleeves, legs, boots, neck, skirt, bodice, earrings, hair ornaments, ears, face, brows, mouth and eyes" width="100%" />
|
|
36
38
|
</p>
|
|
37
39
|
|
|
38
40
|
<p align="center"><em>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
record,
|
|
43
|
-
<a href="
|
|
44
|
-
|
|
45
|
-
Then one command: <code>rig-parts build --loop --lead-in 3</code>. The proposer's bones, meshes,
|
|
46
|
-
regions and motion were used as proposed but for one correction, written in the
|
|
47
|
-
config beside the values it replaced: the two outer skirt chains were moved out to
|
|
48
|
-
0.8 of the skirt's half-width (the proposal's, within 90 px of the centre of a skirt
|
|
49
|
-
449 px wide, swung it about its middle and failed <code>TIP_OVER_ROOT</code>, 0.442
|
|
50
|
-
against 1.4725; moved, 2.425). One input-stage edit: <code>hair_back</code> is taken
|
|
51
|
-
from the full run, because the twin tails leave the head crop sideways (a plan edit).
|
|
52
|
-
<code>check</code> printed, verbatim:<br/>
|
|
53
|
-
<code>50 assertions: 24 measured (24 passed, 0 failed), 26 skipped, 0 not in profile "rig-play"</code><br/>
|
|
54
|
-
<code>loop: idle 41 frame(s) at 12 fps, f0000 vs f0040 (t = 3.333333333333333s) with the rig's 29 physics constraint(s) left out (named on the `loop physics:` line; rendered with them, the ends need not meet — `build --loop --lead-in <n>`): max |d| 0 (0 required)</code><br/>
|
|
55
|
-
<code>seam: setup pose at 654x1216, scale 0.9438: mean |d| 0.147 (<= 1.0), 0 px over 40, 0.00 rig px (the count / s²; <= 50), 0 px over 80 (reported)</code><br/>
|
|
56
|
-
<code>pack: skeleton.png 1051x972, 23 region(s), 96.9% covered, padding 2, page edges free, shape polygon</code><br/>
|
|
57
|
-
The loop is that build's indexed APNG, 40 frames at 12 fps, 703,909 bytes, one
|
|
58
|
-
256-entry palette at a measured error of max 71, mean 0.636 per channel over every
|
|
59
|
-
frame (the lossless APNG beside it, the exactness record, is 4,449,233 bytes; the
|
|
60
|
-
GIF, at the same error, 760,058). The rig's hair, skirt, sleeves, bows and earrings
|
|
61
|
-
carry physics, which rigc's render starts from rest, so the idle is played three
|
|
62
|
-
periods ahead and the loop is the fourth: the frame one period after its first differs
|
|
63
|
-
from it by max 1 level, 0 px over 40 (<code>--lead-in</code>). Frame 29 (2.417 s) is the
|
|
64
|
-
closed eye: the blink holds for 0.084 s, one 12 fps frame rounded up; the painting is
|
|
65
|
-
shown at half size, resampled and written by this package's PNG codec (nothing here
|
|
66
|
-
encodes JPEG). <code>rig-parts sheet</code> made the contact sheet. Its
|
|
67
|
-
<code>expected/</code> is this port's own build (<a href="examples/demo/README.md">examples/demo</a>).
|
|
41
|
+
A painting generated for this repository, split by See-through twice (the whole figure and
|
|
42
|
+
a square head crop), then built by one command: <code>rig-parts build --loop --lead-in 3</code>.
|
|
43
|
+
The proposer's bones, meshes, regions and motion were used as proposed but for one
|
|
44
|
+
correction. The generation record, the correction, the lines <code>check</code> printed and the
|
|
45
|
+
loop's encoding figures are in <a href="examples/demo/README.md">examples/demo</a>; the layers
|
|
46
|
+
and licence are in <a href="https://github.com/rig-c/examples">rig-c/examples</a>.
|
|
68
47
|
</em></p>
|
|
69
48
|
|
|
70
49
|
<p align="center"><em>
|
|
@@ -86,6 +65,11 @@ until issue #227, which took the clasped-hands painting off display). Their
|
|
|
86
65
|
this port to.
|
|
87
66
|
</em></p>
|
|
88
67
|
|
|
68
|
+
One rig can also carry **alternate drawings** as named sets — an outfit swap, or
|
|
69
|
+
mouth shapes (visemes) for speech — cut from extra paintings you supply, and the
|
|
70
|
+
player switches a set by name: see `assemble.alternates` in
|
|
71
|
+
[AUTHORING §3](docs/AUTHORING.md#3-configjson-field-by-field).
|
|
72
|
+
|
|
89
73
|
## What it takes in
|
|
90
74
|
|
|
91
75
|
- **One painting** — a PNG of one character that a rig can be cut from: front view,
|
|
@@ -126,6 +110,10 @@ page** (issue #2):
|
|
|
126
110
|
| `check/` | both gate files verbatim, the idle's frames and their `geometry.json` (skinned vertices per frame), `contact.png`, `motion_heat.png`, `check.json` (with `pack_mode`, the `--page-edges` and `--pack-shape` the page was packed under) |
|
|
127
111
|
| `idle.png`, `idle-indexed.png`, `idle.gif` | with `--loop`: the idle as a lossless APNG (the exactness record), an indexed APNG with one shared palette (the small one) and a GIF; the last two print their palette error |
|
|
128
112
|
|
|
113
|
+
Beside the skeleton data rig-c writes `check/build/skeleton.model.json`, the compiled
|
|
114
|
+
model document. [@rig-c/play](https://github.com/rig-c/play) loads that file and
|
|
115
|
+
draws the rig in a browser, as plain DOM elements or on one canvas.
|
|
116
|
+
|
|
129
117
|
The last lines of a green build are the pack line, printed beside the Spine example
|
|
130
118
|
export's `spineboy.png` as a yardstick (a reference, not a bar), and the three
|
|
131
119
|
artifact paths — here for `examples/reference-sample`:
|
|
@@ -138,26 +126,12 @@ build: PASS — the packed atlas is the artifact; parts/ and rig/ are the interm
|
|
|
138
126
|
out/check/build/skeleton.png
|
|
139
127
|
```
|
|
140
128
|
|
|
141
|
-
The page's edges are free by default: rigc picks the least-area page the parts need,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
`filter: Linear, Linear` and has no `repeat` line, so `--page-edges pot` is for a
|
|
148
|
-
consumer that mipmaps or repeats the page; it writes exactly the page builds wrote
|
|
149
|
-
before the flag existed. The measurements are in
|
|
150
|
-
[AUTHORING §5, *Page edges*](docs/AUTHORING.md#5-after-each-stage-what-to-read).
|
|
151
|
-
|
|
152
|
-
The pack shape is `polygon` by default (rig-c 2.1): a region only meshes draw is
|
|
153
|
-
packed by its emitted hull, so a neighbour may sit inside its rectangle where the hull
|
|
154
|
-
is not; a region attachment stays its rectangle. On the two examples that takes the
|
|
155
|
-
free page from 967x1338 to 922x1348 (covered 91.2 % to 95.0 %, 3.9 % less area) and
|
|
156
|
-
from 479x1166 to 477x1151 (93.4 % to 95.0 %, 1.7 % less), at the cost class `free`
|
|
157
|
-
already has: every idle frame within 1 level of the `rect` build's, and no figure in
|
|
158
|
-
`check.json` but `pack_mode` moves. `--pack-shape rect` writes the page and atlas
|
|
159
|
-
0.7.0 wrote. The measurements are in
|
|
160
|
-
[AUTHORING §5, *Pack shape*](docs/AUTHORING.md#5-after-each-stage-what-to-read).
|
|
129
|
+
The page's edges are free by default: rigc picks the least-area page the parts need, not
|
|
130
|
+
the next power of two; `--page-edges pot` is for a consumer that mipmaps or repeats the
|
|
131
|
+
page. The pack shape is `polygon` by default: a region only meshes draw is packed by its
|
|
132
|
+
emitted hull; `--pack-shape rect` packs every region by its rectangle. What each costs and
|
|
133
|
+
saves, measured on the reference examples, is in
|
|
134
|
+
[AUTHORING §5, *Page edges*](docs/AUTHORING.md#5-after-each-stage-what-to-read) and *Pack shape*.
|
|
161
135
|
|
|
162
136
|
The packer is rig-c's, and no other: a packed region is a lossless copy, and an
|
|
163
137
|
atlas written by anything else would have no oracle behind it.
|
|
@@ -168,11 +142,13 @@ atlas written by anything else would have no oracle behind it.
|
|
|
168
142
|
| --- | --- | --- |
|
|
169
143
|
| painting + See-through layers → parts and specs | **rig-parts** (npm `@rig-c/parts`) | the merge of two runs, the measurements, the rig spec and motion spec |
|
|
170
144
|
| specs → Spine skeleton data | **[@rig-c/core](https://github.com/rig-c/core)** (npm dependency `@rig-c/core`) | compile, the gate (rigc's own validator in an install; the round trip through `spine-core` where the runtime is beside it, as in this repository's CI), the named assertions, the packer, the renderer |
|
|
171
|
-
|
|
|
145
|
+
| compiled model → a page | **[rig-play](https://github.com/rig-c/play)** (npm `@rig-c/play`; formerly spine-html), a sibling project | the browser player: it loads the compiled model document and draws it as DOM elements or on one canvas; rigc's `rig-play` profile is its policy, and every build here is gated under that profile as well as under `spine` |
|
|
172
146
|
|
|
173
147
|
rig-parts never writes Spine data itself. Everything on disk under `check/build/`
|
|
174
148
|
was written by rig-c after its own gate passed.
|
|
175
149
|
|
|
150
|
+
Next stops: [@rig-c/review](https://github.com/rig-c/review) is where a person looks at a build and answers, and [@rig-c/create](https://github.com/rig-c/create) drives the whole cycle with an agent.
|
|
151
|
+
|
|
176
152
|
## Getting See-through layers
|
|
177
153
|
|
|
178
154
|
See-through is required; how you run it is not. rig-parts does not vendor, embed or
|
|
@@ -186,21 +162,15 @@ rig-parts at what it wrote:
|
|
|
186
162
|
| Upstream CLI | `python inference/scripts/inference_psd.py --srcp <image> --save_to_psd` in a checkout of [shitagaki-lab/see-through](https://github.com/shitagaki-lab/see-through) | the `.psd` in `workspace/layerdiff_output/` |
|
|
187
163
|
| ComfyUI wrapper | [jtydhr88/ComfyUI-See-through](https://github.com/jtydhr88/ComfyUI-See-through) on your own ComfyUI box; the optional `comfy` adapter (`rig-parts comfy seethrough`) drives it | the `layers.json` + PNGs it writes |
|
|
188
164
|
|
|
189
|
-
Use the square `inputs` outputs on the Space too.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
pads a non-square upload before resizing; the centre-crop reported in
|
|
193
|
-
[#356](https://github.com/rig-c/parts/issues/356) is not the current source path.
|
|
194
|
-
`st_input_full.png` supplies the explicit white padding that rig-parts maps back
|
|
195
|
-
to the original painting. This is a source inspection, not a new demo run.
|
|
165
|
+
Use the square `inputs` outputs on the Space too: `st_input_full.png` supplies the white
|
|
166
|
+
padding rig-parts maps back to the original painting
|
|
167
|
+
([source reading](docs/AUTHORING.md#see-through-space-input-source-reading)).
|
|
196
168
|
|
|
197
169
|
The [head-run source reading](docs/AUTHORING.md#see-through-head-run-source-reading) explains why a separate head crop is needed.
|
|
198
170
|
|
|
199
171
|
**See-through is required; ComfyUI is not.** The wrapper is one route among
|
|
200
172
|
four, and `rig-parts comfy` is only a convenience for that route: every
|
|
201
|
-
stage after See-through reads files, whichever route wrote them.
|
|
202
|
-
reference examples each run took 171–199 s through the wrapper, and on the demo 179 s (each run's
|
|
203
|
-
`meta.json`, in [rig-c/examples](https://github.com/rig-c/examples)).
|
|
173
|
+
stage after See-through reads files, whichever route wrote them.
|
|
204
174
|
|
|
205
175
|
### The two images See-through is fed: `inputs`
|
|
206
176
|
|
|
@@ -215,7 +185,7 @@ box at its exact size (`st_input_head.png`). Pure raster, no GPU.
|
|
|
215
185
|
### The optional ComfyUI adapter
|
|
216
186
|
|
|
217
187
|
For a user who has a ComfyUI box, two
|
|
218
|
-
commands
|
|
188
|
+
commands make the painting and the layers on it; nothing else in the pipeline needs one:
|
|
219
189
|
|
|
220
190
|
```sh
|
|
221
191
|
rig-parts comfy paint --config config.json --out <dir> --host http://<box>:8188
|
|
@@ -244,19 +214,10 @@ sources and records their declared terms; those declarations do not assign a
|
|
|
244
214
|
blanket licence to output images. The graph's automatic upscaler selection is
|
|
245
215
|
unchanged; the owner decision is tracked separately in [#428](https://github.com/rig-c/parts/issues/428).
|
|
246
216
|
|
|
247
|
-
`--offload` selects the wrapper's CUDA group-offload path on the **ComfyUI host
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
path; it is not a claim that the remaining model stack has been verified on MPS.
|
|
252
|
-
|
|
253
|
-
The [wrapper README at `98d754b`](https://github.com/jtydhr88/ComfyUI-See-through/blob/98d754bf04f668647919ab750eccb0e0640faa81/README.md#L22-L28)
|
|
254
|
-
describes a combined Decompose node and names `24yearsold/seethroughv0.0.1_marigold`
|
|
255
|
-
for depth. The shipped `workflows/seethrough.json` instead sends
|
|
256
|
-
`SeeThrough_GenerateLayers`, `SeeThrough_GenerateDepth` and `SeeThrough_PostProcess`,
|
|
257
|
-
and selects `layerdifforg/seethroughv0.0.1_marigold`, matching the wrapper's
|
|
258
|
-
[implemented depth default](https://github.com/jtydhr88/ComfyUI-See-through/blob/98d754bf04f668647919ab750eccb0e0640faa81/nodes.py#L82-L85).
|
|
259
|
-
Use the graph's node classes and the host's `/object_info` when checking the adapter.
|
|
217
|
+
`--offload` selects the wrapper's CUDA group-offload path on the **ComfyUI host**; omit it
|
|
218
|
+
for a local Mac/MPS host. The source reading behind it, and how the shipped graph differs
|
|
219
|
+
from the wrapper's README, are in
|
|
220
|
+
[AUTHORING, *The optional ComfyUI adapter*](docs/AUTHORING.md#source-readings-for-the-see-through-graph).
|
|
260
221
|
|
|
261
222
|
## The loop, for an agent
|
|
262
223
|
|
|
@@ -290,25 +251,8 @@ rig-parts build --config config.json --source painting.png --full layers/full --
|
|
|
290
251
|
|
|
291
252
|
At each step the config holds only what that step reads; the one table of what
|
|
292
253
|
that is, step by step, is [docs/AUTHORING.md §4](docs/AUTHORING.md#4-the-command-order).
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
`--write-config` forms below save the proposed fields; `RL01` does not exercise
|
|
296
|
-
that flag. On `demo` the
|
|
297
|
-
proposal pasted uncorrected stops at the last step, naming its `bottomwear` on
|
|
298
|
-
`CHECK_TIP_OVER_ROOT` — the correction its tracked config records there, the two outer
|
|
299
|
-
skirt chains moved (issue #227, [its README](examples/demo/README.md)); on `scarf`,
|
|
300
|
-
since issue #262, it builds green, and on `wind` too. `wind`'s config declares the cloth
|
|
301
|
-
recipe and its limbs, so the block runs on it again with that `cloth` block authored,
|
|
302
|
-
`--cloth config.json` on the drafting `propose` line and its tracked `keypoints.json` on both
|
|
303
|
-
`propose --parts` lines (`RL05`): it pastes `limbs` and `constraints` with the rest and gives
|
|
304
|
-
back the tracked config, section for section ([its README](examples/wind/README.md)).
|
|
305
|
-
On `demo`, which tracks the pose file it was painted on, the block runs again with
|
|
306
|
-
`--keypoints` on both `propose --parts` lines (`RL03`): the proposal then also drafts
|
|
307
|
-
`limbs`, the step's list carries them, and the run ends where `RL01` ends. The joints
|
|
308
|
-
are that pose file scaled to the painting, not read off it, so this shows what the
|
|
309
|
-
loop carries, not where the joints are. On `wind`, which tracks the joints read off its
|
|
310
|
-
painting (`keypoints.json`), `RL03` runs with those. The list as it stood before issue #375, four
|
|
311
|
-
sections, stops at `--from-config` naming every limb part (`RL04`).
|
|
254
|
+
How the selftest runs this block on each example is in
|
|
255
|
+
[CONTRIBUTING.md](CONTRIBUTING.md#the-readme-loop-as-the-selftest-runs-it).
|
|
312
256
|
|
|
313
257
|
`propose` is deliberately not a step of `build`: the proposal is a draft to correct
|
|
314
258
|
against its overlay, and a config with bones is `build`'s input. `rig`, `check` and
|
|
@@ -325,11 +269,17 @@ Command details and config saving are in the [command reference](docs/AUTHORING.
|
|
|
325
269
|
| command | does |
|
|
326
270
|
| --- | --- |
|
|
327
271
|
| `inputs` | [Prepare the two See-through input images](docs/AUTHORING.md#command-reference) |
|
|
328
|
-
| `comfy` | [Drive
|
|
272
|
+
| `comfy` | [Drive optional ComfyUI jobs: painting, layers, matte and plate](docs/AUTHORING.md#command-reference) |
|
|
329
273
|
| `layers` | [Inspect wrapper layers or a PSD](docs/AUTHORING.md#command-reference) |
|
|
274
|
+
| `head-crop-preflight` | [Report what a head box would clip, before the head run](docs/AUTHORING.md#command-reference) |
|
|
330
275
|
| `sheet` | [Make a contact sheet](docs/AUTHORING.md#command-reference) |
|
|
331
276
|
| `assemble` | [Merge layers into measured parts](docs/AUTHORING.md#command-reference) |
|
|
277
|
+
| `check-parts` | [Check assembled parts' integrity and write a report](docs/AUTHORING.md#check-parts) |
|
|
278
|
+
| `diff-components` | [List every place the stacked parts differ from the painting](docs/AUTHORING.md#whole-figure-difference-inventory) |
|
|
332
279
|
| `diff-drafts` | [Compare two assemble outputs](docs/AUTHORING.md#command-reference) |
|
|
280
|
+
| `depth-prepare` | [Write one depth-model input image per part](docs/DEPTH.md#1-prepare-one-inference-image-per-part) |
|
|
281
|
+
| `depth-bind` | [Bind a depth map to its prepared input](docs/DEPTH.md#3-bind-every-map-to-its-prepared-input) |
|
|
282
|
+
| `depth-apply` | [Apply depth maps to the parts as depth sheets](docs/DEPTH.md#4-apply-the-maps-as-depth-sheets) |
|
|
333
283
|
| `edited-part` | [Record an edited part receipt](docs/AUTHORING.md#edited-rig-space-parts-assembleedited_parts-issue-1278) |
|
|
334
284
|
| `external-receipt` | [Record or verify an external mask](docs/AUTHORING.md#external-mask-receipt) |
|
|
335
285
|
| `propose` | [Draft or inspect a character config](docs/AUTHORING.md#command-reference) |
|
|
@@ -347,6 +297,14 @@ Command details and config saving are in the [command reference](docs/AUTHORING.
|
|
|
347
297
|
| `retune` | [Revise constraints and idle in a gated rig](docs/AUTHORING.md#command-reference) |
|
|
348
298
|
| `guide` | [Read the installed authoring reference](docs/AUTHORING.md#command-reference) |
|
|
349
299
|
|
|
300
|
+
## Depth-driven rigging
|
|
301
|
+
|
|
302
|
+
[docs/DEPTH.md](docs/DEPTH.md) is the feature page for a person: what a depth-driven turn gives you, the two stages that make the sheets, how to pick a painting and how to judge the result.
|
|
303
|
+
See the [depth-driven rigging reference](docs/AUTHORING.md#depth-driven-rigging) for sampled head and body turns and unit-depth precedence.
|
|
304
|
+
|
|
305
|
+
### Per-layer depth input
|
|
306
|
+
|
|
307
|
+
See the [per-layer depth input contract](docs/AUTHORING.md#per-layer-depth-input) for opt-in sheets, calibration and their consumers.
|
|
350
308
|
|
|
351
309
|
## What it does not do
|
|
352
310
|
|
|
@@ -359,10 +317,13 @@ These are limits of the approach, stated so nobody reads more into a green run:
|
|
|
359
317
|
sheets, consumed by the shipped 2.5D head-turn producer through [config.turn.roles](docs/AUTHORING.md#3-configjson-field-by-field). A layer that is in front of another in one place and behind it in another is drawn
|
|
360
318
|
right in the still (the painting's own pixels are projected onto it) and wrong once
|
|
361
319
|
it moves.
|
|
362
|
-
- **No expression
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
320
|
+
- **No expression axis, no lip-sync from audio, and no jiggle.** The base rig's mouth is
|
|
321
|
+
one layer. Mouth shapes exist only as alternate sets you paint and declare
|
|
322
|
+
(`assemble.alternates`, [AUTHORING §3](docs/AUTHORING.md#3-configjson-field-by-field)),
|
|
323
|
+
switched by name or keyed by hand in a named animation; nothing here draws them or
|
|
324
|
+
reads speech, and nothing here proposes, keys or judges a soft region. An expression
|
|
325
|
+
that moves the face's parts, and a jiggle, can be built on the rig it writes
|
|
326
|
+
([below](#what-can-be-built-on-top)).
|
|
366
327
|
- **Occluded pixels are See-through's synthesis**, not the artist's. How much of a rig
|
|
367
328
|
that is, is below.
|
|
368
329
|
- **No success rate is claimed.** Ten characters have been measured stage by stage
|
|
@@ -408,72 +369,32 @@ for each — a config fragment, the `check` lines it passes with, and its limit:
|
|
|
408
369
|
named by `motion.animations_from` are built and gated beside the idle on every build. Keys
|
|
409
370
|
carry core motion fields, including raw `curve` control points in absolute time/value
|
|
410
371
|
coordinates ([core key format](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md#45-keys--times-values-curves));
|
|
411
|
-
the linked recipe includes a core-gated example.
|
|
412
|
-
|
|
413
|
-
|
|
372
|
+
the linked recipe includes a core-gated example. Without
|
|
373
|
+
an alternate set a slot holds one image, so a part moves, turns and scales but is not
|
|
374
|
+
swapped for another; `check` measures the idle alone.
|
|
414
375
|
- [**A soft region driven by physics**](docs/AUTHORING.md#recipe-a-soft-region-driven-by-physics)
|
|
415
376
|
(a bust, the hips): a bone the config authors, a contour-mode region that hands it the patch,
|
|
416
|
-
and a `physics` constraint on it; `examples/reference-sample` carries one.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
bust up to 6.702 and the hips up to 4.609 rig px; the region's `band` caps how far a patch may
|
|
420
|
-
go before the texture-stretch ceiling, and `check` measures the idle alone.
|
|
377
|
+
and a `physics` constraint on it; `examples/reference-sample` carries one. The spring
|
|
378
|
+
answers faster keys on the body more than a slow idle, the region's `band` caps how far a
|
|
379
|
+
patch may go before the texture-stretch ceiling, and `check` measures the idle alone.
|
|
421
380
|
|
|
422
381
|
### How much of a rig the model painted
|
|
423
382
|
|
|
424
|
-
`parts.json` splits each part's opaque pixels
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
| | opaque px | occluded | visible, not projected | taken from the painting |
|
|
432
|
-
| --- | --- | --- | --- | --- |
|
|
433
|
-
| `demo` | 362,441 | 69,098 (19.1 %) | 67,164 (18.5 %) | 226,179 (62.4 %) |
|
|
434
|
-
| `scarf` | 283,813 | 78,503 (27.7 %) | 56,699 (20.0 %) | 148,611 (52.4 %) |
|
|
435
|
-
| `reference-sample` | 298,363 | 79,122 (26.5 %) | 35,979 (12.1 %) | 183,262 (61.4 %) |
|
|
436
|
-
| `reference-demo` | 765,924 | 202,343 (26.4 %) | 75,626 (9.9 %) | 487,955 (63.7 %) |
|
|
437
|
-
|
|
438
|
-
The occluded share is art the painting does not show — a back-hair layer, a neck, the
|
|
439
|
-
parts of an ear under the hair — and is See-through's synthesis by necessity; it is
|
|
440
|
-
what the decomposition is for. The visible-but-not-projected share is synthesis where
|
|
441
|
-
the painting was there to be taken: a part too thin for the reference rule's 5x5
|
|
442
|
-
eroded core, an anti-aliased fringe below alpha 250, a rim beside a layer in front, a
|
|
443
|
-
pixel refused for drift. `--project visible` keeps the erosion only along a rim with a
|
|
444
|
-
layer in front, which takes that share to 22,476 (7.5 %) on `reference-sample` and 49,672 (6.5 %)
|
|
445
|
-
on `reference-demo` (from the `parts.json` of a `--project visible` build). On the eleven thin
|
|
446
|
-
head parts — brows, lashes, irises, eye whites, ears, mouth — it takes 296 of
|
|
447
|
-
`reference-sample`'s 1,289 visible pixels where `core` takes 110, and 824 of `reference-demo`'s 2,162
|
|
448
|
-
where `core` takes 343. What neither rule takes is the fringe: a per-pixel
|
|
449
|
-
classification of those parts under `visible`, recorded with the change that added
|
|
450
|
-
the flag, puts 813 of `reference-sample`'s 993 still-unprojected pixels and 879 of `reference-demo`'s
|
|
451
|
-
1,338 below alpha 250. Where such a fringe keeps the stack off the painting and a part
|
|
452
|
-
beneath holds the pixel in the painting's colour, `assemble` clears it instead, and
|
|
453
|
-
the assemble line and `parts.json` say how many pixels, of which part, over which
|
|
454
|
-
(AUTHORING §5, *The fringe push-back*; the figures in this section were measured
|
|
455
|
-
before it, at v0.14.0, but for the `demo` row, which is its `expected/parts.json`
|
|
456
|
-
as this port wrote it in issue #227).
|
|
383
|
+
`parts.json` splits each part's opaque pixels into `visible_px` and `occluded_px`, and
|
|
384
|
+
counts the visible ones whose colour was not taken from the painting
|
|
385
|
+
(`visible_not_projected_px`). The occluded share is art the painting does not show — a
|
|
386
|
+
back-hair layer, a neck — and is See-through's synthesis by necessity. The figures for the
|
|
387
|
+
four examples, and what `--project visible` changes, are in
|
|
388
|
+
[AUTHORING §5](docs/AUTHORING.md#how-much-of-a-rig-the-model-painted).
|
|
457
389
|
|
|
458
390
|
## Requirements
|
|
459
391
|
|
|
460
|
-
[Bun](https://bun.sh) 1.4 or later
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
beside `rig-parts` for the transition, the same launcher under both names. On npm
|
|
467
|
-
both compatibility names stay published beside `@rig-c/parts` at every version, as aliases
|
|
468
|
-
carrying the same files with only the `name` in `package.json` changed, so a
|
|
469
|
-
project that depends on either keeps receiving every release; a new
|
|
470
|
-
install names `@rig-c/parts` ([RELEASING.md](RELEASING.md), *The registry side*). `@rig-c/core`
|
|
471
|
-
comes with it as a dependency, providing the `rigc` command. No Spine runtime does: since
|
|
472
|
-
rig-c 2.0 the installed `rigc` gates every build with its own validator over the
|
|
473
|
-
compiled model document, and `rigc --version` says `entry: cli_core.ts —
|
|
474
|
-
@esotericsoftware/spine-core absent`. With `@esotericsoftware/spine-core` installed
|
|
475
|
-
beside it, the same `rigc` runs the spine-core round trip instead, as this repository's
|
|
476
|
-
selftest and CI do; `check.json`'s `rigc_entry` records which one gated a build.
|
|
392
|
+
[Bun](https://bun.sh) 1.4 or later. `npm i -D @rig-c/parts` installs the `rig-parts`
|
|
393
|
+
command (`npm install -g @rig-c/parts` puts it on `PATH`); it hands off to Bun and says
|
|
394
|
+
so in one sentence if Bun is not on `PATH`. `@rig-c/core` comes with it as a dependency,
|
|
395
|
+
providing the `rigc` command; no Spine runtime does. [docs/STABILITY.md](docs/STABILITY.md#rig-c)
|
|
396
|
+
says what this package relies on in rig-c and which validator gates an install, and
|
|
397
|
+
[RELEASING.md](RELEASING.md#three-names-one-tree) covers the package's earlier install names.
|
|
477
398
|
|
|
478
399
|
## Licence posture
|
|
479
400
|
|
|
@@ -481,42 +402,8 @@ MIT; see [NOTICE.md](NOTICE.md) for third-party terms and the Spine runtime lice
|
|
|
481
402
|
|
|
482
403
|
## Development
|
|
483
404
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
bun run typecheck # tsc --noEmit, strict
|
|
487
|
-
bun run lint # one rule: no explicit any
|
|
488
|
-
bun run fetch-examples # the public examples' paintings and layers, into examples/*/inputs (needs a network); each file held to its blob id at the pinned commit, a stale one replaced by name
|
|
489
|
-
bun run selftest # every gate's controls; with the examples fetched, build on each of them against its expected/
|
|
490
|
-
bun run selftest -- --summary-json summary.json # also write rig-selftest-summary/1 (per-suite PASS/FAIL/SKIP counts, holes, partial flag and exit)
|
|
491
|
-
bun run smoke # pack, install into an empty directory, run from the install (needs a network)
|
|
492
|
-
```
|
|
493
|
-
|
|
494
|
-
`bun run selftest -- --summary-json <file>` writes a machine-readable summary (`spec: "rig-selftest-summary/1"`, `tool: "rig-parts"`) derived from the same `RunTally` that prints the console summary: `exit` (`0 | 1 | 2`), `partial` (`boolean`), `only` (`string[] | null`), `faults`, `totals` (`suites`, `ran`, `skipped_suites`, `controls`, `passed`, `failed`, `skipped`, `holes`), per-suite `suites` entries (`suite`, `ran`, `controls`, `passed`, `failed`, `skipped`, `status`, `reason`), `skips` (`{ suite, name, reason, hole }`), and `holes` (`{ suite, name, reason }`). See [AUTHORING §8](docs/AUTHORING.md#machine-readable-selftest-summary---summary-json-issue-725) for the full shape.
|
|
495
|
-
|
|
496
|
-
The generated `foot-ownership` suite can be run alone with
|
|
497
|
-
`bun run selftest -- --only foot-ownership` (exit 2 means a green partial run,
|
|
498
|
-
not a full-tree verdict). Issue #638's revised acceptance requires zero foreign-leg
|
|
499
|
-
components and reports historical own-cap components separately; it was changed
|
|
500
|
-
after measurement, and the historical case did not pass the original second-island
|
|
501
|
-
1% bar. Issue #637 additionally preserves assigned own-cap connections under covers:
|
|
502
|
-
the generated default is now one connected component, retaining the historical
|
|
503
|
-
own-cap pixels and their bridge. The controls require both historical measurements
|
|
504
|
-
and current connected ownership, with no foreign-leg pixels.
|
|
505
|
-
[AUTHORING's limb section](docs/AUTHORING.md#limbs-cut-at-their-joints-limbs-issue-349)
|
|
506
|
-
records the generated default-cap case and its preservation controls.
|
|
507
|
-
|
|
508
|
-
[CLAUDE.md](CLAUDE.md) is the doctrine, [CONTRIBUTING.md](CONTRIBUTING.md) the
|
|
509
|
-
practice, [RELEASING.md](RELEASING.md) the cut, [docs/STABILITY.md](docs/STABILITY.md)
|
|
510
|
-
the interface it holds.
|
|
511
|
-
|
|
512
|
-
## Depth-driven rigging
|
|
513
|
-
|
|
514
|
-
[docs/DEPTH.md](docs/DEPTH.md) is the feature page for a person: what a depth-driven turn gives you, the two stages that make the sheets, how to pick a painting and how to judge the result.
|
|
515
|
-
See the [depth-driven rigging reference](docs/AUTHORING.md#depth-driven-rigging) for sampled head and body turns and unit-depth precedence.
|
|
516
|
-
|
|
517
|
-
### Per-layer depth input
|
|
518
|
-
|
|
519
|
-
See the [per-layer depth input contract](docs/AUTHORING.md#per-layer-depth-input) for opt-in sheets, calibration and their consumers.
|
|
405
|
+
`bun install`, then `bun run typecheck`, `bun run lint` and `bun run selftest`.
|
|
406
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) has every command and what a change has to clear; [CLAUDE.md](CLAUDE.md) is the doctrine, [RELEASING.md](RELEASING.md) the cut, [docs/STABILITY.md](docs/STABILITY.md) the interface it holds.
|
|
520
407
|
|
|
521
408
|
## Licence
|
|
522
409
|
|
package/cli.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { DIFF_DRAFTS_SPEC, diffDraftsCommand } from './src/diffdrafts.ts';
|
|
|
5
5
|
import { applyTakenLayers } from './src/takelayers.ts';
|
|
6
6
|
import { applyDepth, bindDepthMap, prepareDepth } from './src/depthworkflow.ts';
|
|
7
7
|
import { externalReceipt } from './src/externalreceipt.ts';
|
|
8
|
-
import { BUST_LANDMARKS_ACT_SCHEMA, BUST_LANDMARKS_PROVENANCE_SPEC, BUST_LANDMARKS_PROVENANCE_SUFFIX, BUST_POINT_SHAPE_FIELDS, bustShapeClause, type BustSidecar, effectiveBustShape, planBustLandmarks, readBustSidecar, stageBustLandmarks, stageReplacements, type StagedBustLandmarks } from './src/bustlandmarks.ts';
|
|
8
|
+
import { BUST_LANDMARKS_ACT_SCHEMA, BUST_LANDMARKS_COMMENT_ACT_SCHEMA, BUST_LANDMARKS_PROVENANCE_SPEC, BUST_LANDMARKS_PROVENANCE_SUFFIX, BUST_POINT_SHAPE_FIELDS, bustShapeClause, type BustSidecar, effectiveBustShape, planBustLandmarks, readBustSidecar, stageBustLandmarks, stageReplacements, type StagedBustLandmarks } from './src/bustlandmarks.ts';
|
|
9
9
|
import { writeEditedPart } from './tools/edited-part-cli.ts';
|
|
10
10
|
/**
|
|
11
11
|
* rig-parts — one painting and its See-through layers in, Spine-ready parts
|
|
@@ -27,7 +27,7 @@ import { basename, dirname, extname, join, resolve } from 'node:path';
|
|
|
27
27
|
import { DEFAULT_PROJECT_RULE, DEFAULT_SEAM_RULE, headGarmentOverlaps, headGarmentWarning, HOLES_LISTED, PROJECT_RULES, type ProjectRule, proposeFields, proposePlan, proposeSinglePlan, SEAM_RULES, type SeamRule } from './src/assemble.ts';
|
|
28
28
|
import { proposeNeck } from './tools/neck-propose.ts';
|
|
29
29
|
import { parseAltArg } from './tools/alternate-cli.ts';
|
|
30
|
-
import { type AlternateCliInput, assembleStage, build, checkStage, emitFillMasksStage, ERROR_MAP_FILE, loopStage, readRuns, readSource, rigStage, suppliedCheckFlag } from './src/build.ts';
|
|
30
|
+
import { type AlternateCliInput, assembleStage, build, BUILD_OWNS, BUILD_OWNS_FILES, checkStage, checkWrote, emitFillMasksStage, ERROR_MAP_FILE, loopStage, readRuns, readSource, rigStage, suppliedCheckFlag } from './src/build.ts';
|
|
31
31
|
import { ACCEPTABLE_BARS, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, findRigc, PACK_PAGE_SIZE, PACK_SHAPES, rigcRunnerAt, type PackShape, PAGE_EDGES, type PageEdges, parsePageSize, PARTS_HOME_SENTENCE, RIGC_GEOMETRY_VERSION, rigcRanClause, type RigcRunner, NO_PARTS_SENTENCE, SEAM_MEAN_BAR, SOURCE_SENTENCE, SEAM_PX_BAR, SEAM_PX_LEVEL, SPINEBOY_YARDSTICK, TEXTURE_STRETCH_CEILING } from './src/check.ts';
|
|
32
32
|
import { ComfyClient, resolveHost, runBackground, runMatte, runPainting, runSeeThrough } from './src/comfy/index.ts';
|
|
33
33
|
import { coreCfg, DEFAULT_GROW_PX, runForeground } from './src/plate.ts';
|
|
@@ -56,7 +56,7 @@ import { REQUIREMENTS_SENTENCE } from './src/requirements.ts';
|
|
|
56
56
|
import { composeStage, IMAGE_SEP, PLATE, PROVENANCES, SCENE_REPORT_FILE, SCENE_REPORT_SPEC, SCENE_SPEC } from './src/scene.ts';
|
|
57
57
|
import { buildSheet, defaultCaption, type Tile, tilesFrom } from './src/sheet.ts';
|
|
58
58
|
import { loadComparison, requiredProblems, structureLines } from './src/structure.ts';
|
|
59
|
-
import { assembleOutputFiles, clearComposeRun, clearRunStamp, readPackageIdentity, rigOutputFiles, RUN_STAMP_FILE, RUN_STAMP_SPEC, writeRunStamp } from './src/runstamp.ts';
|
|
59
|
+
import { type ArgvTable, assembleOutputFiles, BUILD_RUN_FILE, CHECK_RUN_FILE, clearComposeRun, clearRunRecord, clearRunStamp, readPackageIdentity, recordArgv, rigOutputFiles, RUN_STAMP_FILE, RUN_STAMP_SPEC, writeRunRecord, writeRunStamp } from './src/runstamp.ts';
|
|
60
60
|
import { authorLayerLine } from './src/tags.ts';
|
|
61
61
|
|
|
62
62
|
const EXIT_OK = 0;
|
|
@@ -389,10 +389,13 @@ usage:
|
|
|
389
389
|
rig-parts bust-landmarks --from-act <act.json> --parts <dir> --config <config.json> --out <landmarks.json> [--write-config]
|
|
390
390
|
Write the file propose --bust-landmarks reads (apex_r, apex_l and
|
|
391
391
|
optional cleavage, rig px) from the one chest row of a Review
|
|
392
|
-
${BUST_LANDMARKS_ACT_SCHEMA} act,
|
|
392
|
+
${BUST_LANDMARKS_ACT_SCHEMA} act, or of the one chest-landmarks carrier of a
|
|
393
|
+
${BUST_LANDMARKS_COMMENT_ACT_SCHEMA} comment-only act (its file must equal the act's
|
|
394
|
+
source.model), and <out>${BUST_LANDMARKS_PROVENANCE_SUFFIX} beside it (spec
|
|
393
395
|
"${BUST_LANDMARKS_PROVENANCE_SPEC}": the act's schema, id and
|
|
394
|
-
file sha256, the
|
|
395
|
-
|
|
396
|
+
file sha256, the carrier's file for a comment-only act, the row's
|
|
397
|
+
sha256, verified against the row's edit, the slot, the source hash and
|
|
398
|
+
frame). The row's slot must be a part of
|
|
396
399
|
parts.json whose config mesh is a contour, its frame parts.json's
|
|
397
400
|
rig_size, and its alpha, clearance, spacing, bone_r and bone_l those of
|
|
398
401
|
the config's contour.bust. --write-config instead takes those five into
|
|
@@ -630,6 +633,11 @@ usage:
|
|
|
630
633
|
[--set <name> | --all-sets] [--environment <schedule.json>]
|
|
631
634
|
[--wind-band <spec.json>] [--json]
|
|
632
635
|
--json prints the completed check.json object only, with unchanged exit codes.
|
|
636
|
+
check-run.json (rig-run/2, STABILITY) records a completed run: the package,
|
|
637
|
+
the times, every file written with its sha256, and argv, the command and
|
|
638
|
+
the options as given, each path relative to --out and --out as ".": these
|
|
639
|
+
arguments reproduce the check with the same package version, run from the
|
|
640
|
+
--out directory.
|
|
633
641
|
Build, gate, render and measure a rig through rig-c's CLI (the rigc at
|
|
634
642
|
node_modules/.bin/rigc, or on PATH). --rig holds rig.json and motion.json:
|
|
635
643
|
a rig spec, which rigc build compiles, not a compiled skeleton.json.
|
|
@@ -777,8 +785,8 @@ usage:
|
|
|
777
785
|
reads what a run without the flag reads, and wind [0, 0] is a calm, not
|
|
778
786
|
the default (AUTHORING §6, The world the readings are taken in). One
|
|
779
787
|
environment: line names the path, the step count and the sha256's first
|
|
780
|
-
16 hex; check.json's environment holds path (
|
|
781
|
-
steps. Without the flag no environment provenance key is written.
|
|
788
|
+
16 hex; check.json's environment holds path (relative to --out), sha256
|
|
789
|
+
and steps. Without the flag no environment provenance key is written.
|
|
782
790
|
Physics rigs with readable declared seam pairs also report independent
|
|
783
791
|
default wind [1, 0] and still wind [0, 0], gravity [0, 1], under
|
|
784
792
|
SEAM_OVER_MOTION.worlds: gap/ghost maximum and worst frame only;
|
|
@@ -965,6 +973,9 @@ usage:
|
|
|
965
973
|
[--idle-keys ctl|direct] [--lead-in <periods>] [--seam-pairs] [--keep-stills] [--no-extremes]
|
|
966
974
|
[--alt <name>=<source>:<full>[:<head>]] [--set <name> | --all-sets]
|
|
967
975
|
[--environment <schedule.json>] [--wind-band <spec.json>]
|
|
976
|
+
build-run.json (rig-run/2, as check-run.json for check) records a run whose
|
|
977
|
+
check completed, with argv starting "build": these arguments reproduce the
|
|
978
|
+
check with the same package version, run from the --out directory.
|
|
968
979
|
assemble, then rig, then check, in one process, each stage's own lines
|
|
969
980
|
printed under [assemble], [rig] and [check]; the first stage that refuses
|
|
970
981
|
stops the build with its own FAIL lines. The config must already carry
|
|
@@ -990,7 +1001,7 @@ usage:
|
|
|
990
1001
|
Without the flag, config.requirements (a path beside the config) is
|
|
991
1002
|
read in its place; a flag naming other bytes than the declaration is
|
|
992
1003
|
BUILD_REQUIREMENTS_CONFLICT, before assemble. check.json's
|
|
993
|
-
requirements.file records the path
|
|
1004
|
+
requirements.file records the path relative to <out>/check, its sha256
|
|
994
1005
|
and the file's keys.
|
|
995
1006
|
--environment is forwarded to check (as for check); the schedule is read
|
|
996
1007
|
by rig-c's reader before assemble runs, so a malformed one is refused,
|
|
@@ -1277,6 +1288,21 @@ const TAKES = {
|
|
|
1277
1288
|
|
|
1278
1289
|
type Command = keyof typeof TAKES;
|
|
1279
1290
|
|
|
1291
|
+
/** `check`'s flags as its `check-run.json` record writes them back (issue #1541): its {@link TAKES} row and which values are paths. */
|
|
1292
|
+
const CHECK_ARGV: ArgvTable = { ...TAKES.check, paths: ['--rig', '--out', '--parts', '--source', '--requirements', '--environment', '--wind-band'] };
|
|
1293
|
+
/** `build`'s, for `build-run.json`; `--alt` holds up to three paths after its set name. */
|
|
1294
|
+
const BUILD_ARGV: ArgvTable = {
|
|
1295
|
+
...TAKES.build,
|
|
1296
|
+
paths: ['--config', '--source', '--full', '--head', '--out', '--requirements', '--environment', '--wind-band'],
|
|
1297
|
+
compound: {
|
|
1298
|
+
'--alt': (value, path) => {
|
|
1299
|
+
const alt = parseAltArg(value);
|
|
1300
|
+
if (typeof alt === 'string') throw new Error(`run record: --alt ${JSON.stringify(value)} was accepted and no longer parses: ${alt}`);
|
|
1301
|
+
return `${alt.name}=${path(alt.source)}:${path(alt.full)}${alt.head === undefined ? '' : `:${path(alt.head)}`}`;
|
|
1302
|
+
},
|
|
1303
|
+
},
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1280
1306
|
/** Whether `command` takes `flag` as a valued flag, read off its {@link TAKES} row. */
|
|
1281
1307
|
function takesValued(command: Command, flag: string): boolean {
|
|
1282
1308
|
return (TAKES[command].valued as readonly string[]).includes(flag);
|
|
@@ -1633,19 +1659,28 @@ function cmdCheck(args: string[]): number {
|
|
|
1633
1659
|
if (allSets === 1 && f.has('--set')) return usage('--set and --all-sets are two modes; give one');
|
|
1634
1660
|
const rig = f.get('--rig') as string;
|
|
1635
1661
|
const out = f.get('--out') as string;
|
|
1662
|
+
let fixedClock: string | undefined;
|
|
1663
|
+
try { fixedClock = runStampClock(); } catch (err) { return printRefusal(err); }
|
|
1636
1664
|
const edges = pageEdgesOf(f.get('--page-edges'));
|
|
1637
1665
|
if (!isPageEdges(edges)) return usage(edges);
|
|
1638
1666
|
const shape = packShapeOf(f.get('--pack-shape'));
|
|
1639
1667
|
if (!isPackShape(shape)) return usage(shape);
|
|
1640
1668
|
try {
|
|
1641
1669
|
const size = parsePageSize(f.get('--page-size'));
|
|
1670
|
+
const pkg = readPackageIdentity(join(import.meta.dir, 'package.json'));
|
|
1671
|
+
clearRunRecord(out, CHECK_RUN_FILE);
|
|
1642
1672
|
const bin = findRigc(import.meta.dir, process.env.PATH ?? '');
|
|
1673
|
+
const startedAt = fixedClock ?? new Date().toISOString();
|
|
1643
1674
|
const r = checkStage(
|
|
1644
1675
|
{ rig, parts: f.get('--parts'), source: f.get('--source'), out, pageEdges: edges, packShape: shape, ...(size === undefined ? {} : { pageSize: size }), requirements: f.get('--requirements'), seamPairs: seamPairs === 1, keepStills: keepStills === 1, noExtremes: noExtremes === 1, ...(f.has('--set') ? { set: f.get('--set') as string } : {}), allSets: allSets === 1, ...(f.has('--environment') ? { environment: f.get('--environment') as string } : {}), ...(f.has('--wind-band') ? { windBand: f.get('--wind-band') as string } : {}) },
|
|
1645
1676
|
rigcRunner(bin),
|
|
1646
1677
|
bin,
|
|
1647
1678
|
json === 1 ? () => {} : console.log,
|
|
1648
1679
|
);
|
|
1680
|
+
// Issue #1541: the record of the run, beside the report it completed; never a refusal of its own.
|
|
1681
|
+
const wrote = checkWrote(r, out);
|
|
1682
|
+
writeRunRecord({ pkg, command: 'check', startedAt, finishedAt: fixedClock ?? new Date().toISOString(), outDir: out,
|
|
1683
|
+
outputs: [...wrote.written, ...wrote.dirs.map((d) => `${d}/`)], argv: recordArgv('check', args, CHECK_ARGV, out, process.cwd()) });
|
|
1649
1684
|
if (json === 1) process.stdout.write(`${JSON.stringify(r.figures, null, 1)}\n`);
|
|
1650
1685
|
return r.figures.PASS ? EXIT_OK : EXIT_REFUSED;
|
|
1651
1686
|
} catch (err) {
|
|
@@ -2477,11 +2512,17 @@ function cmdBuild(args: string[]): number {
|
|
|
2477
2512
|
const [config, source, full, out] = ['--config', '--source', '--full', '--out'].map((f) => flags.get(f) as string);
|
|
2478
2513
|
const head = flags.get('--head') ?? null;
|
|
2479
2514
|
let bin: string;
|
|
2515
|
+
let fixedClock: string | undefined;
|
|
2516
|
+
let pkg: { name: string; version: string };
|
|
2480
2517
|
try {
|
|
2518
|
+
fixedClock = runStampClock();
|
|
2519
|
+
pkg = readPackageIdentity(join(import.meta.dir, 'package.json'));
|
|
2481
2520
|
bin = findRigc(import.meta.dir, process.env.PATH ?? '');
|
|
2482
2521
|
} catch (err) {
|
|
2483
2522
|
return printRefusal(err);
|
|
2484
2523
|
}
|
|
2524
|
+
clearRunRecord(out, BUILD_RUN_FILE);
|
|
2525
|
+
const startedAt = fixedClock ?? new Date().toISOString();
|
|
2485
2526
|
const scratch = mkdtempSync(join(tmpdir(), 'rig-parts-build-'));
|
|
2486
2527
|
try {
|
|
2487
2528
|
const r = build(
|
|
@@ -2493,6 +2534,11 @@ function cmdBuild(args: string[]): number {
|
|
|
2493
2534
|
} },
|
|
2494
2535
|
console.log,
|
|
2495
2536
|
);
|
|
2537
|
+
// Issue #1541: written whenever this build's check completed its report, green or not.
|
|
2538
|
+
if (r.check !== null) {
|
|
2539
|
+
writeRunRecord({ pkg, command: 'build', startedAt, finishedAt: fixedClock ?? new Date().toISOString(), outDir: out, configPath: config,
|
|
2540
|
+
outputs: [...BUILD_OWNS, ...BUILD_OWNS_FILES], argv: recordArgv('build', args, BUILD_ARGV, out, process.cwd()) });
|
|
2541
|
+
}
|
|
2496
2542
|
return r.stoppedAt === null ? EXIT_OK : EXIT_REFUSED;
|
|
2497
2543
|
} finally {
|
|
2498
2544
|
rmSync(scratch, { recursive: true, force: true });
|