rig-parts 1.74.0 → 1.75.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/NOTICE.md +2 -2
- package/README.md +1 -1
- package/docs/AUTHORING.md +22 -8
- package/docs/MIGRATION.md +9 -0
- package/docs/STABILITY.md +10 -10
- package/package.json +2 -2
- package/skills/rig-parts/SKILL.md +1 -1
- package/src/apng.ts +1 -1
- package/src/assemble.ts +95 -11
- package/src/autoamplitude.ts +1 -1
- package/src/autoenvelope.ts +1 -1
- package/src/automesh.ts +2 -2
- package/src/automotion.ts +3 -3
- package/src/autoreplay.ts +1 -1
- package/src/build.ts +2 -1
- package/src/check.ts +9 -9
- package/src/config.ts +14 -6
- package/src/contour.ts +1 -1
- package/src/coords.ts +3 -3
- package/src/meshdraft.ts +4 -4
- package/src/motionseampose.ts +1 -1
- package/src/propose.ts +1 -1
- package/src/raster/png.ts +2 -2
- package/src/remesh.ts +2 -2
- package/src/requirements.ts +2 -2
- package/src/rig.ts +5 -5
- package/src/scene.ts +1 -1
- package/src/sheet.ts +1 -1
- package/src/structure.ts +2 -2
- package/src/turn.ts +2 -2
- package/src/turnoverlap.ts +1 -1
- package/src/waistmesh.ts +1 -1
- package/tools/build-process.ts +2 -2
package/NOTICE.md
CHANGED
|
@@ -59,7 +59,7 @@ from them beyond the layers See-through itself writes for the user's own image.
|
|
|
59
59
|
|
|
60
60
|
## 2. Spine Runtimes, through rig-c
|
|
61
61
|
|
|
62
|
-
rig-parts depends on [
|
|
62
|
+
rig-parts depends on [`@rig-c/core`](https://www.npmjs.com/package/@rig-c/core)
|
|
63
63
|
(MIT, same author), which compiles and validates Spine skeleton data. Its round
|
|
64
64
|
trip runs through `@esotericsoftware/spine-core`, part of the
|
|
65
65
|
[Spine Runtimes](https://github.com/EsotericSoftware/spine-runtimes), under the
|
|
@@ -158,7 +158,7 @@ function's comment says which call it stands in for and what was measured.
|
|
|
158
158
|
|
|
159
159
|
| Package | Licence | Why |
|
|
160
160
|
| --- | --- | --- |
|
|
161
|
-
| [
|
|
161
|
+
| [`@rig-c/core`](https://www.npmjs.com/package/@rig-c/core) | MIT | compile, gate, render and check; its PNG codec, font and coordinate conversion |
|
|
162
162
|
| [`ag-psd`](https://www.npmjs.com/package/ag-psd) | MIT | reading an upstream See-through `.psd` |
|
|
163
163
|
| ↳ [`pako`](https://www.npmjs.com/package/pako) | MIT AND Zlib | ag-psd's deflate |
|
|
164
164
|
| ↳ [`base64-js`](https://www.npmjs.com/package/base64-js) | MIT | ag-psd's base64 |
|
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ atlas written by anything else would have no oracle behind it.
|
|
|
157
157
|
| stage | tool | what it owns |
|
|
158
158
|
| --- | --- | --- |
|
|
159
159
|
| 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 |
|
|
160
|
-
| specs → Spine skeleton data | **[@rig-c/core](https://github.com/rig-c/core)** (
|
|
160
|
+
| 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 |
|
|
161
161
|
| skeleton data → a page | **[rig-play](https://github.com/rig-c/play)** (npm `@rig-c/play`; formerly spine-html), a sibling project | a DOM renderer; rigc's `rig-play` profile is its policy, and every build here is gated under that profile as well as under `spine` |
|
|
162
162
|
|
|
163
163
|
rig-parts never writes Spine data itself. Everything on disk under `check/build/`
|
package/docs/AUTHORING.md
CHANGED
|
@@ -41,7 +41,7 @@ with `flattenRig(built)`, not with the built file.
|
|
|
41
41
|
| what | why | how |
|
|
42
42
|
| --- | --- | --- |
|
|
43
43
|
| [Bun](https://bun.sh) 1.2 or later | rig-parts and rig-c are Bun programs | `npm install -g @rig-c/parts` installs the command; it says so if Bun is missing |
|
|
44
|
-
| [@rig-c/core](https://www.npmjs.com/package/@rig-c/core) | compiles, gates, packs and renders every rig; rig-parts writes no Spine data itself | installed with rig-parts as the
|
|
44
|
+
| [@rig-c/core](https://www.npmjs.com/package/@rig-c/core) | compiles, gates, packs and renders every rig; rig-parts writes no Spine data itself | installed with rig-parts as the dependency `@rig-c/core` (`node_modules/.bin/rigc`); with no Spine runtime beside it, it gates with its own validator, and `rigc --version` says `entry: cli_core.ts` |
|
|
45
45
|
| [See-through](https://github.com/shitagaki-lab/see-through), somewhere | the layer decomposition is the input | any route in README *Getting See-through layers*; it runs twice per character, outside this tool |
|
|
46
46
|
| a GPU, wherever See-through runs | See-through is a diffusion model | nothing in rig-parts itself uses a GPU |
|
|
47
47
|
|
|
@@ -120,6 +120,7 @@ read by no CPU stage).
|
|
|
120
120
|
| `assemble.cuts` | assemble; `meshes`/`regions` keys may name the new parts too, and must (each is a part like any other) | **authored**, optional (issue #170): `[{from, into, polygon, draw, overlap, under, under_fill}]`, `under` and `under_fill` optional — a plan part's layer cut by a polygon the author draws: the pixels of plan part `from` whose **centre** lies inside `polygon` (even-odd; a centre exactly on an edge is outside) leave `from` and make the new part `into`, colour and alpha, so every pixel of the layer ends in exactly one of the two. `polygon` is `[[x, y], …]`, at least three points, non-negative integer **rig** pixels — the space of `parts.json` and of the patches' boxes. The file that shows the layer in those coordinates is `assemble`'s own `rig/parts/<from>.png`, placed at its `parts.json` `x`, `y` (the PNG's pixel `(i, j)` is rig pixel `(x + i, y + j)`), or `render/recomposite_rig.png`, the whole rig 1:1; the contact sheets (`sheet`) are scaled and carry no coordinates. `draw` is `"back"`, `"front"` or `{"before": "<plan part>"}`, as for a patch (to keep the setup pose, draw the piece immediately in front of `from` — `{"before": "<the plan part after from>"}`, or `"front"` when `from` is the last plan part; `{"before": "<from>"}` draws it behind `from`, which `under` refuses as `ASSEMBLE_UNDER_DRAW` because the fill would hide it). `from` must be a plan part (`CONFIG_NAME_RESOLVES`; a patch or another cut's piece is refused; a part a limb takes may be cut where no segment of the limb holds it, issue #564, §5 *Limbs*), `into` a new name (`CONFIG_PART_UNIQUE`), the polygon three or more integer points (`CONFIG_FIELD_TYPE`). The piece's `parts.json` record carries `from`'s `<run>:<tag>` and its own counts, each split from the layer's by where the pixel lies; it is a mesh or a region under its own name, and the coverage rule holds it like a plan part. What the config cannot know the stage refuses: a polygon point past the rig (`ASSEMBLE_CUT_INSIDE`), two cuts of one part sharing a pixel (`ASSEMBLE_CUT_OVERLAP`), a cut that takes none of the layer's opaque pixels or leaves `from` none (`ASSEMBLE_CUT_PIXELS`), a cut of a part a limb takes that takes a pixel a segment of the limb holds (`ASSEMBLE_CUT_CROSSES_LIMB`). `overlap` is required, a non-negative integer of rig pixels with no default (`CONFIG_FIELD_TYPE`): the **band** — the polygon's pixels within `overlap` px of its edge by Chebyshev distance (the polygon's mask less its erosion by a `2 * overlap + 1` square) — stays in `from` as well as going to the piece, so the piece's resampled edge has art under it; the counts stay a strict partition and the band is the base's extra copy, printed on the `cut:` line. At `0` the two abut and `check`'s seam bar judges the edge between them (`CHECK_SEAM_WITHIN_BAR`, §5). A band only covers the edge at rest: a piece that swings well clear of where it was painted shows the hole it leaves, and a thin piece's band shows a ghost of the piece. `under` (issue #193), optional, is the author's image of what lies under the piece: a PNG path relative to the config's directory (`CONFIG_FIELD_TYPE` unless a non-empty string), in rig pixels over the polygon's **bounding box** — the least and greatest polygon x and y, so the image is `max x − min x` by `max y − min y` and its pixel `(i, j)` is rig pixel `(min x + i, min y + j)`. Where the cut removed pixels from `from` — the piece's pixels (alpha above 0) less the band — `from` takes the image's pixel, colour and alpha wherever the image's alpha is at least the alpha the cut removed there (**filled**); elsewhere `from` stays empty there (**left empty**): a transparent pixel is the author's statement that nothing lies under it (the background, or a part drawn behind), and a less opaque one is not half-filled. The image is read nowhere else, so its pixels over the band, over the box outside the polygon or where the layer had no art never change `from`. The `cut:` line then ends `; under <n> px filled, <m> px left empty` (`n + m` is every removed pixel), so an unintended hole is a number in the log, not a guess; the filled pixels count in `from`'s `opaque_px` and `occluded_px` (the piece is drawn over them), never as visible or projected. The stage refuses: a file that is not there (`ASSEMBLE_UNDER_PRESENT`) or not a PNG (`ASSEMBLE_UNDER_DECODES`), an image not exactly the box's size (`ASSEMBLE_UNDER_SIZE`, both sizes given), an image that fills none of the removed pixels — all transparent there, or another file (`ASSEMBLE_UNDER_EMPTY`; to leave the whole hole, drop `under`), and a piece drawn behind `from` (`ASSEMBLE_UNDER_DRAW`: the fill would hide it; draw it `"front"` or `{"before": "<the plan part after from>"}`). Producing the image is the author's, by whatever means; absent, `from` keeps only its band. `under_fill` (issue #360), optional, is the one value `"colour"` (`CONFIG_FIELD_TYPE` on any other): the same pixels are filled and left empty, and a filled pixel takes the image's **colour** at the alpha the cut removed there instead of the image's alpha, so `from`'s alpha is the uncut layer's wherever the image fills and its silhouette does not grow — an opaque image over a soft edge leaves the edge soft. It applies to the part's hidden-art layer as well as to a file; a cut with neither is refused (`ASSEMBLE_UNDER_FILL_SOURCE`). The `cut:` line's filled count then says how many took the colour only: `; under 190 px filled (190 colour only, at the alpha the cut removed), 0 px left empty`. Absent, a filled pixel takes the image's colour and alpha, as above |
|
|
121
121
|
| `assemble.alternates` | assemble, rig, check (`--set`, `--all-sets`) | **authored**, optional (issues #454, #465, #472, #473, #476): `[{name, source?, full?, head?, head_box?, parts?, hides?, cuts?, skeleton?, anchor?, base_anchor?, drawn?, tips?, front?}]` — alternate painting sets assembled into `<out>/rig/parts/<set>_<part>.png` (`parts.json` `alternates`), attached on each covered slot in `rig.json` as `<set>_<part>` beside the base attachment, and indexed in `<out>/rig/sets.json` (`rig-parts-sets/1`: `sets.<set>.slots`, `.hides`, `.drawn` when present, and `.threshold: {yaw: 15, pitch: 12}` when the set replaces `face` on a rig with `turn` or `turn`/`tilt` slider animations). `source`, `full` and `head` may instead be given on the CLI with `--alt <name>=<source>:<full>[:<head>]`. Windows absolute drive paths such as `C:\paint\painting.png` are accepted as written; each segment's leading drive colon belongs to that path, while other colons still separate `source`, `full` and `head`. `parts` lists the subset of parts the set replaces (default: every part not in `hides`); a **subset set** (issue #473, e.g. mouth visemes `a`, `i`, `u` with `"parts": ["mouth"]`) cuts only its covered parts from the alternate runs (refusing with `ASSEMBLE_ALT_INPUT_PRESENT` if a covered part's layer is missing or empty), writes only `{slot: "<set>_<slot>"}` in `sets.json` so `@rig-c/play`'s `setSet(name)` switches those slots while leaving every other slot on its base attachment (and `setSet(null)` restores the base pose), may be keyed on a slot attachment track in `motion.animations_from` as `{"t": …, "set": "<name>" \| null}` (`CONFIG_SET_COVERS_SLOT` if `"set"` is undeclared or does not cover the track's slot), and under `check --set <name>` counts `ANIMATIONS_DO_NOT_FOLD` only on its own covered slots; `hides` lists slots the set hides (`null` in `sets.json`). A **gesture subset set** (issue #476) covers a limb chain declared in `config.limbs.<limb>` (all of its segment `part`s; with `drawn` alone, cut at the base's joints posed to the set's own `drawn` angles by `poseBoneEntriesForDrawn`, each segment keeping the base's length; with `skeleton` (issue #539), cut at the skeleton's own joint positions by `placeBoneEntriesForSkeleton` — each covered bone the body-18 table names (`sleeve_*`, `arm_*0`/`arm_*1`, `leg_*0`/`leg_*1`) at its skeleton origin with the skeleton segment's own length and direction (`drawn` overriding the direction of a bone it names), and a covered bone the table does not name (a hand link `arm_r2`, a single `foot_r`) placed from its parent's new place — its base offset from the parent, stretched along the parent by the parent's length change and turned by its turn, so a link or a foot at the parent's end lands on the skeleton's end — with its base length and the drawn or base direction, so a foreshortened shin or forearm is cut where it is painted; naming the unsplit `from` layer, covering only some segments of the limb, or declaring polygon `cuts` on a limb set is refused with `CONFIG_LIMB_SET_JOINTS`) and carries `drawn` (or `skeleton`) for the covered bones only (giving `drawn` for an uncovered bone is refused with `CONFIG_SET_COVERS_BONE` / `RIG_SET_COVERS_BONE`; uncovered bones keep the base's `drawn`). A subset set's limb part takes no pixel that a base part drawn after it, which the set neither covers nor hides, covers at setup (issue #587): the set's attachment is drawn in the base slot's place, so that base part is drawn over it and what the set's painting shows there is that base part (shorts over a leg set's thigh top, which See-through synthesised in the set's leg layer); `assemble` clears those pixels — the base part's PNG at alpha above 8, at its `parts.json` x, y, on the shared canvas — from the set's part once its limbs are cut, before any count — its `merged_px` and its cap's record too (issue #603): a cap pixel it clears leaves the count it was in (`layer_px`, `image_px`, `upper_px`, `lower_px`, `lower_kept_px`) for the cap's `excluded_px`, written only when above 0, so every count is the written PNG's — and prints `LINT set "<set>" <part>: <n> px under <base part> excluded` per part and base part that took a pixel (n counts alpha above 8); a set that carries that base part itself (`"parts": ["thigh_l", "shin_l", "bottomwear"]`) excludes nothing and writes what it wrote before. A subset set that names one limb side of a layer more limbs take (issue #588: `"parts": ["thigh_r", "shin_r"]` where `leg_r` and `leg_l` both take the one `legs` layer) would put every pixel of that layer on its one limb, so each of its parts would hold a piece of both legs; when the set's layer holds more than one island (8-connected pixels with alpha above 8) of at least 1 % of its largest (issue #608: the ghost clean-up's own share; a smaller island is a speck, which goes with the island nearest it — the one holding the pixel centre nearest one of the speck's, none when two are equally near — and is never an island of its own), each segment part keeps the island its joints fall on — its bone's origin and the next segment's bone's origin, at the set's own bones, a joint on the island of a pixel whose square holds the point, and a joint on no island on the one island whose nearest pixel centre lies within the radius of the cap cut at that joint (`cap.radius`: an ankle just past the legwear's edge, on the shoe) — and drops the rest, once its limbs are cut and before the exclusion above, and `assemble` prints `LINT set "<set>" <part>: <layer part> holds <n> islands (8-connected, alpha above 8)[, and <s> speck(s) under 1 % of the largest (<f> px), each with the island nearest it], kept the one under <bone> [x, y] and <bone> [x, y][ (<e> px off it, within its cap's radius <r>)] (<k> px), dropped <m> (<d> px)` per part (k and d count the part's pixels above alpha 8, m the islands it lost one from, and `dropped none` when it lost none); a joint on no island with none or two within that radius, or with no cap cut at it (a limb's first joint), and a segment whose joints fall on two, are refused with `ASSEMBLE_ALT_LIMB_ISLAND` rather than guessed. A layer of one island — specks aside — may hold both legs over each other (a folded shin across the standing leg; issue #609): each of the set's segment parts then keeps the pixels nearer its own limb's segment line — the polyline of only its segments taking that source, their bone origins and the last segment's supplied tip or following segment's joint (issue #638) — than the other limb's, both in the set's pose, and gives the rest away, once its limbs are cut and before the exclusion above; a pixel whose two distances differ by 0.5 px or less (the overlap band: half a pixel, the reach by which a pixel centre is read as on a line) goes to the limb whose part there is drawn later in the base's draw order, and the `LINT set` line above counts what each part kept, gave and held in the band. The other limb stands where the set's `skeleton` places it — its keypoints place every limb bone of the body-18 table, the other leg's as well as the set's own (its `drawn` and `drawnLength` stay the covered bones') — and never at the base's place: a set that does not place it (a `drawn` set, which may not name a bone it does not cover, or a set with neither) is refused with `ASSEMBLE_ALT_LIMB_POSE` when its layer has art where the base draws that limb, and when it has none nothing says the layer holds it and the layer is cut as before; two limbs whose segment lines run closer than the limb's half-width over most of where their art can meet are refused with `ASSEMBLE_ALT_LIMB_OVERLAP`. A set that carries every limb of the layer is cut as before. For a subset set, where a limb's own source layer holds art (`alpha > 8`) under another layer of that run drawn in front (`alpha > 8`, by the projection's plan/depth order), the limb keeps its own layer pixels through projection, limb cutting, island/nearest-line assignment, base-footprint exclusion, fringe clearing and seam correction (issue #637). Those pixels are occluded, never counted as painting projection; no base footprint or painting colour replaces them. After source-art island/nearest-line assignment, a source-transparent cap pixel is assigned before protection, in both doors: its centre is compared against only the segments taking the recipient's source, at the set's supplied bones (ankle-to-toe for a separate foot source), with the existing 0.5 px overlap band and base draw order. A missing last endpoint is refused with `ASSEMBLE_ALT_LIMB_POSE`; an actual following joint may supply that endpoint, never a guessed point. An unposed other limb with base art beneath these cap pixels is likewise refused; without such overlap the existing compatible path retains the cap without inventing the other limb's pose. A pixel cleared by this assignment is never restored. `CAP_FROM_UPPER` records a copy made before assignment and alone proves no ownership: only a retained copy is protected beneath the upper segment, which is drawn over it. The source-art island selection itself is unchanged. Other retained cap pixels (from the layer or a supplied cap image) are protected under an actual front layer even where the lower source is transparent. Protection follows each assigned piece through exclusion, fringe clearing and seam correction; it never restores a pixel ownership removed. Cap pixels removed during ownership leave their original counts for `excluded_px`, just as excluded pixels do, so the cap ledger describes the written PNG. Target assignment reconciles this ledger even when there are no source-transparent cap candidates and when a direct caller does not request cover protection. Unprotected source pixels still obey the base-footprint exclusion. Missing limb/cap art is never extended or guessed. Base builds and uncovered, unexcluded sets keep their existing bytes. `skeleton` (a pose file path relative to the config's directory, `{"width": W, "height": H, "points": {…}}` with all 18 body-18 keypoints on the canvas, validated by the same rules as `generation.control.skeleton`: `CONFIG_FILE_PRESENT`, `CONFIG_IS_JSON`, `CONFIG_FIELD_TYPE`, `CONFIG_KEY_KNOWN`, `CONFIG_KEY_UNIQUE`, `CONFIG_POSE_CANVAS`, `CONFIG_POSE_KEYPOINTS`, `CONFIG_POSE_IN_CANVAS`) or `drawn` (`{<bone>: <worldDegrees>}`, each bone resolved against `bones`, `CONFIG_NAME_RESOLVES`) declares the posed angles the alternate was painted at (issue #465); when `skeleton` is given, `assemble` derives `drawn` from its 18 keypoints (filtered to covered bones on a subset set, with `drawn` overriding any bone named in both), records both `skeleton` (scaled by `assemble.rig_scale` to rig px) and `drawn` in `parts.json` `alternates` — and, when the skeleton placed the set's limb bones (issue #539), `drawnLength` (`{<bone>: <ratio>}`, each covered table bone's skeleton segment length over its base length, 6 places) and `registration` (`{offset: [dx, dy], scale}`: the similarity without rotation, about the canvas origin, that maps the skeleton's torso — the mean of its shoulders `r_shoulder`/`l_shoulder` to the mean of its hips `r_hip`/`l_hip`, read where the base declares the bone rooted there, `sleeve_*0`/`arm_*0` and `leg_*0` — onto those base bones' origins, 6 places), both also written to `sets.json`; the set's painting must be registered, its torso within 1 rig px and 1 % in scale of the base's, or the set is refused by name before any joint is cut (`ASSEMBLE_ALT_SKELETON_REGISTERED`, with the offset and scale the painting would need) — and the `rig` stage writes `<set>_*` region and mesh attachments in the bone-local frame of `poseRigBonesForDrawn(bones, drawn)` (weighting limb segments directly from `skeleton`'s joint endpoints when `skeleton` is present) and emits `drawn` in `sets.json` so `rig-pose` and `check --set <name>` / `--all-sets` pose the bones at `drawn` without rotating the already-posed art a second time. `front` (issue #664) lists covered limb segment parts the set draws on their **front slot** instead of the base slot: each must be in the set's `parts` and not its `hides`, and listed in some `config.limbs.<limb>.front.parts` (`CONFIG_SET_FRONT`); the set then maps `<part>_front` (never `<part>`) to `<set>_<part>` in `parts.json` and `sets.json` and hides `<part>` (and `<part>_still`), its #587 exclusion counts only base parts drawn after the front slot's target, and keying that part's set on a slot track is refused (`CONFIG_SET_FRONT_KEYED`) — *Front slots (issue #664)* below `layers` optionally maps covered, nonhidden output part names to layer names in their existing source run (issue #666); for example `"layers": {"upperarm_r": "author:raised", "forearm_r": "author:raised"}`. Limb cuts, caps, islands and base exclusions read the selected layer; the base plan stays unchanged. |
|
|
122
122
|
| `assemble.head_face_underfill` | assemble, `assemble --propose-plan` | **authored**, optional (issue #492): `boolean` (`CONFIG_FIELD_TYPE` on any other). When both runs exist and `full:face` has at least `200` opaque run px (`PROPOSE_MIN_PX`), the stage maps `full:face` into the head canvas via `fullLayerToHead` and measures how much of its hole-filled silhouette (`alpha > 8`) is covered by `head:face` (`alpha > 8`). A head-run `face` covering less than `75 %` (`HEAD_FACE_COVERAGE_FLOOR`, measured `0.0 %..48.6 %` on hollow/omitted head runs vs `84.8 %..99.6 %` on clean head runs across the 4 public examples and 9-standee corpus) is refused with `SEETHROUGH_HEAD_RUN_HOLLOW` unless `head_face_underfill: true` is declared. When `head_face_underfill: true` is declared and `head:face` exists (`opaqueRunPx >= 200`), `fullLayerToHead(full:face)` is composited under `head:face` on the head canvas (`alpha = max(headAlpha, fullAlpha)`, RGB blended by `headAlpha / 255`) before `head:face` is placed in rig space (`underfill=<N>px(full:face)` on the `face` part log line and a `face: head_face_underfill composited …` note in `assemble --propose-plan`). The fill restores transparent pixels only and leaves the cut's own edge where it is — a hollow whose edge is not under hair stays visible, and that is the author's to fix at the cut. When `head:face` has fewer than `200` opaque pixels, `SEETHROUGH_HEAD_RUN_HOLLOW` still fires even under `head_face_underfill: true` because the head run omitted the face layer and cannot supply a jawline |
|
|
123
|
+
| `assemble.yield_refused` | assemble | **authored**, optional boolean, default `false` (issue #819; other types: `CONFIG_FIELD_TYPE`). With `true`, only an original front projection-core pixel refused at max-channel drift > `DRIFT_LIMIT` (90) can yield: its original source pixel must still be opaque, and the actual top-most opaque holder below it (alpha >= `CORE_ALPHA`, 250), after earlier yields, must have colour within 90 of the painting. A deeper matching part cannot bypass an intervening opaque mismatch. This setting also applies to alternate sets. Its alpha becomes 0; RGB is not repainted. Merge/ring replacements are not original refused pixels. Front is relative to the matching part behind, so original refusals in another run are eligible even when a different part is the global top holder. The reading proceeds back to front against the current behind pixels; alpha changes do not repaint or create a new matching colour. `yieldReadings` records skipped merge/ring/nonopaque/no-match counts and original/final global holders; a yielded pixel also taken by projection closing is omitted from the written `source_px_taken` count. Existing cuts/patches and thresholds are unchanged. The `drift:` line reports `yielded N px` per affected part, even below the drift-body size bar; with the setting off it names `assemble.yield_refused: true` as the conditional remedy. Rebuild and inspect the newly exposed layer in motion before considering any cut; a mismatching or absent behind holder cannot be repaired by this setting. |
|
|
123
124
|
| `limbs` | assemble (the cut and the caps), rig (through `regions`), check (`LIMB_ONE_BONE`) | **proposed** by `propose --keypoints` (issue #349), then checked: `{<limb>: {segments: [{part, from, bone}, {part, from, bone, joint, range?, cap?, edge?, cap_shape?, cut_band?, hybrid?}, …], split?, layout?, front?}}`, the upper segment first. The rule is *Limbs: cut at their joints* below the table. `part` is a new part (`CONFIG_PART_NAME`, `CONFIG_PART_UNIQUE` against the plan, patches, cuts and every other limb part); `from` a plan part or a cut's piece (`CONFIG_NAME_RESOLVES`) — the layer the segment's pixels come from, which is cut into the limb parts and is not itself made: a `meshes` or `regions` entry for it is `CONFIG_NAME_RESOLVES`, and the segments of one limb that take one part are consecutive (`CONFIG_LIMB_FROM_RUN`); `bone` a declared bone, each segment's the child of the one before (`CONFIG_LIMB_BONES_CHAIN`); the upper segment names no `joint`, `range`, `cap`, `edge`, `cap_shape` or `cut_band` (`CONFIG_KEY_KNOWN`), every other names its `joint` (`CONFIG_FIELD_PRESENT`) — the joint is its bone's origin; `range` is `[min, max]` degrees from rest with `min <= 0 <= max` (`CONFIG_LIMB_RANGE`), which `assemble` writes into the lower part's `parts.json` record and `check` poses the joint at — its two ends and its middle — reading the seam there (`SEAM_OVER_RANGE`, issue #360; rig-c needs no rotation limit); `cap` a PNG path relative to the config's directory (`CONFIG_FIELD_TYPE`); `edge` `"feather"` (issue #360), the one value it takes, and `cap_shape` `"disc"` (issue #360) or `"ball"` (issue #579) (`CONFIG_FIELD_TYPE` on any other) — the cut's geometry at that joint, *Limbs: cut at their joints* below; absent, the cut is hard and the cap the layer's half-disc of half the limb's width; `cut_band` a whole number of px, 1 or more (`CONFIG_FIELD_TYPE`), on a segment that takes the segment above's part — between two layers nothing is cut, so a band there is `CONFIG_KEY_KNOWN` — places the cut within that many px of the joint line (issue #360, *Limbs: cut at their joints*); absent, the cut is the joint line. Each limb part is attached like any part — `regions.<part>`, which must be the segment's `bone` (`CONFIG_LIMB_BONE`), or a mesh, which `check` holds to that bone alone (`LIMB_ONE_BONE`). With `limbs`, `assemble` reads `bones` too (`CONFIG_FIELD_PRESENT` without it). Absent, nothing is cut at a joint and no byte of any output moves. Optional `front` (issue #664), `{parts: [<own segment part>, …], after: "<produced part>"}`, gives each named segment a second slot `<part>_front`, empty at setup, placed after `after`'s slot family, for a gesture set to draw on (`CONFIG_FRONT_SCOPE`, `CONFIG_FRONT_NAME`, `CONFIG_FRONT_LAYOUT`; *Front slots (issue #664)* below) |
|
|
124
125
|
| `bones` | rig; `propose --from-config` | **proposed** by `propose`, then corrected. A single bone `{name, parent, at, tip?}` or a chain `{chain, parent, points, tip, link_inherit?}` whose links are named `<chain>0 … <chain>n`. Parents come before children. In `rig.json` each link is **turned along its chain** — `rotation` is the direction from its origin to the next link's (the last link's to `tip`) and `length` that distance (issue #73), so a physics constraint added downstream finds a lever; under `--idle-keys ctl` the link's `<link>_ctl` carries the turn and the length and the link sits at local rotation 0 beneath it. A single bone with a `tip` is turned the same way, towards its tip, with that distance as its length (issue #239); a tip on the bone's own origin is refused (`RIG_TIP_DISTINCT`). The five face bones `eye_r`, `eye_l`, `brow_r`, `brow_l` and `mouth` (by name, when one has no tip of its own) are turned to the eye line — the line through the origins of `eye_r` and `eye_l` as `bones` writes them, read image-left to image-right, drawn when parts.json holds both an `eyewhite-r` and an `eyewhite-l` part — so the blink's `scaley` squashes across the eye line on a tilted head; move an eye bone and the line moves with it. With one eyewhite or none, or an eye bone missing, the rig stage's `face axis:` line says so and they keep the page's axes. A bone under a face bone keeps the face's axis. With the line, `rig.json` also declares `invariants.axes` — one entry, `"face"`, through `eye_r` and `eye_l`, holding the turned face bones (and their controls) — so rig-c's gate holds the build to the line; the line is the one rigc draws through the same two bones, so the tolerance is only the float floor — the largest gap the emitted (float32) bones have to it, rounded up to 6 places plus one 6-place unit — and the `face axis:` line prints it. With the line the rig stage also adds `head_up` (issue #250): a slotless bone under `head`, at head's origin, turned to the eye line + 90 degrees and as long as the eye midpoint lies from head's origin along that axis — the head's frame, which a rule that needs it reads; `head` keeps its own frame, so no key on it or under it changes meaning, and a config bone of that name is refused (`RIG_HEAD_UP_NAME_FREE`). A face bone with its own `tip` is held too (issue #258), in a second entry, `"face_tips"`, when its tip lies along the line within whole-pixel rounding — a tip written in whole pixels sits at most sqrt(2)/2 px off the point of the line it stands for, so its direction may sit up to asin((sqrt(2)/2) / length) degrees off — with its tolerance measured the same way; a tip further off is the bone's own axis, and the `face axis:` line names it with its gap and that bound. A failure is rig-c's `A51_BONES_LIE_ALONG_THEIR_DECLARED_AXIS` line, which names the bone and the fix (rig-c's `docs/AUTHORING.md` §3.7 and §5.2); with no line no entry is written and A51 reports SKIP. Every region on a turned bone is turned back, so the setup pose does not move. Any other single bone keeps world rotation 0; one whose parent is a link is turned back upright. A single bone may declare `inherit` (issue #348): what it takes from its parent's transform, one of rig-c's own mode names exactly as rig-c's table spells them — `normal`, `onlyTranslation`, `noRotationOrReflection`, `noScale`, `noScaleOrReflection` (rig-c's `RigBone.inherit`) — written to that bone in `rig.json` as declared; any other spelling, `"NoScale"` included (the runtime would fold its first letter; nothing here folds or maps), is refused (`CONFIG_BONE_INHERIT`), and a chain takes no `inherit` (`CONFIG_KEY_KNOWN`). A chain may instead declare `link_inherit` (issue #369), an object mapping its own expanded link names to those same modes, for example `"link_inherit": {"leg_r1": "noScale"}`. Only the named link changes; omitted links inherit normally. A key outside this chain is `CONFIG_NAME_RESOLVES`, with this chain's valid link names in the detail; a non-object or non-string mode is `CONFIG_FIELD_TYPE`, and another mode spelling is `CONFIG_BONE_INHERIT`. The mode is forwarded to the expanded link, or to its control under `--idle-keys ctl`, by the same rule as a single bone. This is an authored opt-in: `propose` does not add it. Its setup rotation is the turn from where rig-c's own poser puts the bone with no rotation of its own under that mode, so it still stands upright (or along its tip) at the setup pose. Where the idle gives the bone a `<bone>_ctl`, the mode goes on the control: the control is the bone the parent's rotation reaches, and the bone under it inherits normally, so the idle's keys moved onto the control still turn it. A foot that does not take its shin's rotation (`noRotationOrReflection` or `onlyTranslation`) keeps its shoe level while the leg is posed (`FEET_STAY_LEVEL`, §7); which mode is the author's. `noScale` keeps a shin or shoe's shape under a scaled parent but still takes the parent's rotation: a shoe that must also stay level needs a separate rotation constraint, for example a transform constraint from an unrotated bone. This does not change the proposed feet's existing inheritance or `FEET_STAY_LEVEL` default. An automatic mesh weighted through a bone with a mode other than `normal` gets no derived amplitude (its row names the bone) and no residual envelope (rig-c's `SKINNING_RANGE_UNSUPPORTED`). Absent, `rig.json` carries no `inherit` and no byte moves |
|
|
125
126
|
| `meshes.<part>` | rig | **proposed**, then corrected. Generated modes below; `explicit` transfers an accepted mesh (see “An accepted mesh”). Exactly one mode is allowed. `grid` (the lattice: cell size, px — what `propose` writes: by default one spacing for the figure, round(H / 37) rig px with H the height of every part's box together, a part whose tenth of its short side is already coarser keeping that, and under `propose --grid-rule part` the reference's tenth of the part's short side clamped to 5..36, issue #265), `contour` (the outline mode, authored; the next row and "A contour mesh" below) or `auto` (the automatic mode, authored; "An automatic mesh" below) — two, or none, is `CONFIG_MESH_MODE`. In distance-generated modes: `r` (added to every distance before weighting: `w = 1/(d + r)²`), `segments` (a chain name, a bone name with a `tip`, or `[bone, [x0,y0], [x1,y1]]`), and, **authored**, optional, `exponent` (issue #161): a number above 0 that replaces the 2 in that rule, `w = 1/(d + r)^exponent` — a larger one hands each vertex more fully to its nearest bone; absent is 2 and changes no byte, a value that is not a number above 0 is `CONFIG_FIELD_TYPE` at `meshes.<part>.exponent`, and a declared one is echoed as `exponent` in the mesh's `mesh_report.json` row; the exponent is the distance rule's, so declared beside `rule: "heat"` it is refused (`CONFIG_FIELD_TYPE` at `meshes.<part>.exponent`). The segment list is the one authored decision about a layer: which bones may pull it. The slot's bone is the first segment's. Optional `rule` (issue #161): `"distance"` — the rule above, and what an absent `rule` means (every byte is the same) — or `"heat"`, bone heat over the part's own silhouette, in every mode: the lattice's art (alpha above 8, less any island a declared `stray` left out) with holes filled, or for `contour` and `auto` the silhouette their outline is traced from (that mode's art — alpha above 8 for `contour`, alpha 1 and above for `auto` — less any island a declared `stray` left out, holes filled, grown by its `margin`); each bound bone's sources are the silhouette pixels whose centre lies within 0.75 px of its segment (a pixel two bones reach goes to the nearer, a tie to the first listed), held at 1 for that bone and 0 for the others; the field is solved by row-major Gauss–Seidel over-relaxation to a sweep change under 1e-7 within 20000 sweeps; a vertex reads the nearest silhouette pixel and takes the same cap and floor (and `regions`) as the distance rule; `r` is not read. The mesh's `mesh_report.json` row gains `heat` (the constants, each bone's sources and sweeps, the residual). Any other value is `CONFIG_FIELD_TYPE`; a bound bone with no source pixel is `RIG_HEAT_BONE_SOURCE`, an island no bone has a source in `RIG_HEAT_ISLAND_SOURCE`, a solve past its sweep bound `RIG_HEAT_CONVERGED` — none is weighted 0. The rule is chosen per mesh, so `RIG_HEAT_BONE_SOURCE` names three remedies: move the segment onto the art, take the bone out of `segments`, or keep this part on the distance rule — the one to take when the bone anchors the part from outside its art (a torso bone under a neck), since the first moves a bone another part placed and the second drops the anchor (issue #303). On a lattice, `RIG_HEAT_ISLAND_SOURCE` on an island that is dust — at most 4 px and at most 0.1 % of the part's art px, `mesh-draft`'s line — names `meshes.<part>.stray` and the figure that leaves it out, with the value declared; an island above that line keeps the segment remedy, a real piece being a real authoring question. In every mode the mesh's `mesh_report.json` row's `bones` names the bones the emitted model binds for the attachment — the sorted set its weights in the written `rig.json` name, so a `turn` twin (`turn_<part>_<bone>`) or a stopped link's `<link>_d` where those rebind it, never the segment bone it stands for — the same list in every mode, `remesh --delta`'s included (issue #536) Optional `gather: false` keeps an exclusively bound non-segment limb rider at its authored draw position (issue #680); its binding and mesh geometry are unchanged. Remove the key for normal gathering; a non-rider is refused as `RIG_GATHER_RIDER`. |
|
|
@@ -135,7 +136,7 @@ read by no CPU stage).
|
|
|
135
136
|
| `motion.blink.still` | rig | **proposed** only for a lash `propose` notes (below), then checked: `{<part>: {row, bone}}` — the rows of that region part above `row` (rig px, y down) are drawn by a second slot `<part>_still` on `bone` and do not blink; rows from `row` down keep the part's slot and blink. The part must be a region on a bone `eyes` names, `bone` one it does not (`CONFIG_STILL_OFF_THE_BLINK`), and `row` a row of the part with no art across its whole width (`RIG_STILL_ROW_CLEAR`) |
|
|
136
137
|
| `motion.animations_from` | rig; check (named; read for folds) | optional, never proposed (issue #183): a path, relative to the config file's directory, to a file in rig-c's motion-spec shape, `{"spec": "rigc-motion/1", "animations": {"<name>": {"duration": …, "tracks": [...]}, …}}` — an expression, a gesture, anything beside the idle. On every `rig` and `build` each of its animations is written into `rig/motion.json` after `idle`, as read: nothing added, re-keyed or judged here (except `derive` keys on `turn`/`tilt`, issue #436, and `{"t": …, "set": "<name>" \| null}` keys on slot `"attachment"` tracks, issue #473, which expand to `"v": "<set>_<slot>"` or `"v": null` when the set hides the slot, or `"v": "<slot>"` for `null`, refused with `CONFIG_SET_COVERS_SLOT` when the set is undeclared or does not cover the track's slot), and each is rigc's to accept or refuse at the rig stage's gate, in rigc's words. It may name what `motion.json` already holds — the bones `bones` declares, the easings `shut` and `open`, the groups `eyes` and `brows` when the blink writes them — and nothing else from the file reaches it. The loader refuses, every problem at once: no such file or one that cannot be read (`CONFIG_FILE_PRESENT`), text that is not JSON (`CONFIG_IS_JSON`), a file that is not an object, a `spec` other than `"rigc-motion/1"`, an `animations` that is not a table of objects (`CONFIG_FIELD_TYPE`), any other key — rig-c's `easings`, `groups`, `setup`, `physics`, `mix`, `archetype` and `cut` included, which would be read and not written (`CONFIG_KEY_KNOWN`), an animation named `idle` (`CONFIG_ANIMATION_NAME_FREE`), and a key written twice in one object of the file, which JSON would fold into its last value without a word (`CONFIG_KEY_UNIQUE`). `check` names the others on one line (`beside the idle: …`) and reads each for folds, with the idle — `ANIMATIONS_DO_NOT_FOLD` (§7, issues #320, #333); every other bar reads the idle. Absent, `motion.json` holds the idle alone, byte for byte as before, and `check` reads that idle for folds |
|
|
137
138
|
| `constraints` | rig (handed to rig-c as `rig.json`'s `constraints`); `compare` and the coverage lines (roles) | **authored**, optional; `propose` writes none, but with `--cloth` (issue #364), where it writes the recipe's physics and swing transforms (*Recipe: cloth and hair that answer the world*, below). A list of constraints in **rig-c's own rig-spec shape** (`RigConstraint`: `ik`, `transform`, `path`, `physics`, `slider` — rig-c's `src/rig.ts` documents every field), in the order rigc applies them. The loader checks only what this package owns: each entry is an object with a `type` rigc names (`CONFIG_CONSTRAINT_TYPE_KNOWN`) and a non-empty `name`, unique within its kind as rigc finds constraints (`CONFIG_CONSTRAINT_NAME_UNIQUE`; an ik and a transform may share one); every bone it names — `bones`, an ik's `target`, a transform's `source`, a physics or slider constraint's `bone` — is a bone `bones` declares, a chain link as `<chain><i>` (`CONFIG_NAME_RESOLVES`); the bone a constraint follows does not sit under a bone it drives (`CONFIG_CONSTRAINT_TARGET_DETACHED`). Every other field (`mix`, `softness`, `properties`, a path's `slot`, a slider's `animation`) and every value is rigc's to accept or refuse at the rig stage's gate, in rigc's words (`RIG_RIGC_GREEN`) — an ik's `bones` as a shape too: from rig-c 2.15.0 rigc refuses an ik over more than two bones, or over a pair whose second bone is not the first's child (issue #103; this loader refused both itself until then). A note and an `x-` record may ride on an entry; the rig stage leaves them out of what it hands rigc. Under the default `--idle-keys ctl` a two-bone ik whose child link the idle keys is split by that link's control, and rigc refuses the pair: run `rig --idle-keys direct` or `build --idle-keys direct` (the rig stage adds that sentence, naming the flag on the command that ran, to rigc's line; `build` forwards it to its rig stage, issue #95). Each bone a constraint follows is declared to rigc as `invariants.detached` from every bone it drives, which rigc's gate rule `A25` checks |
|
|
138
|
-
| `stops` | rig (handed to rig-c as `rig.json`'s `stops`, and moves slots, mesh weights and child bones on stopped links onto `<link>_d`); `propose --from-config` (`LINT stop on <chain> …`) | **authored**, optional (issues #404, #447): `[{chain, links?, against, at, inward, outward, lower?: {inward, outward}}]` — rig-c's leg stops (`RigStop`, rig-c 2.56.0,
|
|
139
|
+
| `stops` | rig (handed to rig-c as `rig.json`'s `stops`, and moves slots, mesh weights and child bones on stopped links onto `<link>_d`); `propose --from-config` (`LINT stop on <chain> …`) | **authored**, optional (issues #404, #447): `[{chain, links?, against, at, inward, outward, lower?: {inward, outward}}]` — rig-c's leg stops (`RigStop`, rig-c 2.56.0, `@rig-c/core/src/stop.ts`). `chain` is a chain `bones` declares (`CONFIG_NAME_RESOLVES`, `RIG_NAME_RESOLVES`); `links`, optional, is a non-empty list of links of that chain (`CONFIG_NAME_RESOLVES`, `CONFIG_FIELD_TYPE`), or absent for every link of `chain` in chain order; `against` is a bone `bones` declares, a chain link as `<chain><i>` (`CONFIG_NAME_RESOLVES`, `RIG_NAME_RESOLVES`); `at` is `[x, y]` in `against`'s local space, as rig-c's stop takes it (`CONFIG_FIELD_TYPE`): since each chain link (`leg_r0`, `leg_r1`) is turned to point along its segment (`+x` from origin to next link or tip, `+y` 90° counter-clockwise in Spine world), `at: [d, n]` sits `d` px from `against`'s origin toward its end and `n` px perpendicular to it; `inward`, `outward` and `lower.inward`, `lower.outward` are finite numbers (`CONFIG_FIELD_TYPE`). Every other stop rule — non-negative bounds, each stopped link written by a constraint, `against` not under the stopped chain, the aim not degenerate, `\|rest\| + outward <= 180°` (`RIG_STOP_BOUNDS`) — is rigc's to accept or refuse at the rig stage's gate, in rigc's words (`RIG_RIGC_GREEN`). **Rising-limb / prone geometry (issue #447):** rig-c's `expandStops` aims `<chain>_rest` from `links[0]`'s setup origin at `<chain>_touch` (`at` in `against`'s local frame) and clamps `<link>_d` inside `[rest − inward, rest + outward]`; Spine wraps rotation at `±180°`, so `\|rest\| + outward <= 180°` is required (`RIG_STOP_BOUNDS`). Whenever `<chain>_touch` lies **above** `links[0]`'s root in rig pixels (`ty < y0`, i.e. higher Spine `y` — e.g. stopping a hanging cloth chain against a rising shin `leg_<s1>` in a prone or kneeling pose where the knee sits below `links[0]` and the ankle above it, so positive `at[0]` walks upward along the shin past `links[0]`'s root), `rest` lands in the upper half-plane (`\|rest\| > 90°`) and `\|rest\| + outward` exceeds `180°`. Stop against the descending thigh (`leg_<s0>`), set `links` to start at a link whose root sits above `<chain>_touch`, or omit the stop when the rising shin sits outside the hanging chain's sweep; `propose --from-config` prints `LINT stop on <chain> …` with the exact coordinates and angles when `<chain>_touch` lies above `links[0]`'s root or `\|rest\| + outward > 180°`. For every stopped link `<link>`, the rig stage moves any slot on `<link>`, any mesh weight on `<link>`, and any bone whose parent is `<link>` (a branched cloth tree's branches hanging from `<trunk_last>`, before `--idle-keys ctl` adds `<bone>_ctl` and before `turn` adds `turn_<part>_<bone>`) onto `<link>_d`, the drawn link bone rig-c's `expandStops` creates at `<link>`'s setup frame to carry the clamped rotation. Absent, `rig.json` carries no `stops` and no byte of any output moves |
|
|
139
140
|
| `turn` | rig (adds the turn control or 2.5D head-turn producer) | **proposed** only with `propose --full`/`--head` (issue #251), then corrected, or **authored** for 2.5D depth-sampled head turns (issue #763): `{pivot?, depths?, deform?, band?, radius?, surface?: {radius?}, head?: {pivot?, radius?}, roles?, counter?, grid?, unitDepths?, body?}`. When `roles` is declared (`{<part>: "surface" \| "unit" \| "rear"}`, issue #763; `CONFIG_TURN_ROLE_UNKNOWN`, `CONFIG_TURN_SURFACE_REQUIRED`, `RIG_TURN_SURFACE_MESH_BINDINGS`, `CONFIG_TURN_UNIT_MESH_BONES`), the rig stage runs the 2.5D depth-sampled head-turn producer: it edge-extends each turn-bound part's depth sheet across its transparent border and semi-transparent fringe from the nearest fully opaque (`alpha === 255`) texel before `PAD = 4` clamping (`padTurnDepthSheet`, `DEPTH_SILHOUETTE_SIZE_MISMATCH`), keeps authored `"surface"` meshes and their skinning (#795), sampling each vertex at its weighted setup position on its own extended sheet and emitting one inverse-setup-bone offset per influence (`D = -(pivot + z - zRef) * sin(angle)`, on x for yaw and y for pitch, with no narrowing or 2D spin); shared frames moved by another turn role are refused (`RIG_TURN_SURFACE_MESH_BINDINGS`), as are alternate drawings without their own depth sampling frame (`RIG_TURN_SURFACE_MESH_ATTACHMENT`). It promotes `"surface"` regions to `generator: {kind: "grid", cols, rows, depth}` (`grid`: `[cols, rows]` or `{<part>: [cols, rows]}`, default `[13, 16]`, bounded at `<= 2,400` triangles per slot and `<= 4,000` total, `RIG_TURN_GRID_BUDGET`, `RIG_TURN_SURFACE_DEPTH_REQUIRED`, `RIG_TURN_SHARED_DEPTH_SCALE`), emits `faceshift` and `rear_shift` under `head` (`CONFIG_TURN_HEAD_BONE`, `RIG_TURN_HEAD_BONE`), `<part>_surface` and `<part>_unit` under `faceshift`, and `yaw_dial` and `pitch_dial` under `root` (`CONFIG_TURN_BONE_FREE`, `RIG_TURN_NAME_FREE`), re-parents `"unit"` region bones and `"rear"` bones and mesh weights to `faceshift` and `rear_shift` (while `"unit"` mesh parts receive their own `<part>_unit` carrier under `faceshift`, rebind direct `"head"` weights to `<part>_unit`, reparent bound chain roots to `<part>_unit` while keeping chain skinning weights intact, and key `<part>_unit` in `turn_units`, #790), samples each `"unit"` bone's depth from the `"surface"` depth sheet at its rest position (or reads `unitDepths.<part>`, `RIG_TURN_UNIT_DEPTH_REQUIRED`), enforces ear occlusion (`ear_r`/`ear_l` drawn before the `face` surface in `assemble.plan`, `CONFIG_TURN_EAR_DRAW_ORDER`, and behind the cheek surface, `RIG_TURN_EAR_DEPTH_BEHIND_CHEEK`), and writes `turn` and `tilt` `derive` tracks (`pivot` default `55` rig px, `counter` default `0.1` in `[0, 1]`, `CONFIG_TURN_COUNTER_RANGE`). `depths` holds, per part, the See-through layer's `depth_median` the part came from (larger = further back), read from the run the part was assembled from; a `painting:` patch has none and is not carried. A rider (issue #271) — a part from an `eyewhite`, `irides`, `eyelash`, `eyebrow`, `nose` or `mouth` layer — is drafted at the `face` part's depth, 0.001 nearer when parts.json draws it after the face and 0.001 further when before: See-through makes no depth of its own for the eye group (it cuts them from one depth map of the combined eyes) and clamps nose and mouth to the face's median − 0.001, and the two runs' own medians for these layers disagreed by up to 0.47 and swapped their order against the face. Every other layer — ears, headwear and earwear included — keeps its own median, unless it rides another part's bone. With no `face` part, or more than one, the riders keep their own and a note says so. A rider by bone (issue #535) — a part every *ownable* bone of which (a chain link, or a bone no other bone hangs from; `head`, `chest` and any bone with a child are shared and never count on their own) is *hosted* by another carried part, the host of a bone being the carried part that binds it (its region's bone; a mesh's `segments`, `contour` and `auto` regions' bones) with the most `opaque_px`, the earlier in parts.json on a tie, and which hosts no bone itself — is drafted at its host's depth, 0.001 nearer when drawn after the host and 0.001 further when before, and a note names the host, the bones and its own median: a pin, clip or ornament on the back hair's links travels with the back hair, not with its own layer's depth. `propose` reads the proposal's own `bones`, `meshes` and `regions`; the face riders are read by their tag first and never by their bones. A part bound to two hosts' bones rides neither and a note says so. In the rig stage, an authored depth on a rider by bone whose fraction differs from its host's by more than 0.1 of the dial (`TURN_RIDER_APART`, a share of `pivot − nearest`) is refused (`CONFIG_TURN_RIDER_DEPTH`); the host is read off `parts.json`'s `opaque_px`, so the config loader cannot see it. One note lists each part's depth and where it came from; a carrier the other run places more than 10 % of `pivot − nearest` away gets a note naming both values and the run read — the two runs are not reconciled. `pivot` is the depth that stays put; `propose` drafts the mean of the parts' depths weighted by `opaque_px`, the one depth at which the painted pixels' centroid does not slide under the dial. The rig stage adds a bone `turn` under `root` at its origin that nothing keys — its local x is the dial, in rig px — and carries each part by `(pivot − depth) / (pivot − nearest depth)` of it: the nearest part all of it, a part behind the pivot the other way, a part at the pivot not at all. Each part rides leaf twins (`turn_<part>_<bone>`, an identity child of every bone its slot and weights bind) moved by one `transform` constraint (`turn_<part>`, after the config's own); the idle's keys, the `<bone>_ctl` controls and a physics constraint stay on the bones, and the dial moves none of them. Optional `deform` (`Partial<FaceDeformFractions>`, issue #436) overrides the Set B ×2.5 face surface deformation table (`FACE_DEFORM_FRACTIONS`, checked against `FACE_DEFORM_RANGES` by `CONFIG_TURN_DEFORM_RANGE`); when `applyFaceSurfaceDeform` runs on a rig whose `motion` carries `tilt` or `turn` slider `derive` keys, it requires `config.turn` (`CONFIG_TURN_REQUIRED`, issue #478; `propose --full`/`--head` drafts it), promotes `face` on `head` (or `turn_face_head` when `turn` is declared) to the uneven 5×5 grid mesh, keys `face`, `hair_front` and `hair_back` deform timelines and ear/topknot tracks from `evalPitchFaceSurface` and `evalYawFaceSurface`, and samples the same deform field across each `features` member's rest span (`featRx = (24 / 106) · W`, `featRy = (12 / 128) · H`) with its depth fraction `z / zRef` as the field's angle input and chord foreshortening (`scalex` narrowing on the leading side and widening on the trailing side, `scaley` on pitch) so every feature's bounding box stays inside the deformed face plate across the rated band (issue #468). On yaw (`issue #479`), `evalYawFaceSurface` evaluates a **cylinder projection** (`cylinderYawDx`: `Δx(x, θ, R) = R · (sin(clamp(arcsin(clamp(x / R, −1, 1)) − θ, −π/2, π/2)) − clamp(x / R, −1, 1))`) of radius `R` (`turnSurfaceRadius`: `turn.surface.radius ?? turn.radius ?? turn.head.radius`, positive rig px checked by `CONFIG_FIELD_TYPE`, defaulting to half the face plate's opaque width `W / 2`) tapered by a cubic Hermite outline weight (`wOutline = 1` for `\|ux\| <= 0.7`, reaching `0` at `\|ux\| = 1.0`) so features slide across a fixed outline (`iris` shift within `±2%` of `cylinderYawDx`), the trailing cheek strip widens (`>= 1.54×` at `±15°`), and the leading jaw edge holds fixed (`0 px` shift) unless explicit horizontal `turn.deform` overrides (`turn_mid_x`, `turn_lead_compress_x`, `turn_trail_shift_x`) request the flat yaw table. On yaw (`issue #478`), `applyFaceSurfaceDeform` also derives a **head-only pivot** (`headTurnPivot`: `turn.head.pivot` when authored, otherwise the `opaque_px`-weighted mean of `depths[part]` across the head parts `DEFAULT_HEAD_TURN_PARTS` — `face`, `hair_front`, `hair_back`, `ear_r`, `ear_l`, `hairpin` — from `parts.json`, falling back to `turn.pivot`) so a forward torso or arm in `turn.depths` does not pull the head's rotation axis in front of `face`: `hair_back` (`depth_median > headPivot`, negative `headTurnFraction`) and `hairpin` behind `headPivot` translate opposite to the face's turn (`dx = s · turn_face_center_x · W · (headPivot − depth) / (headPivot − nearestHeadDepth)`), emerging on the trailing side to compensate for the leading-cheek foreshortening and keeping the combined head silhouette width near-constant across `±15°` without any same-sign `turn_hair_back_cheek_x` term. Optional `band` (`number` or `{yaw?, pitch?}`, positive degrees, issue #472) declares the rig's rated face turn band (default `FACE_RATED_BAND`: `yaw <= 15°`, `pitch <= 12°`); declaring a `turn.band` or a `motion.animations_from` `turn`/`tilt` `derive.degrees` above `±15°` yaw or `±12°` pitch without an `assemble.alternates` entry that replaces `face` is refused (`CONFIG_FACE_BAND_EXCEEDED`), and on a single-plate rig `applyFaceSurfaceDeform` adds self-targeting transform constraints `yaw_clamp` (`[-15, 15]`) and `pitch_clamp` (`[-12, 12]`) ahead of the slider constraints so driving `yaw` or `pitch` beyond the rated band clamps at the boundary. At rest: with `turn` declared, no pixel differs by more than 1 level at dial 0 (not byte-identical; the cause is float noise in the identity child bones, and the constraints add nothing); without `turn`, byte-identical. Neither `pivot` nor `depths` has a default (`CONFIG_FIELD_PRESENT`); `pivot` and `head.pivot` must lie behind the nearest part (`CONFIG_TURN_PIVOT_BEHIND_NEAREST`). Absent, no control is added and no byte of any output moves |
|
|
140
141
|
| `scene` | assemble (the recomposite, its holes and the figure's mask); check, through `parts.json`'s `scene` block (`RECOMPOSITE_HOLES`, the seam) | **authored**, optional; `propose` writes none (issue #242). `{}` declares the painting a scene: the figure and its surroundings in one image, See-through's full run holding only the figure. With it, `assemble` reads the recomposite figures, the hole list and the `uncovered:` lines inside the figure — the rig pixels where any full-run layer's alpha is above 8 (`OPAQUE_ALPHA_ABOVE`, the cut every layer's painted pixels are read by) — each line starting `inside the figure (config.scene: …, <n> of <m> rig px)`; writes that figure as `figure_rig.png` (white on black) beside the recomposite, and a `scene` block in `parts.json`; flags error pixels on the error map inside it only (outside, the painting grey); and `check` leaves out of the seam every frame pixel whose composite sample reaches the painting's outermost row or column, saying how many (`seam_border` in `check.json`, and on the seam line). It takes no field: the figure and its threshold are derived. A key in it other than a record or an annotation is `CONFIG_KEY_KNOWN`. Absent, no byte of any output moves |
|
|
141
142
|
| `cloth` | `propose --cloth` only; no other stage reads it, so it moves no byte of any build | **authored**, optional (issue #364): one recipe per tag, `{"bottomwear": {…}, "back hair": {…}, "front hair": {…}}`, each `{chains, links, wind, gravity, split?, length_ratio?, strength?, damping?, alternate_damping?, translate?, swing?, part?, influence?}`. `influence` (issue #518) — `{across, max, shape, radius?}`: the parts this recipe meshes are drafted in the influence mode (`meshes.<part>.influence` above) at their lattice's cell, with `across`, `max` and `shape` as declared (each required — the reading behind the radius did not vary them) and `radius` as declared or, absent, drafted as the farthest vertex's distance plus 3 cells (the `influence.radius` row); without it the parts keep their lattice. `chains` — trees across the piece (for `back hair`, per side of the eye axis), a whole number, 1 or more; `links` — links from root to tip on every path, 1 or more; `split` — `{at, into}`: the first `at` links are the trunk, which forks into `into` (2 or more) branches; `at` below `links` (`CONFIG_CLOTH_SPLIT_BEFORE_TIP`); `length_ratio` — a path's last link over its first, above 0, default 0.5; `strength` — `{trunk, branch, edge}`, each above 0 and below the spring's stability bound (`CONFIG_CLOTH_SPRING_STABLE`), default 100 / 100 / 50; `damping` — in [0, 1], absent: rig-c's default; `alternate_damping` — the odd trees' damping, in [0, 1], beside `damping` and different from it (`CONFIG_CLOTH_ALTERNATE_DIFFERS`); `wind`, `gravity` — `[root, tip]`, each 0 or more, tip at or above root (`CONFIG_CLOTH_RESPONSE_GROWS_TO_TIP`); `translate` — the x and y mix of a dangling end's flutter, above 0 and at most 1; `swing` — `bottomwear` only, `{scales}`, one positive scale per tree (`CONFIG_CLOTH_SWING_SCALE_PER_TREE`); `part` — `bottomwear` only (`CONFIG_CLOTH_PART_ON_BOTTOMWEAR`), a non-empty part or cut-piece name: the `topwear` part that holds a skirt See-through returned inside it (a dress), or its skirt piece cut by `assemble.cuts`, which takes the skirt's trees (issue #402, *A skirt inside topwear* below; the part is checked by `propose`, `PROPOSE_CLOTH_PART`). The two defaults are the recipe's own, measured on its synthetic fixture (the recipe below). The recipe below says what each field drafts. The config written: `propose --cloth <config.json> --write-config <out.json>` (issue #537) writes this config's own text back with the sections the recipe drafts spliced in — `meshes.<part>` and `regions.<part>`, and `bones`, `constraints` and `motion.tracks` entry by entry by name (issue #552) — and every other byte as read; `--from <previous config>` (issue #571) takes an entry equal to the previous recipe's draft as the recipe's (*The config written*, under the recipe below) |
|
|
@@ -1559,7 +1560,7 @@ unreduced source on the rig's idle and passes the author's bounds (step 4). The
|
|
|
1559
1560
|
read, rather than by rig-c's admission after the call. The row's `source.contour` says so
|
|
1560
1561
|
(`fitConnectivity: 8`); the contour mode keeps its 4-connected reading and writes no such key. Its weights are the contour mode's — segments and region falloff — under the author's
|
|
1561
1562
|
`influences`, with no 0.03 floor unless the author writes one.
|
|
1562
|
-
2. **The call** — rig-c's `reduceMesh` (
|
|
1563
|
+
2. **The call** — rig-c's `reduceMesh` (`@rig-c/core/mesh`, 2.28.x) refines inside the declared
|
|
1563
1564
|
regions, then removes vertices while every declared bound still holds. Every number it is
|
|
1564
1565
|
handed is one of the fields below; `preset` is null (no preset exists yet: a preset will be a
|
|
1565
1566
|
named, versioned set of these numbers, expanded into the report), and no deform key or linked
|
|
@@ -1574,7 +1575,7 @@ unreduced source on the rig's idle and passes the author's bounds (step 4). The
|
|
|
1574
1575
|
swapped for the unreduced source — its UVs, triangles and hull as `reduceMesh` was handed them,
|
|
1575
1576
|
its own weights bound the same way (the **reference**, `build --profile rig-play` without
|
|
1576
1577
|
`--pack`: the same gate over the compile, and nothing reads a reference's pages). rig-c's
|
|
1577
|
-
`compareMeshesInMotion` (
|
|
1578
|
+
`compareMeshesInMotion` (`@rig-c/core/meshcompare`) poses both model documents on the idle
|
|
1578
1579
|
exactly as `check` renders it — `idle` at 12 fps over its duration, physics reset at 0 and
|
|
1579
1580
|
stepped by 1/12 s, no warm-up — at the render's frames (`grid`, i/12 s) and a frame interval's 0.381966 past each (`irr`, frames the render never
|
|
1580
1581
|
draws), and measures how far the reduced mesh carries each art pixel from where the source
|
|
@@ -3314,6 +3315,19 @@ from and what it measured), `rig.json` and `motion.json`, and from `build` the p
|
|
|
3314
3315
|
atlas — `check/build/skeleton.json`, `.atlas` and `.png` — that a Spine runtime
|
|
3315
3316
|
loads, with `check/contact.png` and the idle frames to look at.
|
|
3316
3317
|
|
|
3318
|
+
### Source before scissors (issue #819)
|
|
3319
|
+
|
|
3320
|
+
For a tear, ghost, smudge, outline or seam, first select an appropriate existing
|
|
3321
|
+
See-through layer/run or alternate; then measure a tighter See-through resolution,
|
|
3322
|
+
crop or settings if needed. Next measure the declared depth/turn role and, for a
|
|
3323
|
+
`drift:` line with a matching opaque behind holder, opt in with
|
|
3324
|
+
`assemble.yield_refused: true`. This config step only clears the original refused
|
|
3325
|
+
front alpha under the conditions in the field table; it does not paint a repair.
|
|
3326
|
+
Rebuild and inspect setup and the animation extremes. A polygon cut separates a
|
|
3327
|
+
piece that must move or change draw order independently; it is not the next way
|
|
3328
|
+
to conceal a visual defect. Measure those source/config alternatives before
|
|
3329
|
+
proposing a cut for a defect.
|
|
3330
|
+
|
|
3317
3331
|
### The correction loop (issue #359)
|
|
3318
3332
|
|
|
3319
3333
|
A parse can be wrong: a patch painted into the wrong layer, two layers that should
|
|
@@ -3409,7 +3423,7 @@ existing hardlinks are refused before artifact output; the ordinary mode names
|
|
|
3409
3423
|
| --- | --- | --- | --- |
|
|
3410
3424
|
| `layers` | the table, then one `author-made: layer "author:<label>" — …` line per layer the author made (group `author` in the table; §5, *A layer the author made*), then the `WARN` lines | every tag the plan will need has opaque pixels; one `face` in the head run; `0 WARN line(s)` | a run whose layer PNG is not its box's size (`LAYERS_PNG_MATCHES_BBOX`); a `WARN PLAN_LAYER_…` line (§6, *Plausibility*) |
|
|
3411
3425
|
| `sheet` of both runs | the tile list (and the sheet, if you can see) | eyes, irises, lashes and brows as left/right pairs in the head run | a head box that cut off an ornament: move `head_box`, re-run the head crop |
|
|
3412
|
-
| `assemble` | one line per part — its counts (`op=` opaque, `vis=` visible, `src=` taken / candidates, `unproj=` visible but not projected, `drift=<n> (<p>% of core)`, `merged=`, `seam=`; *parts.json*, below). `drift=` is `refused_drift_px` in rig px and its share of the part's candidates, `projected_core_px`, which it is a subset of (issue #314); no bar reads either. On the four public examples the share runs to 94.5 % (`scarf` `hair_back`, 479 of 507) and the count to 26,472 (`scarf` `topwear`, 22.3 %), and the seam override repaints refused top-most pixels afterwards, so a large count says where See-through's colour was not taken, not that the part is unlike the painting: the `drift:` line below is the one that names a body of them another part holds. Then the `pixels:` totals (opaque = visible + occluded; taken; visible but not projected), then `recomposite vs source: mean \|d\|, within 8, error px > 40, uncovered error px`, then `uncovered holes (8-connected): N` and the largest five as `uncovered hole K: <px> px at x,y wxh (between "<part>" <px> px, …)`, then one `uncovered: <n> of the <N> uncovered error px lie on the full run's "<tag>", in a body of <px> px at x,y wxh; <the rule that left it out>` line per full-run layer the plan does not take from the full run whose uncovered error holds a body (5x5-opened, 8-connected, at least 150 full-run px in rig px), then one `drift: "<part>" refuses <n> px of <run>:<tag> (its colour more than 90 off the painting, max channel), in a body of <px> px at x,y wxh (…); by the plan's draw order "<holder>" holds <px> px of it (…)[, "<holder>" drawn in front of "<part>"][; the painting is within 90 of "<behind>" (<px> px at alpha >= 250, drawn behind "<part>")]; informational: no gate reads this. Swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do): swap, rebuild and read this line again; if it moves, removing it needs different input layers. At rest, the seam pass repaints the holder's pixels that pass its rule from the painting` line per part whose drift refusals hold a body (the same opening and bar) that another part holds in the draw order or that a part drawn behind it matches within 90 of the painting (issues #255, #351, #758) — that layer is not what the painting shows there; no gate reads this line, swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do) — swap, rebuild and read this line again, and if it moves, removing it needs different input layers — and at rest the seam pass repaints the holder's pixels that pass its rule from the painting (none on the five public paintings), then, per subset alternate set, one `LINT set "<set>" <part>: <layer part> holds <n> islands (8-connected, alpha above 8)[, and <s> speck(s) under 1 % of the largest (<f> px), each with the island nearest it], kept the one under <joints> (<k> px), dropped <m> (<d> px)` line per limb part cut from a layer of more than one island when the set names one limb side of it (issue #588; issue #608: a joint taken to the nearest island reads `<bone> [x, y] (<e> px off it, within its cap's radius <r>)`, and a part that lost no pixel `dropped none`), then one `LINT set "<set>" <part>: <layer part> holds <limb> and <other limb> in one island (8-connected, alpha above 8), split by the nearest segment line at the set's bones: kept <k> px (<share>), gave <m> px (<share>) to <other limb>; <b> px in the overlap band (nearer one line than the other by 0.5 px or less) went to the limb drawn in front, <bk> kept and <bg> given` line per limb part cut from a layer of one island that a limb the set does not carry also takes (issue #609; k, m and b count the part's pixels above alpha 8, each share of the part's pixels before the split, 3 places) and one `LINT set "<set>" <part>: <n> px under <base part> excluded` line per subset alternate set's limb part and base part drawn over it that the set does not replace which took a pixel (issue #587, `assemble.alternates` above; none on the public examples, which declare no alternate set); and look at `render/recomposite_error_rig.png`. Between the part lines and the totals, one `author-made: part "<part>" (<run>:author:<label>) — …` line per part from a layer the author made (below, *A layer the author made*), then one `cut: "<part>" opaque <n> = "<part>" <kept> + "<piece>" <taken> …` line per part an `assemble.cuts` entry cut (below; it ends `; under <n> px filled, <m> px left empty` when a cut of that part has `under`), then — with `config.limbs` (issue #349) — one `limb cut: "<part>" opaque <n> = "<segment part>" <px> + …` line per part a limb takes and one `limb cap:` line per joint, its cap's pixels from the cap image, from the layer and missing, and its box (under `cap_shape: "ball"`, issue #579, then the lower half's pixels written, left as painted and missing), followed on a short cap by one `LINT "<part>" cap at [x, y] … short_px left <n>, right <m>: no layer gives them …` line (issue #557) — from the upper segment where it gave a pixel (under `cap_shape: "disc"` always), under `edge: "feather"` the pixels faded, under `cut_band` the line the cut was placed on and the stroke pixels it and the joint line cross (issue #360) (§3, *Limbs: cut at their joints*), then one `fringe pushed back: "<part>" <px> px, where the painting shows "<holder>" <px> px, …` line per part whose fringe was cleared (below) | on the examples: `reference-sample` 0.83 / 98.0 % / 4,359 / 1,185, 259 holes, the largest 94 px; `reference-demo` 2.34 / 95.8 % / 10,340 / 1,564, 453 holes, the largest 70 px (default rule) — many slivers along part edges, no hole a region could hide | one large hole: part of the figure is in no layer — a plan entry is missing, hair left the head crop sideways (reference-demo's `hair_back` is taken from the full run for that reason), or See-through split one garment into two and left the space between them in neither (a skirt as two trouser legs); the `between` parts say where. When neither run holds it at all, an `assemble.patches` entry cuts it from the painting (below) |
|
|
3426
|
+
| `assemble` | one line per part — its counts (`op=` opaque, `vis=` visible, `src=` taken / candidates, `unproj=` visible but not projected, `drift=<n> (<p>% of core)`, `merged=`, `seam=`; *parts.json*, below). `drift=` is `refused_drift_px` in rig px and its share of the part's candidates, `projected_core_px`, which it is a subset of (issue #314); no bar reads either. On the four public examples the share runs to 94.5 % (`scarf` `hair_back`, 479 of 507) and the count to 26,472 (`scarf` `topwear`, 22.3 %), and the seam override repaints refused top-most pixels afterwards, so a large count says where See-through's colour was not taken, not that the part is unlike the painting: the `drift:` line below is the one that names a body of them another part holds. Then the `pixels:` totals (opaque = visible + occluded; taken; visible but not projected), then `recomposite vs source: mean \|d\|, within 8, error px > 40, uncovered error px`, then `uncovered holes (8-connected): N` and the largest five as `uncovered hole K: <px> px at x,y wxh (between "<part>" <px> px, …)`, then one `uncovered: <n> of the <N> uncovered error px lie on the full run's "<tag>", in a body of <px> px at x,y wxh; <the rule that left it out>` line per full-run layer the plan does not take from the full run whose uncovered error holds a body (5x5-opened, 8-connected, at least 150 full-run px in rig px), then one `drift: "<part>" refuses <n> px of <run>:<tag> (its colour more than 90 off the painting, max channel), in a body of <px> px at x,y wxh (…); by the plan's draw order "<holder>" holds <px> px of it (…)[, "<holder>" drawn in front of "<part>"][; the painting is within 90 of "<behind>" (<px> px at alpha >= 250, drawn behind "<part>")]; informational: no gate reads this. Swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do): swap, rebuild and read this line again; if it moves, removing it needs different input layers. At rest, the seam pass repaints the holder's pixels that pass its rule from the painting` line per part whose drift refusals hold a body (the same opening and bar) that another part holds in the draw order or that a part drawn behind it matches within 90 of the painting (issues #255, #351, #758) — that layer is not what the painting shows there; no gate reads this line, swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do) — swap, rebuild and read this line again, and if it moves, removing it needs different input layers — and at rest the seam pass repaints the holder's pixels that pass its rule from the painting (none on the five public paintings), then, per subset alternate set, one `LINT set "<set>" <part>: <layer part> holds <n> islands (8-connected, alpha above 8)[, and <s> speck(s) under 1 % of the largest (<f> px), each with the island nearest it], kept the one under <joints> (<k> px), dropped <m> (<d> px)` line per limb part cut from a layer of more than one island when the set names one limb side of it (issue #588; issue #608: a joint taken to the nearest island reads `<bone> [x, y] (<e> px off it, within its cap's radius <r>)`, and a part that lost no pixel `dropped none`), then one `LINT set "<set>" <part>: <layer part> holds <limb> and <other limb> in one island (8-connected, alpha above 8), split by the nearest segment line at the set's bones: kept <k> px (<share>), gave <m> px (<share>) to <other limb>; <b> px in the overlap band (nearer one line than the other by 0.5 px or less) went to the limb drawn in front, <bk> kept and <bg> given` line per limb part cut from a layer of one island that a limb the set does not carry also takes (issue #609; k, m and b count the part's pixels above alpha 8, each share of the part's pixels before the split, 3 places) and one `LINT set "<set>" <part>: <n> px under <base part> excluded` line per subset alternate set's limb part and base part drawn over it that the set does not replace which took a pixel (issue #587, `assemble.alternates` above; none on the public examples, which declare no alternate set); and look at `render/recomposite_error_rig.png`. The opt-in `assemble.yield_refused` adds `yielded N px` to each affected part's drift line (including a yielded refusal smaller than the body bar); with it off the line names `assemble.yield_refused: true` as the conditional config remedy before any cut. Between the part lines and the totals, one `author-made: part "<part>" (<run>:author:<label>) — …` line per part from a layer the author made (below, *A layer the author made*), then one `cut: "<part>" opaque <n> = "<part>" <kept> + "<piece>" <taken> …` line per part an `assemble.cuts` entry cut (below; it ends `; under <n> px filled, <m> px left empty` when a cut of that part has `under`), then — with `config.limbs` (issue #349) — one `limb cut: "<part>" opaque <n> = "<segment part>" <px> + …` line per part a limb takes and one `limb cap:` line per joint, its cap's pixels from the cap image, from the layer and missing, and its box (under `cap_shape: "ball"`, issue #579, then the lower half's pixels written, left as painted and missing), followed on a short cap by one `LINT "<part>" cap at [x, y] … short_px left <n>, right <m>: no layer gives them …` line (issue #557) — from the upper segment where it gave a pixel (under `cap_shape: "disc"` always), under `edge: "feather"` the pixels faded, under `cut_band` the line the cut was placed on and the stroke pixels it and the joint line cross (issue #360) (§3, *Limbs: cut at their joints*), then one `fringe pushed back: "<part>" <px> px, where the painting shows "<holder>" <px> px, …` line per part whose fringe was cleared (below) | on the examples: `reference-sample` 0.83 / 98.0 % / 4,359 / 1,185, 259 holes, the largest 94 px; `reference-demo` 2.34 / 95.8 % / 10,340 / 1,564, 453 holes, the largest 70 px (default rule) — many slivers along part edges, no hole a region could hide | one large hole: part of the figure is in no layer — a plan entry is missing, hair left the head crop sideways (reference-demo's `hair_back` is taken from the full run for that reason), or See-through split one garment into two and left the space between them in neither (a skirt as two trouser legs); the `between` parts say where. When neither run holds it at all, an `assemble.patches` entry cuts it from the painting (below) |
|
|
3413
3427
|
| `propose` | `note:` lines, `LINT` lines, the `coverage` lines, `landmarks.png`, `basis.json` | no LINT line: every chain link lies on its mesh's art, and the hip is below the chest and the figure's top quarter; the `coverage:` summary says how many bones that verdict covers — a `not checked` bone was read by no check (its line says why), and a `ratio` or `fallback` bone in `basis.json` is a guess | a link off the art (a bone on the background) — move it onto the layer; `LINT <link> at … runs to … N degrees off the head's down axis …` — a fringe link that does not lean with the head (§3, the fringe in the head's frame): move it along the lock it drives; `LINT <bone> under <parent>: amplitude <a> below the link above's <b> in the keyed chain …` — under `--cloth`, a keyed sibling the recipe left the only keyed child of its parent, which `CHAIN_LAG` would refuse (issue #572, §3 *A keyed sibling left behind*): raise the field it names to `<b>` or more in size; `LINT hairback_… on mesh '<part>' (side <r\|l>): <N> tree(s) for <M> visible hair mass(es) (mass 0 columns x=<minX>..<maxX>, y=<minY>..<maxY>; …)` — back-hair cloth trees whose count does not match the side's visible hair masses (`max(1, floor(w / (4 * grid)) + 1)` per mass) or whose link or tip leaves its mass's column range (issues #445, #461): omit `chains` on `cloth."back hair"` or draft trees per visible hair mass inside its columns; `LINT <a_limb> and <b_limb> on <part> (<from>) cross at [x, y] with no per-limb split: …` — two limbs sharing one layer cross in an X without a per-limb split (issue #446): declare `config.limbs.<covering>.split` (`{ "line": [[x, y], …] }` or `{ "edge": "painting" }`, §3 *Which limb*); `LINT foot_<s> at [x, y], the <s>_ankle joint and leg_<s>1's tip, lies on none of leg_<s>'s art within 1 px along its joint line (the nearest of it on that line is the pixel [x, y], D px from the joint): …` — an ankle keypoint off its leg's art on the line `assemble` sizes the ankle's cap by (issue #517): `propose` drafts every leg without its ankle cut, the shoe layer stays one part, and nothing is moved onto the art; move that ankle keypoint onto the leg's or the shoe's art and re-run `propose` (`(the line crosses none of it)` when no art lies on that line at all); `LINT stop on <chain> (<firstLink> at [x0, y0]) against <against> (at [ax, ay]) places <chain>_touch at [tx, ty], above <firstLink>'s root (rest R deg, \|rest\| + outward B deg): …` — a stop's contact point `<chain>_touch` lies above `links[0]`'s root in rig px or pushes `\|rest\| + outward` past `180°` (issue #447, §2 `stops`): stop against the descending limb bone below `firstLink`, set `links` to start at a link below `<chain>_touch`, or omit the stop on a rising limb; `LINT hip at [x, y] is not below chest at [x, y]: …` or `LINT hip at [x, y] is above 0.25 of the figure height (figure y T..B, so hip y must be at least L): a hip at the shoulders` — move `hip` down to the waist (and `chest` between it and the neck); a `hanging strand … -- no chain proposed` note — that strand hangs stiff until you add a chain down the x and rows it names (§3); a `no blink: …` or `blink without brows: …` note — the idle will not blink (or its brows will not drop), because no part came from an `eyewhite` (or `eyebrow`) layer; the note names the tags looked for; a `no eyewhite part for eye_<s> …` note — the iris and lash parts it names ride `head` and do not blink, because no `eyewhite-<s>` part made that side's eye bone: take the eyewhite from the other run, or keep them on `head`; a `no face part: face box derived from …` note (always the first) — `head`, `neck` and every face-height scale come from a box guessed off the hair and neck (§3): check `head` and `neck` on `landmarks_head.png` and move them; when it adds `the blink shuts the eyes over no face part`, read `BLINK_NO_HOLE` after `check` — an eye with no face under it can open a hole (the `reference-sample` with only its face removed: 587 px). Under `--keypoints`: the `lint rule set:` line first (joints, or screen and why), then the joint notes — `missing: the rule "…" placed bone X instead` is a bone still guessed; `not used — …` names why an arm's joints did not place its sleeve (for a wrist on no part, the nearest part and the `--wrist-snap` that would bind it); a `wrist snap: …` note is a wrist bound past 15 px by the flag — check that chain's tip on `landmarks.png`; a `one handwear part holds both wrists` note is two chains on one mesh — cut the part with `assemble.cuts` to separate them; `LINT chest at … is not between the neck joint …`, `LINT hip at … is not past chest …`, `LINT hip at … is nearer the neck joint …` and `LINT <chain><i> at … does not advance from <s>_shoulder toward <s>_wrist` are the joint-frame lines: move that bone between, past or along the joints they name |
|
|
3414
3428
|
| `compare` | one line per pair (origin, parent, tip, length, direction — or SKIP and why), then the per-row summary, the unmapped bones of each side, `required:`, each side's roles and the `controls:` line | proposal against the config you corrected: the rows you changed and no others. Config against the `rig.json` `build` writes for it: measured on both examples, every origin within 6.19e-7 px (the rig's offsets are written to 6 places) and every chain link's tip and length within 4.99e-4 px (`length` is written to 3), printed to three places as `0.000` (a signed figure as `+0.000` or `-0.000`); `parent … is the right's ancestor at depth 2, <bone>_ctl between` for every keyed mesh bone, no `DIFFERENT` and no `NOT MAPPED` | `parent DIFFERENT: left a, right b` — a bone hangs from another parent than the other side's; `frames not related` — a rig with no stage (`skeleton.width`/`height`), two configs at different `rig_scale`: the distance rows SKIP, so declare the frame in a `--map` file if the author knows it; `FAIL STRUCTURE_REQUIRED_PRESENT` — a bone the map requires is missing through its pairs |
|
|
3415
3429
|
| `rig` (inside `build`) | one line per mesh: vertices, triangles, bones, influences, `cover`; the `bones` line; the `idle keys` line; then rigc's gate lines (with A15's declared SKIP under `--idle-keys direct`); in `rig.json`, each chain link's (or its `_ctl`'s) `length` and `rotation` | `cover 1.00000` on every mesh, both gate summaries `0 failed` (the compile and the packed pages); every link's `length` the distance to the next link and `rotation` its direction (Spine degrees, counter-clockwise, y up, local to the parent), every offset under it — a child bone's `x, y`, a weight's bind `x, y`, a region's `x, y` — in that turned frame, and a region on a link carrying `rotation` that turns it back upright. Nothing moved: `flattenRig` (`src/rig.ts`) turns every offset back and gives the unturned numbers | `RIG_LATTICE_ONE_LOOP`: change that mesh's `grid` |
|
|
@@ -4157,7 +4171,7 @@ says why each requirement exists and what breaks without it.
|
|
|
4157
4171
|
| <a id="RIG_EXPLICIT_ALTERNATE"></a>`RIG_EXPLICIT_ALTERNATE` | an alternate set replaces a part bound to one accepted explicit payload | use a generated mesh for alternate artwork; no alternate is inferred from a base payload |
|
|
4158
4172
|
| <a id="RIG_INFLUENCE_REACH"></a>`RIG_INFLUENCE_REACH` | an influence mesh's `radius` is at or under the distance from its farthest lattice vertex to that vertex's nearest link (issue #378): a link pulls only when it is nearer than `radius`, so that vertex would be pulled by none. The vertex, where it is and the distance are named | a `radius` above the distance named, or a segment nearer that part of the art |
|
|
4159
4173
|
| <a id="RIG_INFLUENCE_LATTICE"></a>`RIG_INFLUENCE_LATTICE` | rig-c's segments lattice refused the part at the declared `cell` (no pixel of the part holds art, or the cell is not a whole number of at least 1); rig-c's message is quoted | a part with art, or a whole `cell` of at least 1 |
|
|
4160
|
-
| <a id="RIG_RIGC_GREEN"></a>`RIG_RIGC_GREEN` | rig-c refused the rig; its own FAIL or compile-error line is quoted, and nothing was written. A `constraints` field rigc does not read, or a value it refuses, is this line in rigc's words (`constraint "aim" (ik) has a key this compiler does not read: "mixx" (did you mean "mix"?)`), as is `A25_DETACHED_BONE_PARENTAGE` on a declared scene target. So is an ik whose `bones` are more than two, or two of which the second is not the first's child: from rig-c 2.15.0 its rig-spec parser refuses both by name (`ik constraint "reach" names 3 bones …`, `ik constraint "reach": "hem1" is not a child of "body" ("hem0" stands between) …`; firejune/rigc#1205), and this package no longer refuses them itself (issue #103; it did from #92 while rigc's gate passed them). Under `--idle-keys ctl` a two-bone ik over a chain link and its child link is that second refusal too, because the child's `<link>_ctl` stands between them; rigc's remedy names the control, which a config cannot, so when rigc's line says that control alone stands between, the rig stage adds a sentence naming `--idle-keys direct` on the command that ran | the field rigc's line names; for the split pair, `rig --idle-keys direct` or `build --idle-keys direct`, as the line says, which keys the link in place — rig-c's own AUTHORING §5 maps each of its assertions (`node_modules
|
|
4174
|
+
| <a id="RIG_RIGC_GREEN"></a>`RIG_RIGC_GREEN` | rig-c refused the rig; its own FAIL or compile-error line is quoted, and nothing was written. A `constraints` field rigc does not read, or a value it refuses, is this line in rigc's words (`constraint "aim" (ik) has a key this compiler does not read: "mixx" (did you mean "mix"?)`), as is `A25_DETACHED_BONE_PARENTAGE` on a declared scene target. So is an ik whose `bones` are more than two, or two of which the second is not the first's child: from rig-c 2.15.0 its rig-spec parser refuses both by name (`ik constraint "reach" names 3 bones …`, `ik constraint "reach": "hem1" is not a child of "body" ("hem0" stands between) …`; firejune/rigc#1205), and this package no longer refuses them itself (issue #103; it did from #92 while rigc's gate passed them). Under `--idle-keys ctl` a two-bone ik over a chain link and its child link is that second refusal too, because the child's `<link>_ctl` stands between them; rigc's remedy names the control, which a config cannot, so when rigc's line says that control alone stands between, the rig stage adds a sentence naming `--idle-keys direct` on the command that ran | the field rigc's line names; for the split pair, `rig --idle-keys direct` or `build --idle-keys direct`, as the line says, which keys the link in place — rig-c's own AUTHORING §5 maps each of its assertions (`node_modules/@rig-c/core/docs/AUTHORING.md`) |
|
|
4161
4175
|
|
|
4162
4176
|
### mesh-draft
|
|
4163
4177
|
|
|
@@ -4428,7 +4442,7 @@ documents do not ship). Each is an input this package built; none is an author's
|
|
|
4428
4442
|
| <a id="REQUIREMENTS_MAY_FOLD"></a>`REQUIREMENTS_MAY_FOLD` | a `may_fold` entry names a slot with no mesh attachment — a region is one quad and cannot fold (issue #320). Refused before anything is built. Before issue #333 an entry naming the idle was refused here too; the bar reads the idle now, and `idle` is an animation name like any other | a mesh slot |
|
|
4429
4443
|
| <a id="REQUIREMENTS_NOT_PLANTED"></a>`REQUIREMENTS_NOT_PLANTED` | a `not_planted` name is a part `check` does not read as a planted foot — it does not come from a See-through `footwear` layer — or there is no `parts.json` to choose the feet by (issue #231). Refused before anything is built | a `footwear` part's name |
|
|
4430
4444
|
| <a id="REQUIREMENTS_TIP_EXCEPTION"></a>`REQUIREMENTS_TIP_EXCEPTION` | a `not_swinging`, `rises` or `rests` name is a part `TIP_OVER_ROOT` does not read — not from a See-through `handwear` or `bottomwear` layer — or there is no `parts.json` (refused before anything is built); or a `rises` part is not carried by a chain that rises: the chain's **last link**, at the setup pose, runs other than up — from its origin along its `length` (the extent the rig stage turns a link to), or, a last link with no length, from the link before's origin to its own — the detail giving the link read and the direction measured (refused after the idle is rendered, before `check.json` is written) (issues #231, #322; until #322 it read the chain's first link's origin to its last's, which refused a folded arm — a link that hangs, then a forearm raised) | a swinging part's name; for `rises`, a part whose chain does rise |
|
|
4431
|
-
| <a id="CHECK_ENVIRONMENT"></a>`CHECK_ENVIRONMENT` | `check --environment` (or `build --environment`, forwarded): the schedule is refused, the detail rigc's own sentence verbatim. Read once by rig-c's reader (`readEnvironmentSchedule`,
|
|
4445
|
+
| <a id="CHECK_ENVIRONMENT"></a>`CHECK_ENVIRONMENT` | `check --environment` (or `build --environment`, forwarded): the schedule is refused, the detail rigc's own sentence verbatim. Read once by rig-c's reader (`readEnvironmentSchedule`, `@rig-c/core/src/environment.ts`) before anything is built — nothing at the path, a file that is not JSON or not an object, a `spec` other than `rigc-environment/1`, a key besides `spec`, `steps` or a step's `t`, `wind`, `gravity`, no step, a `t` not finite, below 0 or not after the step before, a `wind` or `gravity` not a pair of finite numbers (JSON's `1e999` reads as `Infinity` and is refused), a step stating neither — and `--out` is not written (`build` refuses under `[assemble]`, before it assembles). After the build, what `rigc render --environment` refuses of a well-formed schedule on this rig, quoted from its `--environment <path>:` line: no physics constraint, a half no constraint answers, two steps on one frame at 12 fps, a step after the last frame of the animation rendered. Also refused before anything is built: a `motion.json` with no animation, where no render `check` makes could pose the schedule | the schedule — rigc's sentence names the entry, the field, the value found and the value required; for a rig with no physics constraint, drop the flag: no world moves it |
|
|
4432
4446
|
| <a id="CHECK_WIND_BAND"></a>`CHECK_WIND_BAND` | `check --wind-band` (or `build --wind-band`, forwarded, issue #590): the sweep file is refused before anything is built, or cannot be measured against the rig. Refused before the build (`build` refuses under `[assemble]` before it assembles, and `--out` is not written): nothing at the path, a file that is not a JSON object, an unknown key (besides `note`, `*_note` and `x-…`), a missing or malformed field (`spec` must be `"rig-parts-wind-band/1"`; `min`, `max`, `step` finite numbers with `min < max`, `step > 0`, and `(max - min) / step` within `1e-6` of an integer at most `64`; `fps` a positive integer; `max_gap` and `max_ghost` non-negative integers; `pairs` a non-empty array of unique `"<a>:<b>"` strings with `a !== b`). Refused against the rig before `rigc build`: a slot in `pairs` not in `rig.json`'s `slots`, `motion.json` with no animation, a rig with no physics constraint, or a rig where no physics constraint has a non-zero `wind`. Refused after the first sweep render (before `check.json` is written, with `--out` cleaned): a pair in `pairs` whose drawings share no overlap band at the setup pose (`status: "skip"` or `banded === 0` in `seam.json`) | the `--wind-band` file or the rig — every field in `"rig-parts-wind-band/1"` is required (nothing falls back to `SEAM_OVER_MOTION`), each `"<a>:<b>"` pair must name two distinct slots whose art overlaps at rest, and the rig must declare at least one physics constraint that answers `wind` |
|
|
4433
4447
|
| <a id="REQUIREMENTS_SEAM"></a>`REQUIREMENTS_SEAM` | a `seam` cannot be read against the rig: there is no `parts.json` (a merged rig, §7 *Measuring a rig rig-parts did not assemble*), or the two parts' art does not meet at the setup pose (no 4-adjacent pair). Refused before anything is built | two parts whose art touches, on a rig with its `parts.json` |
|
|
4434
4448
|
|
|
@@ -4479,7 +4493,7 @@ Absent declaration retains existing output bytes except optional new evidence on
|
|
|
4479
4493
|
|
|
4480
4494
|
**Body-root seam identity** (issue #686). A limb must have exactly one segment0 part. Its declared bone must have one named immediate parent; the root slot must bind that bone (or its declared turn child). Non-limb parts with `topwear` or `bottomwear` source provenance, a slot on that parent (directly or through its verified generated turn child) and a named default-skin drawing are candidates. The body-side child must match `applyTurn`'s exact generated name, unique identity bone and parent, control and per-part transform binding; a similarly named bone alone is not proof (issue #708). The original carrier and pair slot names do not change under turn; stock setup pose `render --seam` selects all matching drawings with `banded > 0` (its existing alpha-overlap band, without dilation), so one selects one pair and two select both pairs. When eligible candidates all return valid setup banded 0, that limb has no selected root pair: `unmeasuredRoots` retains its limb, bone, parent, segment0 part, candidates and named reason, reported as SKIP, not measured PASS. Part spelling, nearest geometry and shared mesh influences select nothing. On `wind` the pairs are `topwear|upperarm_r`, `topwear|upperarm_l`, `bottomwear|thigh_r` and `bottomwear|thigh_l`; “trunk” is not a part name. Existing pairs keep their order; a reversed explicit declaration deduplicates with the root pair and retains both declarations. An ambiguous/missing named binding, no eligible candidate, or unreadable/undrawn setup data is `CHECK_MOTION_SEAM_ROOT`, naming the part and candidates. Valid zero-band metadata is carried separately as optional `roots.unmeasured`, never as a fabricated measured pair. The all-zero root block remains present and its bar is skipped; measured FAIL takes precedence over SKIP, while measured PASS plus any unmeasured root stays SKIP. No body provenance leaves legacy pair selection unchanged and supplies no body-root coverage.
|
|
4481
4495
|
|
|
4482
|
-
Renderer metadata and exact raster reads use the promised
|
|
4496
|
+
Renderer metadata and exact raster reads use the promised `@rig-c/core/render-shared` entry (rig-c >=2.69.0 <3.0.0). It registers no Spine runtime; where that runtime resolves from rig-c's own package root, the existing `@rig-c/core/render` entry registers the official Spine side explicitly. An install without Spine keeps rig-c's own candidate chooser and gate; candidate or loader failures never select a guessed fallback.
|
|
4483
4497
|
|
|
4484
4498
|
The body-root bar counts stock partitions `gapOpen` plus `ghostA` or `ghostB` owned by the pair's UNDER-owned drawing in resolved draw order on each active frame, comparing their summed cells against the unchanged strict floor `px > round(max(box width, box height) / cell)` on the original raw kind boxes (their union when both kinds contribute), never the narrowed partition boxes; `gapCovered` and OVER-owned ghost cells do not count (issue #711). The metric mode is `gap-open+under-ghost`; rows retain the exact partition counts, UNDER owner and counted total in `cells`, including excluded and under-floor readings. Missing partitions, inconsistent sums or unavailable ownership are named `FRAMES_SIDECAR` refusals, never inferred zero. An active rendered environment fails `CHECK_SEAM_OVER_MOTION` above that floor, setting overall PASS false and exits 1. Existing internal-joint and explicit-only pairs remain warnings: their PASS, exit status and bar count are unchanged; reference worlds remain informational. The root bar is counted once, and absence is not a zero or a PASS. No whole-box alpha exemption or consumer compositor is used. This gate samples the supplied animations at 12 fps, not another motion or player scene.
|
|
4485
4499
|
|
package/docs/MIGRATION.md
CHANGED
|
@@ -52,6 +52,15 @@ The upstream package was renamed on npm at 2.20.4 with the same `exports` map
|
|
|
52
52
|
installed the former upstream name beside this package installs nothing more:
|
|
53
53
|
`rig-c` comes as a dependency. No Spine runtime is a dependency, as in 0.16.0.
|
|
54
54
|
|
|
55
|
+
### Scoped core dependency
|
|
56
|
+
|
|
57
|
+
The current dependency is `@rig-c/core` at `^2.72.0`, replacing the literal
|
|
58
|
+
`rig-c` dependency described for earlier versions above. The alias remains
|
|
59
|
+
published. Imports retain their subpaths: `rig-c/mesh` becomes
|
|
60
|
+
`@rig-c/core/mesh`, and `rig-c/core` becomes `@rig-c/core/core`. The command
|
|
61
|
+
remains `rigc`. Installing the canonical core beside this package no longer
|
|
62
|
+
adds the legacy package as a second compiler and command owner.
|
|
63
|
+
|
|
55
64
|
### The config
|
|
56
65
|
|
|
57
66
|
**A config that built on 0.16.0 loads unchanged.** The loader's only change between
|
package/docs/STABILITY.md
CHANGED
|
@@ -126,7 +126,7 @@ part name, `[i]` an entry of a list):
|
|
|
126
126
|
- **generation.control.skeleton**, the pose file it names when it is no built-in — required: `width`, `height`, `points`
|
|
127
127
|
- **seethrough** — required: `resolution`, `steps`, `seed`, `offload`; optional: `head_box`, `arm_split`
|
|
128
128
|
- **seethrough.arm_split** — required: `order`, and one of `x` or `line` (issue #439)
|
|
129
|
-
- **assemble** — required: `rig_scale`, `plan` (from plain `assemble` on); optional: `extend_below_crop`, `patches`, `cuts`, `alternates`, `head_face_underfill`
|
|
129
|
+
- **assemble** — required: `rig_scale`, `plan` (from plain `assemble` on); optional: `extend_below_crop`, `patches`, `cuts`, `alternates`, `head_face_underfill`, `yield_refused`
|
|
130
130
|
- **assemble.alternates[i]** — required: `name`; optional: `source`, `full`, `head`, `parts`, `hides`, `head_box`, `cuts`, `skeleton`, `anchor`, `base_anchor`, `drawn`, `tips`, `front`, `layers`, `focus` (issues #454, #465, #543, #652, #664, #666, #719, #780). `focus` is an authored finite `[x, y]` in painting pixels, within its canvas (edges included), refused as CONFIG_SET_FOCUS before assemble output when invalid; only when present, `parts.json` records it with focus_source_size and `sets.json` emits it in setup-world coordinates through the actual rig resize and `src/coords.ts`. Absent focus emits no field or inferred value; changing/removing it requires reassembly
|
|
131
131
|
- **assemble.extend_below_crop[i]** — required: `part`, `run`, `tag`
|
|
132
132
|
- **assemble.patches[i]** — required: `name`, `box`, `alpha`, `draw`
|
|
@@ -241,7 +241,7 @@ keeps complete canonical raw pair data (boxes/cut metadata included), omitting
|
|
|
241
241
|
`picture` unless its image exists. Semantic signatures preserve original source
|
|
242
242
|
attachment UVs/topology/weights, own image content and world vertices/colour,
|
|
243
243
|
not atlas pages/UVs or global piece ordinals. Unknown/no-art support stays conservative.
|
|
244
|
-
Renderer metadata and exact raster reads use the promised
|
|
244
|
+
Renderer metadata and exact raster reads use the promised `@rig-c/core/render-shared` entry (rig-c >=2.69.0 <3.0.0). It registers no Spine runtime; where that runtime resolves from rig-c's own package root, the existing `@rig-c/core/render` entry registers the official Spine side explicitly. An install without Spine keeps rig-c's own candidate chooser and gate; candidate or loader failures never select a guessed fallback.
|
|
245
245
|
|
|
246
246
|
An unavailable, nonfinite, unrepresentable or oversized union, or nonempty official pinned.outside, refuses `CHECK_SEAM_DOMAIN`. Geometry margins outside the authored canvas are included in U, not treated as opaque-clip evidence. State-by-state geometry reads retain bounds/identities rather than all decoded pages or poses. `--keep-stills` keeps
|
|
247
247
|
canonical frames in `setup_still/` and fitted diagnostics in `setup_still_auto/`.
|
|
@@ -300,20 +300,20 @@ in the package.
|
|
|
300
300
|
|
|
301
301
|
## rig-c
|
|
302
302
|
|
|
303
|
-
`dependencies` takes
|
|
303
|
+
`dependencies` takes `@rig-c/core` `^2.72.0`: 2.72.0 or any later 2.x. Bun 1.4 or later
|
|
304
304
|
is the declared floor (`engines.bun` `>=1.4.0`; older 1.4 releases are not tested in
|
|
305
305
|
CI, which runs `latest`, and compatibility with an older 1.4 release is handled when
|
|
306
306
|
reported as an issue). What this package relies on in rig-c, every import
|
|
307
307
|
read off `src/` and `cli.ts`:
|
|
308
308
|
|
|
309
|
-
- the named entries
|
|
309
|
+
- the named entries `@rig-c/core/mesh` (the outline functions, `measureAuthoredMeshFit`,
|
|
310
310
|
`reduceMesh`, `skinningEnvelopeBone`, `writeMeshQualityReport` and their types)
|
|
311
|
-
and
|
|
312
|
-
- the deep paths its `exports` map carries:
|
|
313
|
-
`RIG_SPEC_VERSION`, the constraint keys),
|
|
314
|
-
|
|
315
|
-
`src/coords.ts` only),
|
|
316
|
-
|
|
311
|
+
and `@rig-c/core/meshcompare` (`compareMeshesInMotion`);
|
|
312
|
+
- the deep paths its `exports` map carries: `@rig-c/core/src/rig.ts` (`parseRigSpec`,
|
|
313
|
+
`RIG_SPEC_VERSION`, the constraint keys), `@rig-c/core/src/errors.ts`,
|
|
314
|
+
`@rig-c/core/src/png.ts`, `@rig-c/core/src/transform.ts` (the y flip, through
|
|
315
|
+
`src/coords.ts` only), `@rig-c/core/tools/plate.ts` (the PNG codec) and
|
|
316
|
+
`@rig-c/core/tools/font5x7.ts`;
|
|
317
317
|
- the `rigc` command: `build` and `render`, and `--version`, whose `entry:` line
|
|
318
318
|
says which validator gated a build (`check.json`'s `rigc_entry`).
|
|
319
319
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-parts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.75.0",
|
|
4
4
|
"description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"ag-psd": "^31.0.2",
|
|
67
|
-
"rig-c": "^2.72.0"
|
|
67
|
+
"@rig-c/core": "^2.72.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@esotericsoftware/spine-core": "4.3.13",
|
|
@@ -218,4 +218,4 @@ leaves to you:
|
|
|
218
218
|
|
|
219
219
|
A `RIG_RIGC_GREEN` or `CHECK_RIGC_GREEN`
|
|
220
220
|
line quotes rig-c's own assertion; rig-c's guide for those is
|
|
221
|
-
`node_modules
|
|
221
|
+
`node_modules/@rig-c/core/docs/AUTHORING.md`, and its `rigc` skill covers the compiler.
|
package/src/apng.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* bitstream encoder, and none ships here.
|
|
35
35
|
*/
|
|
36
36
|
import { deflateSync } from 'node:zlib';
|
|
37
|
-
import { PNG_SIGNATURE, pngChunk } from 'rig-c/tools/plate.ts';
|
|
37
|
+
import { PNG_SIGNATURE, pngChunk } from '@rig-c/core/tools/plate.ts';
|
|
38
38
|
import { histogram, mapToPalette, medianCut, type PaletteError, paletteError, type Rgba } from './palette.ts';
|
|
39
39
|
import type { Raster } from './raster/types.ts';
|
|
40
40
|
|
package/src/assemble.ts
CHANGED
|
@@ -240,6 +240,8 @@ export interface Geometry {
|
|
|
240
240
|
keySkeleton?: ControlSkeleton;
|
|
241
241
|
/** `assemble.head_face_underfill` (issue #492): composite `full:face` under `head:face` on the head canvas to fill transparent bare-skin holes. */
|
|
242
242
|
headFaceUnderfill?: boolean;
|
|
243
|
+
/** `assemble.yield_refused`, default false; alpha-only ownership transfer from original refused core pixels. */
|
|
244
|
+
yieldRefused?: boolean;
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
/**
|
|
@@ -357,6 +359,8 @@ export interface AssembleInput {
|
|
|
357
359
|
keySkeleton?: ControlSkeleton;
|
|
358
360
|
/** `assemble.head_face_underfill` (issue #492): composite `full:face` under `head:face` on the head canvas to fill transparent bare-skin holes. */
|
|
359
361
|
headFaceUnderfill?: boolean;
|
|
362
|
+
/** `assemble.yield_refused`, default false; alpha-only ownership transfer from original refused core pixels. */
|
|
363
|
+
yieldRefused?: boolean;
|
|
360
364
|
/**
|
|
361
365
|
* Issue #587: rig pixels taken out of named parts once the cuts and the limbs are made, before the fringe pass and
|
|
362
366
|
* every figure a part's record holds — each entry clears `part`'s pixels (alpha, colour and region) where `mask` is
|
|
@@ -4344,6 +4348,21 @@ function cutLimbs(
|
|
|
4344
4348
|
// the stage
|
|
4345
4349
|
// ---------------------------------------------------------------------------
|
|
4346
4350
|
|
|
4351
|
+
/** Opt-in ownership accounting, separate from source projection and authored provenance. */
|
|
4352
|
+
export interface DriftYieldReading {
|
|
4353
|
+
part: string;
|
|
4354
|
+
from: string;
|
|
4355
|
+
refusedCandidates: number;
|
|
4356
|
+
yielded: number;
|
|
4357
|
+
/** Yielded refusals also accepted by projection closing; removed from the written projected count. */
|
|
4358
|
+
yieldedTaken: number;
|
|
4359
|
+
skipped: { merge: number; ring: number; notOpaque: number; noMatchingBehind: number };
|
|
4360
|
+
/** Informational only: no fixed global-holder eligibility guard is used. */
|
|
4361
|
+
originalGlobalHolderWouldSkip: number;
|
|
4362
|
+
originalHolders: Array<{ part: string | null; px: number }>;
|
|
4363
|
+
finalHolders: Array<{ part: string | null; px: number }>;
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4347
4366
|
export interface AssembleResult {
|
|
4348
4367
|
parts: PartsFile;
|
|
4349
4368
|
/** In plan order, each cropped to its record's box. */
|
|
@@ -4364,6 +4383,8 @@ export interface AssembleResult {
|
|
|
4364
4383
|
holeKinds: HoleKinds;
|
|
4365
4384
|
/** The parts whose `DRIFT_LIMIT` refusals hold a body another part holds in the draw order (`driftBodies`), in draw order; empty otherwise. */
|
|
4366
4385
|
drift: DriftBodies[];
|
|
4386
|
+
/** Present only under the opt-in; includes skipped original-source populations and actual holders. */
|
|
4387
|
+
yieldReadings?: DriftYieldReading[];
|
|
4367
4388
|
/** Every hidden-art layer of the runs read (issue #359) and what read it (`hiddenLines`); empty when the runs hold none. */
|
|
4368
4389
|
hidden: HiddenArtUse[];
|
|
4369
4390
|
seamRule: SeamRule;
|
|
@@ -5045,13 +5066,14 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5045
5066
|
const keepInOrder = order.map((d) => ('limb' in d ? limbKeep[d.limb] : null));
|
|
5046
5067
|
const pushedBy = pushBackFringe(stack, srcr, seamRule, seamRule === 'silhouette' ? silhouette : null, featheredInOrder, keepInOrder, input.turnMovingPair ?? null);
|
|
5047
5068
|
// Issue #255: a part's drift refusals in a body, and who holds the body in the draw order (the push-back clears
|
|
5048
|
-
// only fringe below CORE_ALPHA
|
|
5069
|
+
// only fringe below CORE_ALPHA; these are the holders before the opt-in yield, and the seam override only recolours).
|
|
5049
5070
|
const holderAt = new Int32Array(W * H).fill(-1);
|
|
5050
5071
|
stack.forEach(({ image }, i) => {
|
|
5051
5072
|
for (let p = 0; p < W * H; p++) if (image.data[p * 4 + 3] >= CORE_ALPHA) holderAt[p] = i;
|
|
5052
5073
|
});
|
|
5053
5074
|
const stackNames = stack.map((q) => q.record.name);
|
|
5054
5075
|
const drift: DriftBodies[] = [];
|
|
5076
|
+
const yields = new Map<string, { mask: Mask; reading: DriftYieldReading }>();
|
|
5055
5077
|
order.forEach((d, orderIdx) => {
|
|
5056
5078
|
if ('patch' in d) return;
|
|
5057
5079
|
const { name, b } = pieceAt(d);
|
|
@@ -5063,6 +5085,9 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5063
5085
|
const under = stack[j].image.data;
|
|
5064
5086
|
for (let p = 0; p < W * H; p++) {
|
|
5065
5087
|
if (under[p * 4 + 3] < CORE_ALPHA) continue;
|
|
5088
|
+
// The opt-in resolves the actual exposed opaque holder before comparing its colour.
|
|
5089
|
+
// Keep the legacy matching-holder diagnostic unchanged when the setting is off.
|
|
5090
|
+
if (input.yieldRefused === true) { behindAt[p] = j; continue; }
|
|
5066
5091
|
const dMax = Math.max(
|
|
5067
5092
|
Math.abs(under[p * 4] - srcr.data[p * 4]),
|
|
5068
5093
|
Math.abs(under[p * 4 + 1] - srcr.data[p * 4 + 1]),
|
|
@@ -5071,9 +5096,59 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5071
5096
|
if (dMax <= DRIFT_LIMIT) behindAt[p] = j;
|
|
5072
5097
|
}
|
|
5073
5098
|
}
|
|
5074
|
-
|
|
5099
|
+
if (input.yieldRefused === true) {
|
|
5100
|
+
for (let p = 0; p < W * H; p++) {
|
|
5101
|
+
if (behindAt[p] < 0) continue;
|
|
5102
|
+
const under = stack[behindAt[p]].image.data;
|
|
5103
|
+
const dMax = Math.max(
|
|
5104
|
+
Math.abs(under[p * 4] - srcr.data[p * 4]),
|
|
5105
|
+
Math.abs(under[p * 4 + 1] - srcr.data[p * 4 + 1]),
|
|
5106
|
+
Math.abs(under[p * 4 + 2] - srcr.data[p * 4 + 2]),
|
|
5107
|
+
);
|
|
5108
|
+
if (dMax > DRIFT_LIMIT) behindAt[p] = -1;
|
|
5109
|
+
}
|
|
5110
|
+
}
|
|
5111
|
+
// The refusal belongs to b.key. A copied/ring replacement cannot inherit that source's refusal.
|
|
5112
|
+
// "Front" is relative to behindAt, not the fixed global top holder: another run may cover this source.
|
|
5113
|
+
let yielded = 0;
|
|
5114
|
+
if (input.yieldRefused === true) {
|
|
5115
|
+
const mask = newMask(W, H);
|
|
5116
|
+
const reading: DriftYieldReading = { part: name, from: b.key, refusedCandidates: 0, yielded: 0, yieldedTaken: 0, skipped: { merge: 0, ring: 0, notOpaque: 0, noMatchingBehind: 0 }, originalGlobalHolderWouldSkip: 0, originalHolders: [], finalHolders: [] };
|
|
5117
|
+
const holders = new Map<string | null, number>();
|
|
5118
|
+
for (let p = 0; p < W * H; p++) {
|
|
5119
|
+
if (refused.data[p] !== 1) continue;
|
|
5120
|
+
reading.refusedCandidates++;
|
|
5121
|
+
if (b.trace.from[p] >= 0) { reading.skipped.merge++; continue; }
|
|
5122
|
+
if (b.trace.ring.data[p] !== 0) { reading.skipped.ring++; continue; }
|
|
5123
|
+
if (b.r.data[p * 4 + 3] < CORE_ALPHA) { reading.skipped.notOpaque++; continue; }
|
|
5124
|
+
if (behindAt[p] < 0) { reading.skipped.noMatchingBehind++; continue; }
|
|
5125
|
+
if (holderAt[p] !== orderIdx) reading.originalGlobalHolderWouldSkip++;
|
|
5126
|
+
const holder = holderAt[p] < 0 ? null : stackNames[holderAt[p]];
|
|
5127
|
+
holders.set(holder, (holders.get(holder) ?? 0) + 1);
|
|
5128
|
+
mask.data[p] = 1;
|
|
5129
|
+
if (b.st.takenMask.data[p] === 1) reading.yieldedTaken++;
|
|
5130
|
+
b.r.data[p * 4 + 3] = 0;
|
|
5131
|
+
yielded++;
|
|
5132
|
+
}
|
|
5133
|
+
reading.yielded = yielded;
|
|
5134
|
+
reading.originalHolders = [...holders].map(([part, px]) => ({ part, px }));
|
|
5135
|
+
yields.set(name, { mask, reading });
|
|
5136
|
+
}
|
|
5137
|
+
const found = driftBodies(name, b.key, refused, bodyMinPx(frame), holderAt, stackNames, behindAt, input.yieldRefused === true ? yielded : undefined);
|
|
5075
5138
|
if (found !== null) drift.push(found);
|
|
5076
5139
|
});
|
|
5140
|
+
if (input.yieldRefused === true) {
|
|
5141
|
+
const finalAt = new Int32Array(W * H).fill(-1);
|
|
5142
|
+
stack.forEach(({ image }, i) => { for (let p = 0; p < W * H; p++) if (image.data[p * 4 + 3] >= CORE_ALPHA) finalAt[p] = i; });
|
|
5143
|
+
for (const { mask, reading } of yields.values()) {
|
|
5144
|
+
const holders = new Map<string | null, number>();
|
|
5145
|
+
for (let p = 0; p < W * H; p++) if (mask.data[p] === 1) {
|
|
5146
|
+
const part = finalAt[p] < 0 ? null : stackNames[finalAt[p]];
|
|
5147
|
+
holders.set(part, (holders.get(part) ?? 0) + 1);
|
|
5148
|
+
}
|
|
5149
|
+
reading.finalHolders = [...holders].map(([part, px]) => ({ part, px }));
|
|
5150
|
+
}
|
|
5151
|
+
}
|
|
5077
5152
|
const pushedOf: FringePushed[][] = plan.map(() => []);
|
|
5078
5153
|
const pushedOfCut: FringePushed[][] = cuts.map(() => []);
|
|
5079
5154
|
const pushedOfLimb: FringePushed[][] = lim.parts.map(() => []);
|
|
@@ -5109,7 +5184,7 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5109
5184
|
const own = e < 0 ? st : (stats.get(extendKeys[e]) as ProjectionStats);
|
|
5110
5185
|
// A pixel outside the piece's region is a base pixel filled from a cut's under image (issue #193): occluded, never visible.
|
|
5111
5186
|
if (r.data[p * 4 + 3] > OPAQUE_ALPHA_ABOVE && own.clear.data[p] === 1 && (region === null || region.data[p] === 1)) visible.data[p] = 1;
|
|
5112
|
-
if (trace.ring.data[p] === 0 && own.takenMask.data[p] === 1 && (region === null || region.data[p] === 1)) projected.data[p] = 1;
|
|
5187
|
+
if (yields.get(name)?.mask.data[p] !== 1 && trace.ring.data[p] === 0 && own.takenMask.data[p] === 1 && (region === null || region.data[p] === 1)) projected.data[p] = 1;
|
|
5113
5188
|
}
|
|
5114
5189
|
const { x0, y0, x1, y1, opaque } = measureBox(r);
|
|
5115
5190
|
if (opaque === 0) {
|
|
@@ -5134,7 +5209,7 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5134
5209
|
visible_px: vc.visible_px,
|
|
5135
5210
|
occluded_px: vc.occluded_px,
|
|
5136
5211
|
projected_core_px: region === null ? st.core : count(st.coreMask, region),
|
|
5137
|
-
source_px_taken: region === null ? st.taken : count(st.takenMask, region),
|
|
5212
|
+
source_px_taken: (region === null ? st.taken : count(st.takenMask, region)) - (yields.get(name)?.reading.yieldedTaken ?? 0),
|
|
5138
5213
|
visible_not_projected_px: vc.visible_not_projected_px,
|
|
5139
5214
|
refused_drift_px: region === null ? st.refused : count(st.refusedMask, region),
|
|
5140
5215
|
merged_px: merged,
|
|
@@ -5213,6 +5288,7 @@ export function assemble(input: AssembleInput): AssembleResult {
|
|
|
5213
5288
|
uncovered,
|
|
5214
5289
|
holeKinds: kinds,
|
|
5215
5290
|
drift,
|
|
5291
|
+
...(input.yieldRefused === true ? { yieldReadings: [...yields.values()].map(q => q.reading) } : {}),
|
|
5216
5292
|
hidden: [...hiddenUses].map(([layer, readBy]) => ({ layer, readBy })),
|
|
5217
5293
|
seamRule,
|
|
5218
5294
|
projectRule,
|
|
@@ -5235,6 +5311,8 @@ export interface DriftBodies {
|
|
|
5235
5311
|
from: string;
|
|
5236
5312
|
/** The part's `refused_drift_px`, in a body or not. */
|
|
5237
5313
|
refusedPx: number;
|
|
5314
|
+
/** Original refused front pixels cleared under the opt-in; absent when it is off. */
|
|
5315
|
+
yieldedPx?: number;
|
|
5238
5316
|
/** The bar the bodies were held to (`bodyMinPx`, the uncovered line's). */
|
|
5239
5317
|
minPx: number;
|
|
5240
5318
|
/** The bodies, largest first (`bodiesOf`). */
|
|
@@ -5269,15 +5347,15 @@ export interface DriftBodies {
|
|
|
5269
5347
|
* holder. `behindAt` (optional) is, per rig pixel, the index into `names` of
|
|
5270
5348
|
* the top-most part drawn behind `part` at alpha >= `CORE_ALPHA` whose colour
|
|
5271
5349
|
* is within `DRIFT_LIMIT` of the painting (-1: none). The result is non-null
|
|
5272
|
-
* exactly when the bodies hold a pixel whose holder is another part or whose
|
|
5350
|
+
* also retained for a nonzero opt-in `yieldedPx`, including refusals smaller than the body bar; otherwise exactly when the bodies hold a pixel whose holder is another part or whose
|
|
5273
5351
|
* `behindAt` names a part drawn behind `part` that matches the painting.
|
|
5274
5352
|
*/
|
|
5275
|
-
export function driftBodies(part: string, from: string, refused: Mask, minPx: number, holderAt: Int32Array, names: readonly string[], behindAt?: Int32Array): DriftBodies | null {
|
|
5353
|
+
export function driftBodies(part: string, from: string, refused: Mask, minPx: number, holderAt: Int32Array, names: readonly string[], behindAt?: Int32Array, yieldedPx?: number): DriftBodies | null {
|
|
5276
5354
|
let refusedPx = 0;
|
|
5277
5355
|
for (let p = 0; p < refused.data.length; p++) refusedPx += refused.data[p];
|
|
5278
5356
|
if (refusedPx === 0) return null;
|
|
5279
5357
|
const { bodies, pixels } = bodiesWithPixels(refused, minPx);
|
|
5280
|
-
if (bodies.length === 0) return null;
|
|
5358
|
+
if (bodies.length === 0 && (yieldedPx ?? 0) === 0) return null;
|
|
5281
5359
|
const count = new Map<string, number>();
|
|
5282
5360
|
const behindCount = new Map<string, number>();
|
|
5283
5361
|
for (let p = 0; p < pixels.data.length; p++) {
|
|
@@ -5292,10 +5370,10 @@ export function driftBodies(part: string, from: string, refused: Mask, minPx: nu
|
|
|
5292
5370
|
}
|
|
5293
5371
|
}
|
|
5294
5372
|
const hasFront = [...count.keys()].some((n) => n !== part);
|
|
5295
|
-
if (!hasFront && behindCount.size === 0) return null;
|
|
5373
|
+
if (!hasFront && behindCount.size === 0 && (yieldedPx ?? 0) === 0) return null;
|
|
5296
5374
|
const holders = [...count.entries()].map(([q, px]) => ({ part: q, px })).sort((a, b) => b.px - a.px || (a.part < b.part ? -1 : a.part > b.part ? 1 : 0));
|
|
5297
5375
|
const behind = [...behindCount.entries()].map(([q, px]) => ({ part: q, px })).sort((a, b) => b.px - a.px || (a.part < b.part ? -1 : a.part > b.part ? 1 : 0));
|
|
5298
|
-
return { part, from, refusedPx, minPx, bodies, holders, ...(behind.length > 0 ? { behind } : {}) };
|
|
5376
|
+
return { part, from, refusedPx, minPx, bodies, holders, ...(behind.length > 0 ? { behind } : {}), ...(yieldedPx === undefined ? {} : { yieldedPx }) };
|
|
5299
5377
|
}
|
|
5300
5378
|
|
|
5301
5379
|
/**
|
|
@@ -5317,7 +5395,7 @@ export function driftBodies(part: string, from: string, refused: Mask, minPx: nu
|
|
|
5317
5395
|
export function driftLine(d: DriftBodies): string {
|
|
5318
5396
|
const total = d.bodies.reduce((a, b) => a + b.px, 0);
|
|
5319
5397
|
const big = d.bodies[0];
|
|
5320
|
-
const held = d.bodies.length > 1 ? `${d.bodies.length} bodies of ${total} px, the largest ${big.px} px at ${bodyBox(big)}` : `a body of ${big.px} px at ${bodyBox(big)}`;
|
|
5398
|
+
const held = d.bodies.length === 0 ? 'no body at this bar' : d.bodies.length > 1 ? `${d.bodies.length} bodies of ${total} px, the largest ${big.px} px at ${bodyBox(big)}` : `a body of ${big.px} px at ${bodyBox(big)}`;
|
|
5321
5399
|
const others = d.holders.filter((h) => h.part !== d.part).map((h) => `"${h.part}"`);
|
|
5322
5400
|
const frontClause = others.length > 0 ? `, ${others.join(', ')} drawn in front of "${d.part}"` : '';
|
|
5323
5401
|
const behindClause =
|
|
@@ -5327,7 +5405,10 @@ export function driftLine(d: DriftBodies): string {
|
|
|
5327
5405
|
return (
|
|
5328
5406
|
`drift: "${d.part}" refuses ${d.refusedPx} px of ${d.from} (its colour more than ${DRIFT_LIMIT} off the painting, max channel), in ${held} (at least ${fmtPx(d.minPx)} px past a ${BODY_KERNEL}x${BODY_KERNEL} opening); ` +
|
|
5329
5407
|
`by the plan's draw order ${d.holders.map((h) => `"${h.part}" holds ${h.px} px`).join(', ')} of it (the top-most part at alpha >= ${CORE_ALPHA})${frontClause}${behindClause}; ` +
|
|
5330
|
-
"informational: no gate reads this. Swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do): swap, rebuild and read this line again; if it moves, removing it needs different input layers. At rest, the seam pass repaints the holder's pixels that pass its rule from the painting"
|
|
5408
|
+
"informational: no gate reads this. Swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do): swap, rebuild and read this line again; if it moves, removing it needs different input layers. At rest, the seam pass repaints the holder's pixels that pass its rule from the painting" +
|
|
5409
|
+
(d.yieldedPx === undefined
|
|
5410
|
+
? '; set assemble.yield_refused: true to yield original refused front pixels only where the top-most opaque behind holder matches the painting, before considering a cut'
|
|
5411
|
+
: `; yielded ${d.yieldedPx} px to top-most opaque behind holders matching the painting (assemble.yield_refused: true; alpha only)`)
|
|
5331
5412
|
);
|
|
5332
5413
|
}
|
|
5333
5414
|
|
|
@@ -5992,6 +6073,8 @@ export function stageFields(
|
|
|
5992
6073
|
armSplit?: ArmSplit;
|
|
5993
6074
|
keySkeleton?: ControlSkeleton;
|
|
5994
6075
|
headFaceUnderfill?: boolean;
|
|
6076
|
+
/** `assemble.yield_refused`, default false; alpha-only ownership transfer from original refused core pixels. */
|
|
6077
|
+
yieldRefused?: boolean;
|
|
5995
6078
|
turnMovingPair?: (a: string, b: string) => boolean;
|
|
5996
6079
|
} {
|
|
5997
6080
|
const problems: Problem[] = [];
|
|
@@ -6012,6 +6095,7 @@ export function stageFields(
|
|
|
6012
6095
|
...(st.arm_split === undefined ? {} : { armSplit: st.arm_split }),
|
|
6013
6096
|
...(keySkeleton === undefined ? {} : { keySkeleton }),
|
|
6014
6097
|
...(cfg.assemble.head_face_underfill === undefined ? {} : { headFaceUnderfill: cfg.assemble.head_face_underfill }),
|
|
6098
|
+
...(cfg.assemble.yield_refused === undefined ? {} : { yieldRefused: cfg.assemble.yield_refused }),
|
|
6015
6099
|
...(turnMovingPair === null ? {} : { turnMovingPair }),
|
|
6016
6100
|
rigScale: cfg.assemble.rig_scale,
|
|
6017
6101
|
plan: cfg.assemble.plan,
|
package/src/autoamplitude.ts
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
*
|
|
69
69
|
* Pure: no clock, no randomness, nothing read or written.
|
|
70
70
|
*/
|
|
71
|
-
import type { MeshReductionInput, MotionAmplitude, TrackAmplitude } from 'rig-c/mesh';
|
|
71
|
+
import type { MeshReductionInput, MotionAmplitude, TrackAmplitude } from '@rig-c/core/mesh';
|
|
72
72
|
import type { MotionKey, MotionSpec } from './motion.ts';
|
|
73
73
|
|
|
74
74
|
/**
|
package/src/autoenvelope.ts
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
*
|
|
83
83
|
* Pure: no clock, no randomness, nothing read or written.
|
|
84
84
|
*/
|
|
85
|
-
import { type BoneMotionRange, type EnvelopeBoneRanges, MeshReductionError, type MeshQualityReport, type MeshReductionInput, type SkinningEnvelope, type SkinningEnvelopeBone, skinningEnvelopeBone } from 'rig-c/mesh';
|
|
85
|
+
import { type BoneMotionRange, type EnvelopeBoneRanges, MeshReductionError, type MeshQualityReport, type MeshReductionInput, type SkinningEnvelope, type SkinningEnvelopeBone, skinningEnvelopeBone } from '@rig-c/core/mesh';
|
|
86
86
|
import type { ConfigConstraint } from './config.ts';
|
|
87
87
|
import type { MotionKey, MotionSpec } from './motion.ts';
|
|
88
88
|
import { edgeLength } from './length.ts';
|
package/src/automesh.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* author's `influences` — no 0.03 floor unless the author wrote it (P19) —
|
|
19
19
|
* unrounded, so a vertex that survives can be compared bit for bit.
|
|
20
20
|
* 2. **The call** ({@link autoReductionInput}) — rig-c's `reduceMesh`
|
|
21
|
-
* (
|
|
21
|
+
* (`@rig-c/core/mesh`, 2.28.x), refinement inside the declared regions then
|
|
22
22
|
* reduction, every input from the config or from the source, as the
|
|
23
23
|
* contract types it (docs/MESH_REDUCTION.md §1): `art` the padded image's
|
|
24
24
|
* alpha at threshold 1 in the part-local frame with `pageScale` 1 (the
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
type SourceMesh,
|
|
83
83
|
type Termination,
|
|
84
84
|
writeMeshQualityReport,
|
|
85
|
-
} from 'rig-c/mesh';
|
|
85
|
+
} from '@rig-c/core/mesh';
|
|
86
86
|
import { type AutoRegionSpec, type AutoSpec, type AutoWeightRegionSpec, type Point, weightsABone } from './config.ts';
|
|
87
87
|
import { type ContourChainRibs, type ContourMesh, contourMesh, type ContourReport, GRID } from './contour.ts';
|
|
88
88
|
import { type HeatField, heatInfluences } from './heat.ts';
|
package/src/automotion.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The motion gate of the automatic mesh mode (issue #126, item 3): a reduced
|
|
3
3
|
* mesh is written only when it moves like the mesh it was reduced from, on the
|
|
4
4
|
* rig's own idle, measured by rig-c's `compareMeshesInMotion`
|
|
5
|
-
* (
|
|
5
|
+
* (`@rig-c/core/meshcompare`, 2.29.x) and held to the bounds the author wrote in
|
|
6
6
|
* `meshes.<part>.auto.motion` (`AutoMotionSpec`, `src/config.ts`).
|
|
7
7
|
*
|
|
8
8
|
* ## What is compared
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
*
|
|
84
84
|
* Pure: no clock, no randomness, nothing read or written.
|
|
85
85
|
*/
|
|
86
|
-
import { type AcceptedOperation, MeshReductionError, type AlphaMask, type ArtFitBounds, type MeasureRow, type MeshQualityReport, type MotionAmplitude, type MotionBounds, type MotionSchedule, writeMeshQualityReport } from 'rig-c/mesh';
|
|
87
|
-
import { compareMeshesInMotion, comparePreparedMotion, prepareMotionReference, type MotionComparisonInput, type MotionReferenceInput, type PreparedMotionReference } from 'rig-c/meshcompare';
|
|
86
|
+
import { type AcceptedOperation, MeshReductionError, type AlphaMask, type ArtFitBounds, type MeasureRow, type MeshQualityReport, type MotionAmplitude, type MotionBounds, type MotionSchedule, writeMeshQualityReport } from '@rig-c/core/mesh';
|
|
87
|
+
import { compareMeshesInMotion, comparePreparedMotion, prepareMotionReference, type MotionComparisonInput, type MotionReferenceInput, type PreparedMotionReference } from '@rig-c/core/meshcompare';
|
|
88
88
|
import type { AutoMotionSpec } from './config.ts';
|
|
89
89
|
import type { Problem } from './errors.ts';
|
|
90
90
|
import { IDLE_FPS, type MotionSpec, type MotionTrack } from './motion.ts';
|
package/src/autoreplay.ts
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* (`src/build.ts`), the one place this package runs rigc. Pure: no clock, no
|
|
53
53
|
* randomness, nothing read or written.
|
|
54
54
|
*/
|
|
55
|
-
import type { AcceptedOperation, MeasureRow, MeshQualityReport, MotionSchedule, ReducedMesh } from 'rig-c/mesh';
|
|
55
|
+
import type { AcceptedOperation, MeasureRow, MeshQualityReport, MotionSchedule, ReducedMesh } from '@rig-c/core/mesh';
|
|
56
56
|
import { autoVerdict, terminationText } from './automesh.ts';
|
|
57
57
|
import { idleSchedule, localRow, motionRowText } from './automotion.ts';
|
|
58
58
|
import type { Problem } from './errors.ts';
|
package/src/build.ts
CHANGED
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
import { besideIdleLine, checkSummaryLine, inputFileRecord, type InputFileRecord, CLOTH_LINE, type ClothLine, clothWarnText, frameRuns, MOTION_SEAM_LINE, type MotionSeamLine, type MotionSeamPlant, motionSeamWarnText, FOLD_LINE, type FoldsLine, LEVEL_LINE, type LevelLine, LIMB_LINE, type LimbLine, STRESS_LINE, SWEEP_LINE, type SweepLine, buildGateLines, causeLines, environmentLine, IDLE_FPS, IDLE_MAX_PX, maxRgbDiff, REQUIREMENTS_DIR, type CheckReport, type PackLine, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, GATE_PROFILE, JUDGEMENT_LINES, type JudgementLine, packedBuildArgs, packedBuildLabel, type PackMode, readCheckEnvironment, readWindBand, type PackShape, type PageEdges, readFrameSet, rigcFailed, rigcIdentity, rigcRanClause, REPORTED_LINES, type ReportedLine, type RigcRunner, runCheck, SEAM_DIR, SEAM_MEAN_BAR, seamPairText, seamRigPxText, SOURCE_LINE, SEAM_PX_BAR, SEAM_PX_LEVEL, SEAM_PX_LEVEL_HIGH, SPINEBOY_YARDSTICK, STILL_DIR, WIND_BAND_LINE, windBandLines } from './check.ts';
|
|
79
79
|
import { type Cut, type Extend, type Limb, loadConfigAndAnimations, loadConfigWithBytes, loadEarlyConfig, type Patch, type PlanEntry } from './config.ts';
|
|
80
80
|
import { coreCompileGuideLine, failLine, PartsError, type Problem, refuseIfAny } from './errors.ts';
|
|
81
|
-
import type { MeshQualityReport, MotionSchedule } from 'rig-c/mesh';
|
|
81
|
+
import type { MeshQualityReport, MotionSchedule } from '@rig-c/core/mesh';
|
|
82
82
|
import { encodeGif } from './gif.ts';
|
|
83
83
|
import { CONTROL_SUFFIX, withAnimations } from './motion.ts';
|
|
84
84
|
import type { PaletteError } from './palette.ts';
|
|
@@ -659,6 +659,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
659
659
|
...(fields.scene === undefined ? {} : { scene: fields.scene }),
|
|
660
660
|
...(fields.armSplit !== undefined && altPlan.some((e) => e[1] === 'full' && (e[2] === 'handwear-r' || e[2] === 'handwear-l')) ? { armSplit: fields.armSplit } : {}),
|
|
661
661
|
...(fields.headFaceUnderfill === undefined ? {} : { headFaceUnderfill: fields.headFaceUnderfill }),
|
|
662
|
+
...(fields.yieldRefused === undefined ? {} : { yieldRefused: fields.yieldRefused }),
|
|
662
663
|
...(fields.turnMovingPair === undefined ? {} : { turnMovingPair: fields.turnMovingPair }),
|
|
663
664
|
seamRule: input.seam,
|
|
664
665
|
projectRule: input.project,
|
package/src/check.ts
CHANGED
|
@@ -80,7 +80,7 @@ import { baseAnchorMoves, type AnchorRegion } from './baseanchor.ts';
|
|
|
80
80
|
*/
|
|
81
81
|
import { createHash } from 'node:crypto';
|
|
82
82
|
import { createRequire } from 'node:module';
|
|
83
|
-
import type { Viewport as RootCoverageViewport } from 'rig-c/render-shared';
|
|
83
|
+
import type { Viewport as RootCoverageViewport } from '@rig-c/core/render-shared';
|
|
84
84
|
import { copyFileSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
85
85
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
86
86
|
import { measureRecomposite, type RecompositeFigures, recompositeRecord, scenePhrase, sourceInRig } from './assemble.ts';
|
|
@@ -164,9 +164,9 @@ import {
|
|
|
164
164
|
type SeamPair,
|
|
165
165
|
stretchRequirementLine,
|
|
166
166
|
} from './requirements.ts';
|
|
167
|
-
import { RIG_BONE_INHERIT, type RigSpec as RigcRigSpec } from 'rig-c/src/rig.ts';
|
|
168
|
-
import { expandStops } from 'rig-c/src/stop.ts';
|
|
169
|
-
import { ENVIRONMENT_SPEC, EnvironmentError, environmentResponse, readEnvironmentSchedule } from 'rig-c/src/environment.ts';
|
|
167
|
+
import { RIG_BONE_INHERIT, type RigSpec as RigcRigSpec } from '@rig-c/core/src/rig.ts';
|
|
168
|
+
import { expandStops } from '@rig-c/core/src/stop.ts';
|
|
169
|
+
import { ENVIRONMENT_SPEC, EnvironmentError, environmentResponse, readEnvironmentSchedule } from '@rig-c/core/src/environment.ts';
|
|
170
170
|
import { ART_ALPHA } from './mesh.ts';
|
|
171
171
|
import { connectedComponents } from './raster/components.ts';
|
|
172
172
|
import { alphaComposite } from './raster/composite.ts';
|
|
@@ -531,7 +531,7 @@ export function findRigc(from: string, pathVar: string, platform: 'win32' | 'pos
|
|
|
531
531
|
object: 'the rig-c CLI `rigc`',
|
|
532
532
|
detail: platform === 'win32'
|
|
533
533
|
? 'found at none of ' + looked.join(', ') + ' nor PATH candidates [' + onPath.join(', ') + ']; executable shapes rigc, rigc.exe were looked for; rigc.bunx alone is not executable; bun install supplies this dependency'
|
|
534
|
-
: `found at none of ${directories} node_modules/.bin/rigc path(s) from ${resolve(from)} up (nearest ${looked[0]}) nor on PATH; rig-c is this package's dependency — \`bun install\` puts it at node_modules/.bin/rigc`,
|
|
534
|
+
: `found at none of ${directories} node_modules/.bin/rigc path(s) from ${resolve(from)} up (nearest ${looked[0]}) nor on PATH; @rig-c/core is this package's dependency — \`bun install\` puts it at node_modules/.bin/rigc`,
|
|
535
535
|
},
|
|
536
536
|
]);
|
|
537
537
|
return '';
|
|
@@ -1919,14 +1919,14 @@ export interface SeamStateBounds {
|
|
|
1919
1919
|
* follows rigc's own package-root resolution. No candidate error selects a
|
|
1920
1920
|
* different API. Importing check, or constructing a root-free reader, loads none.
|
|
1921
1921
|
*/
|
|
1922
|
-
type OfficialRenderer = typeof import('rig-c/render-shared');
|
|
1922
|
+
type OfficialRenderer = typeof import('@rig-c/core/render-shared');
|
|
1923
1923
|
function officialRenderer(): OfficialRenderer {
|
|
1924
1924
|
const require = createRequire(import.meta.url);
|
|
1925
|
-
const coreRoot = dirname(require.resolve('rig-c/package.json'));
|
|
1925
|
+
const coreRoot = dirname(require.resolve('@rig-c/core/package.json'));
|
|
1926
1926
|
let runtimePresent = false;
|
|
1927
1927
|
try { require.resolve('@esotericsoftware/spine-core/package.json', { paths: [coreRoot] }); runtimePresent = true; } catch { /* Optional runtime is absent, as in rigc's launcher. */ }
|
|
1928
|
-
if (runtimePresent) require('rig-c/render');
|
|
1929
|
-
return require('rig-c/render-shared') as OfficialRenderer;
|
|
1928
|
+
if (runtimePresent) require('@rig-c/core/render');
|
|
1929
|
+
return require('@rig-c/core/render-shared') as OfficialRenderer;
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
1932
1932
|
/** One decoder/poser lifetime per state; retain only finite bounds and identities, never atlas pages or rasters. */
|
package/src/config.ts
CHANGED
|
@@ -88,7 +88,7 @@ import type { DepthConfig } from './depthsheets.ts';
|
|
|
88
88
|
*/
|
|
89
89
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
90
90
|
import { dirname, resolve } from 'node:path';
|
|
91
|
-
import { RIG_BONE_INHERIT, RIG_SKIN_CONSTRAINT_KEYS, type RigBoneInherit, type RigConstraint, type RigSkinConstraintKey, type RigStop } from 'rig-c/src/rig.ts';
|
|
91
|
+
import { RIG_BONE_INHERIT, RIG_SKIN_CONSTRAINT_KEYS, type RigBoneInherit, type RigConstraint, type RigSkinConstraintKey, type RigStop } from '@rig-c/core/src/rig.ts';
|
|
92
92
|
import { pyRound } from './round.ts';
|
|
93
93
|
import { motionSeamProblems, type MotionSeamDeclaration } from './motionseams.ts';
|
|
94
94
|
import { REQUIREMENTS_SPEC } from './requirements.ts';
|
|
@@ -307,6 +307,8 @@ export interface Assemble {
|
|
|
307
307
|
alternates?: AlternateSetConfig[];
|
|
308
308
|
/** Issue #492: composite full:face under head:face on the head canvas to fill transparent holes inside the face silhouette. */
|
|
309
309
|
head_face_underfill?: boolean;
|
|
310
|
+
/** Opt-in: yield original drift-refused front pixels to an opaque behind holder matching the painting. */
|
|
311
|
+
yield_refused?: boolean;
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
export interface SingleBone {
|
|
@@ -360,7 +362,7 @@ export type MeshSpec = (LatticeMeshSpec | ContourMeshSpec | AutoMeshSpec | Influ
|
|
|
360
362
|
/**
|
|
361
363
|
* One mesh in the influence mode (issue #378): rig-c's `segments` lattice over the part at `cell` px, every vertex
|
|
362
364
|
* pulled by every chain link within `radius` px of it, falling to zero there (`shape`), the strongest `max` kept —
|
|
363
|
-
* `buildSegmentsLattice` and `influenceShares` from
|
|
365
|
+
* `buildSegmentsLattice` and `influenceShares` from `@rig-c/core/mesh`, promised for this call (rig-c/core#1450), so the
|
|
364
366
|
* rule is core's and the mesh is written with explicit weights like every other mode (`src/rig.ts`). `segments`
|
|
365
367
|
* names the links as in every mode; each entry is one of rig-c's `bones` entries, which `across: false` keeps apart.
|
|
366
368
|
* `hold_tip: true` (issue #615, optional, written by `propose --cloth` from the recipe's `split.hold_tip`) smooths the
|
|
@@ -582,7 +584,7 @@ export type ContourRegionSpec =
|
|
|
582
584
|
/**
|
|
583
585
|
* One mesh in the automatic mode (issue #126, item 2): the contour mesh over
|
|
584
586
|
* the part at alpha 1 and above is the source, and rig-c's `reduceMesh`
|
|
585
|
-
* (
|
|
587
|
+
* (`@rig-c/core/mesh`, 2.28.x) refines it inside the declared regions and
|
|
586
588
|
* removes what the declared bounds allow (`src/automesh.ts`); the result is
|
|
587
589
|
* kept only when its motion passes `motion` (`src/automotion.ts`). Every quality
|
|
588
590
|
* input is a number the author wrote, named as rig-c's contract
|
|
@@ -1612,7 +1614,7 @@ export interface EarlyConfig {
|
|
|
1612
1614
|
depth?: DepthConfig;
|
|
1613
1615
|
key: string;
|
|
1614
1616
|
seethrough: SeeThrough;
|
|
1615
|
-
assemble: { rig_scale: number; head_face_underfill?: boolean };
|
|
1617
|
+
assemble: { rig_scale: number; head_face_underfill?: boolean; yield_refused?: boolean };
|
|
1616
1618
|
}
|
|
1617
1619
|
|
|
1618
1620
|
/** What plain `assemble` reads: the early config plus the plan `--propose-plan` printed. */
|
|
@@ -1681,12 +1683,15 @@ function parseEarlyConfigFrom(raw: Json, door: EarlyDoor, base: string | null):
|
|
|
1681
1683
|
if (door === 'layers') {
|
|
1682
1684
|
if ('seethrough' in t) checkSeeThrough(c, t.seethrough);
|
|
1683
1685
|
if ('assemble' in t) {
|
|
1684
|
-
const a = c.object('config.assemble', t.assemble, sectionRequired(door, 'assemble'), ['plan', 'extend_below_crop', 'patches', 'cuts', 'alternates', 'head_face_underfill']);
|
|
1686
|
+
const a = c.object('config.assemble', t.assemble, sectionRequired(door, 'assemble'), ['plan', 'extend_below_crop', 'patches', 'cuts', 'alternates', 'head_face_underfill', 'yield_refused']);
|
|
1685
1687
|
if (a !== null) {
|
|
1686
1688
|
if ('rig_scale' in a) c.number('config.assemble.rig_scale', a.rig_scale, 'positive');
|
|
1687
1689
|
if ('head_face_underfill' in a && typeof a.head_face_underfill !== 'boolean') {
|
|
1688
1690
|
c.fail('CONFIG_FIELD_TYPE', 'config.assemble.head_face_underfill', `is ${show(a.head_face_underfill)}; true or false is required`);
|
|
1689
1691
|
}
|
|
1692
|
+
if ('yield_refused' in a && typeof a.yield_refused !== 'boolean') {
|
|
1693
|
+
c.fail('CONFIG_FIELD_TYPE', 'config.assemble.yield_refused', `is ${show(a.yield_refused)}; true or false is required`);
|
|
1694
|
+
}
|
|
1690
1695
|
}
|
|
1691
1696
|
}
|
|
1692
1697
|
}
|
|
@@ -2385,7 +2390,7 @@ function checkRunTag(c: Check, path: string, run: Json, tag: Json): void {
|
|
|
2385
2390
|
*/
|
|
2386
2391
|
function checkAssemble(c: Check, v: Json, door: 'assemble' | 'full'): { parts: string[]; patches: string[]; cuts: string[] } {
|
|
2387
2392
|
const required = sectionRequired(door, 'assemble');
|
|
2388
|
-
const a = c.object('config.assemble', v, required.filter((k) => k !== 'plan'), ['plan', 'extend_below_crop', 'patches', 'cuts', 'alternates', 'head_face_underfill']);
|
|
2393
|
+
const a = c.object('config.assemble', v, required.filter((k) => k !== 'plan'), ['plan', 'extend_below_crop', 'patches', 'cuts', 'alternates', 'head_face_underfill', 'yield_refused']);
|
|
2389
2394
|
if (a === null) return { parts: [], patches: [], cuts: [] };
|
|
2390
2395
|
if (required.includes('plan') && !('plan' in a)) {
|
|
2391
2396
|
c.fail('CONFIG_FIELD_PRESENT', 'config.assemble.plan', 'is absent and required; `assemble --propose-plan` prints one from the two runs — paste its plan and extend_below_crop into config.assemble');
|
|
@@ -2395,6 +2400,9 @@ function checkAssemble(c: Check, v: Json, door: 'assemble' | 'full'): { parts: s
|
|
|
2395
2400
|
if ('head_face_underfill' in a && typeof a.head_face_underfill !== 'boolean') {
|
|
2396
2401
|
c.fail('CONFIG_FIELD_TYPE', `${p}.head_face_underfill`, `is ${show(a.head_face_underfill)}; true or false is required`);
|
|
2397
2402
|
}
|
|
2403
|
+
if ('yield_refused' in a && typeof a.yield_refused !== 'boolean') {
|
|
2404
|
+
c.fail('CONFIG_FIELD_TYPE', `${p}.yield_refused`, `is ${show(a.yield_refused)}; true or false is required`);
|
|
2405
|
+
}
|
|
2398
2406
|
const parts: string[] = [];
|
|
2399
2407
|
if ('plan' in a && c.array(`${p}.plan`, a.plan, true)) {
|
|
2400
2408
|
const seenPart = new Map<string, number>();
|
package/src/contour.ts
CHANGED
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
simplifyClosedPolygon,
|
|
162
162
|
traceAlphaOutline,
|
|
163
163
|
traceOutline,
|
|
164
|
-
} from 'rig-c/mesh';
|
|
164
|
+
} from '@rig-c/core/mesh';
|
|
165
165
|
|
|
166
166
|
/** Grid units per pixel: every coordinate this module writes is an integer multiple of 1/GRID px. */
|
|
167
167
|
export const GRID = 256;
|
package/src/coords.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* `flattenRig` goes back through `toWorld`. No rotation matrix is written out
|
|
23
23
|
* by hand in this package.
|
|
24
24
|
*/
|
|
25
|
-
import { cropToSpineY } from 'rig-c/src/transform.ts';
|
|
25
|
+
import { cropToSpineY } from '@rig-c/core/src/transform.ts';
|
|
26
26
|
|
|
27
27
|
/** A painting point on the accepted integer rig canvas, in setup-world coordinates. */
|
|
28
28
|
export function paintingToSetupPoint(point: readonly number[], sourceSize: readonly number[], rigSize: readonly number[]): [number, number] {
|
|
@@ -34,5 +34,5 @@ export function setupToPaintingPoint(point: readonly number[], sourceSize: reado
|
|
|
34
34
|
return [(point[0] + rigSize[0] / 2) / (rigSize[0] / sourceSize[0]), cropToSpineY(point[1], rigSize[1]) / (rigSize[1] / sourceSize[1])];
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export { computeExactFrameTransforms, computeWorldTransforms, cropToSpineY, normaliseDegrees, toBoneLocal, toBoneLocalVector, toWorld } from 'rig-c/src/transform.ts';
|
|
38
|
-
export type { BoneTransform } from 'rig-c/src/transform.ts';
|
|
37
|
+
export { computeExactFrameTransforms, computeWorldTransforms, cropToSpineY, normaliseDegrees, toBoneLocal, toBoneLocalVector, toWorld } from '@rig-c/core/src/transform.ts';
|
|
38
|
+
export type { BoneTransform } from '@rig-c/core/src/transform.ts';
|
package/src/meshdraft.ts
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* ## The one poser
|
|
53
53
|
*
|
|
54
54
|
* Every reading is rig-c's: the bars are `check`'s, through the injected {@link RigcRunner}; readings 2–4 are
|
|
55
|
-
* `compareMeshesInMotion` (
|
|
55
|
+
* `compareMeshesInMotion` (`@rig-c/core/meshcompare`) over the model documents of three unpacked gate builds — the drafted
|
|
56
56
|
* rig with every candidate part's attachment set to its lattice, to its candidate and to its dense reference, and
|
|
57
57
|
* nothing else different — whose motion carries the bend animations. This module poses nothing.
|
|
58
58
|
*
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
*/
|
|
62
62
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
63
63
|
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
64
|
-
import type { AlphaMask, MeasureRow, MeshQualityReport, MotionSchedule } from 'rig-c/mesh';
|
|
65
|
-
import { compareMeshesInMotion, type MotionComparisonInput } from 'rig-c/meshcompare';
|
|
66
|
-
import { MeshReductionError } from 'rig-c/mesh';
|
|
64
|
+
import type { AlphaMask, MeasureRow, MeshQualityReport, MotionSchedule } from '@rig-c/core/mesh';
|
|
65
|
+
import { compareMeshesInMotion, type MotionComparisonInput } from '@rig-c/core/meshcompare';
|
|
66
|
+
import { MeshReductionError } from '@rig-c/core/mesh';
|
|
67
67
|
import { explicitFrameId, idleSchedule } from './automotion.ts';
|
|
68
68
|
import { checkStage, gateThroughRigc, type Log, RIGC_MODEL_DOCUMENT, rigStage } from './build.ts';
|
|
69
69
|
import { BARS, type CheckReport, type PackShape, type PageEdges, type RigcRunner } from './check.ts';
|
package/src/motionseampose.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Posed-axis evidence from one stock seam render, never sampled source keys. */
|
|
2
|
-
import type { GeometryFile, GeometryFrame } from 'rig-c/render';
|
|
2
|
+
import type { GeometryFile, GeometryFrame } from '@rig-c/core/render';
|
|
3
3
|
import type { FrameSet } from './check.ts';
|
|
4
4
|
import { PartsError } from './errors.ts';
|
|
5
5
|
|
package/src/propose.ts
CHANGED
|
@@ -131,7 +131,7 @@ import { explicitWeightRows, regionBone, type RegionSpec } from './config.ts';
|
|
|
131
131
|
*/
|
|
132
132
|
import { existsSync } from 'node:fs';
|
|
133
133
|
import { join } from 'node:path';
|
|
134
|
-
import { drawText, GLYPH_H } from 'rig-c/tools/font5x7.ts';
|
|
134
|
+
import { drawText, GLYPH_H } from '@rig-c/core/tools/font5x7.ts';
|
|
135
135
|
import { type BoneEntry, type CharacterConfig, type ConfigConstraint, type ConfigStop, contourRegionsOf, deriveBustRegions, type Limb, type MeshSpec, type PartBinding, parseConfig, type Point, type Segment, type SkeletonSections, turnRidersByBone } from './config.ts';
|
|
136
136
|
export { contourRegionsOf, deriveBustRegions };
|
|
137
137
|
import { computeExactFrameTransforms, cropToSpineY, normaliseDegrees, toWorld } from './coords.ts';
|
package/src/raster/png.ts
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* map to omit these paths, this import is what breaks, by name, and
|
|
19
19
|
* `bun run smoke` is where that is seen first.
|
|
20
20
|
*/
|
|
21
|
-
import { assertPng } from 'rig-c/src/png.ts';
|
|
22
|
-
import { decodePng, encodePng } from 'rig-c/tools/plate.ts';
|
|
21
|
+
import { assertPng } from '@rig-c/core/src/png.ts';
|
|
22
|
+
import { decodePng, encodePng } from '@rig-c/core/tools/plate.ts';
|
|
23
23
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
24
24
|
import { type FloatImage, newFloatImage, newRaster, type Raster, RasterError } from './types.ts';
|
|
25
25
|
|
package/src/remesh.ts
CHANGED
|
@@ -75,8 +75,8 @@ import { applyMeshEdit, type DeltaApplied, type DeltaPlant, deltaSourceProblems,
|
|
|
75
75
|
import { DEFAULT_IDLE_KEYS, type IdleKeys, type MeshAttachment, meshBoundBones, rigJsonText, type RigSpec } from './rig.ts';
|
|
76
76
|
import { readRequirements } from './requirements.ts';
|
|
77
77
|
import { pyRound } from './round.ts';
|
|
78
|
-
import { type RigSpec as RigcRigSpec } from 'rig-c/src/rig.ts';
|
|
79
|
-
import { expandStops } from 'rig-c/src/stop.ts';
|
|
78
|
+
import { type RigSpec as RigcRigSpec } from '@rig-c/core/src/rig.ts';
|
|
79
|
+
import { expandStops } from '@rig-c/core/src/stop.ts';
|
|
80
80
|
|
|
81
81
|
/** The provenance file's spec. */
|
|
82
82
|
export const REMESH_SPEC = 'rig-parts-remesh/1';
|
package/src/requirements.ts
CHANGED
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
*/
|
|
48
48
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
49
49
|
import { resolve } from 'node:path';
|
|
50
|
-
import { CompileError } from 'rig-c/src/errors.ts';
|
|
51
|
-
import { splitRigSkin, type RigSkin } from 'rig-c/src/rig.ts';
|
|
50
|
+
import { CompileError } from '@rig-c/core/src/errors.ts';
|
|
51
|
+
import { splitRigSkin, type RigSkin } from '@rig-c/core/src/rig.ts';
|
|
52
52
|
import { cropToSpineY } from './coords.ts';
|
|
53
53
|
import type { Problem } from './errors.ts';
|
|
54
54
|
import { refuseIfAny } from './errors.ts';
|
package/src/rig.ts
CHANGED
|
@@ -138,15 +138,15 @@ import { explicitAttachment, type ExplicitMeshReport } from './explicitmesh.ts';
|
|
|
138
138
|
* order the objects are built in, and every number is rounded by `pyRound`).
|
|
139
139
|
*/
|
|
140
140
|
import { type AutoSpec, type BoneEntry, type InfluenceMeshSpec, type WeightRule, type CharacterConfig, type ConfigConstraint, type ConfigStop, CONSTRAINT_FOLLOWS, constraintForRig, contourRegionsOf, type ContourSpec, DEFAULT_BUST_BONE_L, DEFAULT_BUST_BONE_R, type Point, type RibsSpec, ROOT_BONE, stopForRig, turnRidersByBone, weightsABone } from './config.ts';
|
|
141
|
-
import { RUNTIME_PI } from 'rig-c/src/core/world.ts';
|
|
141
|
+
import { RUNTIME_PI } from '@rig-c/core/src/core/world.ts';
|
|
142
142
|
import { type BoneTransform, computeExactFrameTransforms, computeWorldTransforms, cropToSpineY, normaliseDegrees, paintingToSetupPoint, setupToPaintingPoint, toBoneLocal, toWorld } from './coords.ts';
|
|
143
143
|
import { type Problem, refuseIfAny, PartsError } from './errors.ts';
|
|
144
144
|
import { recordedFocusProblems } from './setfocus.ts';
|
|
145
145
|
import { eyeLineDegrees } from './headframe.ts';
|
|
146
|
-
import type { RigBoneInherit, RigStop } from 'rig-c/src/rig.ts';
|
|
147
|
-
import { f32 } from 'rig-c/compile';
|
|
148
|
-
import type { MeshCounts, MeshQualityReport, MeshReductionInput, MotionAmplitude, ReducedMesh, Termination } from 'rig-c/mesh';
|
|
149
|
-
import { bindWeightedVertices, buildGridMesh, buildSegmentsLattice, type EntrySegment, influenceShares, segmentDistance as rigcSegmentDistance, type SegmentsLattice, type SegmentsLatticeReport } from 'rig-c/mesh';
|
|
146
|
+
import type { RigBoneInherit, RigStop } from '@rig-c/core/src/rig.ts';
|
|
147
|
+
import { f32 } from '@rig-c/core/compile';
|
|
148
|
+
import type { MeshCounts, MeshQualityReport, MeshReductionInput, MotionAmplitude, ReducedMesh, Termination } from '@rig-c/core/mesh';
|
|
149
|
+
import { bindWeightedVertices, buildGridMesh, buildSegmentsLattice, type EntrySegment, influenceShares, segmentDistance as rigcSegmentDistance, type SegmentsLattice, type SegmentsLatticeReport } from '@rig-c/core/mesh';
|
|
150
150
|
import { type AmplitudeRow, amplitudeRow, partAmplitude, withAmplitude } from './autoamplitude.ts';
|
|
151
151
|
import { type ResidualRow, residualRow, slotEnvelope, withSkinning } from './autoenvelope.ts';
|
|
152
152
|
import { type AutoMotionCase, type AutoSearch, DEFORM_MAY_FOLD_WHY, type MotionDeformation, type StimulusPose, stimulusAnimationNames } from './automotion.ts';
|
package/src/scene.ts
CHANGED
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
*/
|
|
94
94
|
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
95
95
|
import { dirname, join, resolve } from 'node:path';
|
|
96
|
-
import type { RigStop } from 'rig-c/src/rig.ts';
|
|
96
|
+
import type { RigStop } from '@rig-c/core/src/rig.ts';
|
|
97
97
|
import { checkStage, gateThroughRigc, type Log } from './build.ts';
|
|
98
98
|
import { ACCEPTABLE_BARS, barsNotMet, type CheckReport, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, type PackMode, requirementsNotPass, type RigcRunner } from './check.ts';
|
|
99
99
|
import { CONSTRAINT_BONE_FIELDS, ROOT_BONE } from './config.ts';
|
package/src/sheet.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { existsSync } from 'node:fs';
|
|
20
20
|
import { basename, dirname, join } from 'node:path';
|
|
21
|
-
import { drawText, GLYPH_H } from 'rig-c/tools/font5x7.ts';
|
|
21
|
+
import { drawText, GLYPH_H } from '@rig-c/core/tools/font5x7.ts';
|
|
22
22
|
import { type Problem, refuseIfAny } from './errors.ts';
|
|
23
23
|
import { type LayerSet, OPAQUE_ALPHA_ABOVE, readLayers } from './layers.ts';
|
|
24
24
|
import { readParts } from './parts.ts';
|
package/src/structure.ts
CHANGED
|
@@ -71,8 +71,8 @@ import { explicitWeightRows, regionBone } from './config.ts';
|
|
|
71
71
|
* Pure but for reading the three files it is handed.
|
|
72
72
|
*/
|
|
73
73
|
import { existsSync, readFileSync } from 'node:fs';
|
|
74
|
-
import { CompileError } from 'rig-c/src/errors.ts';
|
|
75
|
-
import { parseRigSpec, RIG_SPEC_VERSION, type RigBone as RigcBone, type RigSpec as RigcSpec, splitRigSkin } from 'rig-c/src/rig.ts';
|
|
74
|
+
import { CompileError } from '@rig-c/core/src/errors.ts';
|
|
75
|
+
import { parseRigSpec, RIG_SPEC_VERSION, type RigBone as RigcBone, type RigSpec as RigcSpec, splitRigSkin } from '@rig-c/core/src/rig.ts';
|
|
76
76
|
import { type ConfigConstraint, CONSTRAINT_FOLLOWS, contourRegionsOf, parseConfig, parseProposalSections, type Point, ROOT_BONE, type SkeletonSections, weightsABone } from './config.ts';
|
|
77
77
|
import { computeExactFrameTransforms, cropToSpineY, normaliseDegrees, toWorld } from './coords.ts';
|
|
78
78
|
import { PartsError, type Problem, refuseIfAny } from './errors.ts';
|
package/src/turn.ts
CHANGED
|
@@ -36,8 +36,8 @@ import { pyRound } from './round.ts';
|
|
|
36
36
|
import { turnOverlapOwners } from './turnoverlap.ts';
|
|
37
37
|
import { sampleTurnTriangleField, turnTriangleCoordinates } from './turnfield.ts';
|
|
38
38
|
import { PartsError } from './errors.ts';
|
|
39
|
-
import { f32 } from 'rig-c/compile';
|
|
40
|
-
import { evaluateDeformTransform } from 'rig-c/src/deformgen.ts';
|
|
39
|
+
import { f32 } from '@rig-c/core/compile';
|
|
40
|
+
import { evaluateDeformTransform } from '@rig-c/core/src/deformgen.ts';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* The layers that ride on the face (issue #271): See-through makes no depth
|
package/src/turnoverlap.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Source-alpha overlap selects turn fields, never skin bindings. */
|
|
2
|
-
import { DRAWN_ALPHA } from 'rig-c/src/passthrough.ts';
|
|
2
|
+
import { DRAWN_ALPHA } from '@rig-c/core/src/passthrough.ts';
|
|
3
3
|
import { computeWorldTransforms, setupToPaintingPoint, toWorld } from './coords.ts';
|
|
4
4
|
import type { Depth25DTurnOptions } from './turn.ts';
|
|
5
5
|
import type { Problem } from './errors.ts';
|
package/src/waistmesh.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { PartsError } from './errors.ts';
|
|
|
4
4
|
import { counterClockwiseInSpineWorld, type LatticeMesh } from './mesh.ts';
|
|
5
5
|
import type { MeshAttachment, RegionAttachment, RigBone, WeightEntry } from './rig.ts';
|
|
6
6
|
import { pyRound } from './round.ts';
|
|
7
|
-
import { f32 } from 'rig-c/compile';
|
|
7
|
+
import { f32 } from '@rig-c/core/compile';
|
|
8
8
|
|
|
9
9
|
type Q = readonly [bigint, bigint];
|
|
10
10
|
type P = readonly [Q, Q];
|
package/tools/build-process.ts
CHANGED
|
@@ -14,11 +14,11 @@ export function selectedRigcCommand(bin: string, platform: NodeJS.Platform = pro
|
|
|
14
14
|
const selected = resolve(bin);
|
|
15
15
|
// findRigc selected this exact local .bin path; do not resolve an ambient package.
|
|
16
16
|
if (basename(selected) !== 'rigc' || basename(dirname(selected)) !== '.bin') return fail('unknown or custom script shim');
|
|
17
|
-
const packageRoot = join(dirname(dirname(selected)), 'rig-c');
|
|
17
|
+
const packageRoot = join(dirname(dirname(selected)), '@rig-c', 'core');
|
|
18
18
|
const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as { name?: unknown; bin?: unknown };
|
|
19
19
|
const binMap = manifest.bin;
|
|
20
20
|
const declared = typeof binMap === 'string' ? binMap : binMap !== null && typeof binMap === 'object' ? (binMap as Record<string, unknown>).rigc : undefined;
|
|
21
|
-
if (manifest.name !== 'rig-c' || typeof declared !== 'string') return fail('the selected package does not declare rigc');
|
|
21
|
+
if (manifest.name !== '@rig-c/core' || typeof declared !== 'string') return fail('the selected package does not declare rigc');
|
|
22
22
|
const entry = resolve(packageRoot, declared);
|
|
23
23
|
const within = relative(realpathSync.native(packageRoot), realpathSync.native(entry));
|
|
24
24
|
if (within === '..' || within.startsWith('..' + sep) || isAbsolute(within) || !statSync(entry).isFile()) return fail('bin target is outside the selected package');
|