rig-parts 1.60.1 → 1.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/cli.ts +7 -22
- package/docs/AUTHORING.md +122 -9
- package/docs/STABILITY.md +20 -3
- package/package.json +3 -1
- package/src/build.ts +16 -4
- package/src/check.ts +41 -30
- package/src/comfy/painting.ts +2 -1
- package/src/config.ts +74 -14
- package/src/configwrite.ts +56 -18
- package/src/diagnostics.ts +3 -2
- package/src/limblayout.ts +6 -4
- package/src/limbs.ts +18 -3
- package/src/limbslots.ts +17 -6
- package/src/propose.ts +4 -3
- package/src/remesh.ts +31 -7
- package/src/retune.ts +10 -8
- package/src/rig.ts +11 -5
- package/src/structure.ts +2 -1
- package/tools/alternate-cli.ts +25 -0
- package/tools/build-process.ts +206 -0
package/README.md
CHANGED
|
@@ -456,7 +456,10 @@ for each — a config fragment, the `check` lines it passes with, and its limit:
|
|
|
456
456
|
|
|
457
457
|
- [**Expressions and other named animations**](docs/AUTHORING.md#recipe-expressions-and-other-named-animations):
|
|
458
458
|
the face's parts are bones; animations written over them in rig-c's motion-spec shape and
|
|
459
|
-
named by `motion.animations_from` are built and gated beside the idle on every build.
|
|
459
|
+
named by `motion.animations_from` are built and gated beside the idle on every build. Keys
|
|
460
|
+
carry core motion fields, including raw `curve` control points in absolute time/value
|
|
461
|
+
coordinates ([core key format](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md#45-keys--times-values-curves));
|
|
462
|
+
the linked recipe includes a core-gated example. One
|
|
460
463
|
attachment per slot, so a part moves, turns and scales but is never swapped for another
|
|
461
464
|
image; `check` measures the idle alone.
|
|
462
465
|
- [**A soft region driven by physics**](docs/AUTHORING.md#recipe-a-soft-region-driven-by-physics)
|
package/cli.ts
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
* 2 a usage error, or a command this version does not implement
|
|
13
13
|
*/
|
|
14
14
|
import { spawnSync } from 'node:child_process';
|
|
15
|
+
import { runBuildProcess, processRigcRunner as rigcRunner } from './tools/build-process.ts';
|
|
15
16
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
16
17
|
import { tmpdir } from 'node:os';
|
|
17
18
|
import { basename, dirname, extname, join, resolve } from 'node:path';
|
|
18
19
|
import { DEFAULT_PROJECT_RULE, DEFAULT_SEAM_RULE, HOLES_LISTED, PROJECT_RULES, type ProjectRule, proposeFields, proposePlan, proposeSinglePlan, SEAM_RULES, type SeamRule } from './src/assemble.ts';
|
|
20
|
+
import { parseAltArg } from './tools/alternate-cli.ts';
|
|
19
21
|
import { type AlternateCliInput, assembleStage, build, checkStage, ERROR_MAP_FILE, loopStage, readRuns, readSource, rigStage, suppliedCheckFlag } from './src/build.ts';
|
|
20
22
|
import { ACCEPTABLE_BARS, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, findRigc, PACK_SHAPES, rigcRunnerAt, type PackShape, PAGE_EDGES, type PageEdges, PARTS_HOME_SENTENCE, RIGC_GEOMETRY_VERSION, rigcRanClause, type RigcRunner, NO_PARTS_SENTENCE, SEAM_MEAN_BAR, SOURCE_SENTENCE, SEAM_PX_BAR, SEAM_PX_LEVEL, SPINEBOY_YARDSTICK, TEXTURE_STRETCH_CEILING } from './src/check.ts';
|
|
21
23
|
import { ComfyClient, resolveHost, runPainting, runSeeThrough } from './src/comfy/index.ts';
|
|
@@ -1040,19 +1042,6 @@ function notTaken(command: Command, flag: string): string {
|
|
|
1040
1042
|
return `${command} does not take "${flag}"; it takes ${[...row.valued, ...row.switches].join(', ')}`;
|
|
1041
1043
|
}
|
|
1042
1044
|
|
|
1043
|
-
/** Parse `--alt <name>=<source>:<full>[:<head>]` (issue #454), or return a usage message. */
|
|
1044
|
-
function parseAltArg(value: string): AlternateCliInput | string {
|
|
1045
|
-
const eq = value.indexOf('=');
|
|
1046
|
-
if (eq <= 0) return `--alt "${value}" is not <name>=<source>:<full>[:<head>]`;
|
|
1047
|
-
const name = value.slice(0, eq);
|
|
1048
|
-
if (name.startsWith('.') || name.includes('/') || name.includes('\\')) return `--alt set name "${name}" may not start with "." or hold a slash`;
|
|
1049
|
-
const rest = value.slice(eq + 1);
|
|
1050
|
-
const parts = rest.split(':');
|
|
1051
|
-
if (parts.length < 2 || parts.length > 3 || parts[0].length === 0 || parts[1].length === 0 || (parts.length === 3 && parts[2].length === 0)) {
|
|
1052
|
-
return `--alt "${value}" is not <name>=<source>:<full>[:<head>]`;
|
|
1053
|
-
}
|
|
1054
|
-
return { name, source: parts[0], full: parts[1], ...(parts.length === 3 ? { head: parts[2] } : {}) };
|
|
1055
|
-
}
|
|
1056
1045
|
|
|
1057
1046
|
/**
|
|
1058
1047
|
* `layers <path>` prints the table; `layers --export <dir> <path>` writes the
|
|
@@ -1244,14 +1233,6 @@ function cmdRig(args: string[]): number {
|
|
|
1244
1233
|
* the spawn from here. A call that fails carries which rigc ran it, path and
|
|
1245
1234
|
* version ({@link rigcRunnerAt}, issue #337), and every refusal quoting it says so.
|
|
1246
1235
|
*/
|
|
1247
|
-
function rigcRunner(bin: string): RigcRunner {
|
|
1248
|
-
return rigcRunnerAt(bin, (b, args) => {
|
|
1249
|
-
const r = spawnSync(b, [...args], { encoding: 'utf8', maxBuffer: 1 << 28 });
|
|
1250
|
-
if (r.error !== undefined) return { status: 127, out: `could not start ${b}: ${r.error.message}` };
|
|
1251
|
-
return { status: r.status ?? 1, out: `${r.stdout ?? ''}${r.stderr ?? ''}` };
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
1236
|
/** The command's valued flags as `--flag value` pairs, each one its {@link TAKES} row holds; `required` must all be given. Its bare switches are taken out by the caller before this reads the rest. A string is a usage error. */
|
|
1256
1237
|
function flags(args: string[], command: Command, required: readonly string[]): Map<string, string> | string {
|
|
1257
1238
|
const got = new Map<string, string>();
|
|
@@ -1877,7 +1858,11 @@ function cmdBuild(args: string[]): number {
|
|
|
1877
1858
|
try {
|
|
1878
1859
|
const r = build(
|
|
1879
1860
|
{ config, source, full, head, out, seam: seam as SeamRule, project: project as ProjectRule, loop, pageEdges: edges, packShape: shape, ...(flags.has('--requirements') ? { requirements: flags.get('--requirements') as string } : {}), idleKeys: keys, ...(leadText === undefined ? {} : { leadIn: Number(leadText) }), seamPairs: on.has('--seam-pairs'), keepStills: on.has('--keep-stills'), ...(alts.length === 0 ? {} : { alts }), ...(flags.has('--set') ? { set: flags.get('--set') as string } : {}), allSets: on.has('--all-sets'), ...(flags.has('--environment') ? { environment: flags.get('--environment') as string } : {}) },
|
|
1880
|
-
{ rig: rigcRunner(bin), check: rigcRunner(bin), checkBin: bin, scratch: join(scratch, 'rig-gate')
|
|
1861
|
+
{ rig: rigcRunner(bin), check: rigcRunner(bin), checkBin: bin, scratch: join(scratch, 'rig-gate'), stages: {
|
|
1862
|
+
assemble: (input, outputs) => runBuildProcess({ stage: 'assemble', bin, input, outputs }, join(scratch, 'workers')),
|
|
1863
|
+
rig: (input, _rigc, gateScratch) => runBuildProcess({ stage: 'rig', bin, input, scratch: gateScratch }, join(scratch, 'workers')),
|
|
1864
|
+
check: (input, _rigc, checkBin) => runBuildProcess({ stage: 'check', bin: checkBin, input }, join(scratch, 'workers')),
|
|
1865
|
+
} },
|
|
1881
1866
|
console.log,
|
|
1882
1867
|
);
|
|
1883
1868
|
return r.stoppedAt === null ? EXIT_OK : EXIT_REFUSED;
|
package/docs/AUTHORING.md
CHANGED
|
@@ -118,17 +118,17 @@ read by no CPU stage).
|
|
|
118
118
|
| `assemble.extend_below_crop` | assemble | **proposed** with the plan: `{part, run, tag}` — a head-run part that reaches the bottom of the head crop is continued from a full-run layer, whole connected components |
|
|
119
119
|
| `assemble.patches` | assemble; `meshes`/`regions` keys may name them too | **authored**, optional: `[{name, box, alpha, draw}]` — an extra part cut from the **painting** itself, for figure no See-through layer holds (a hem both runs dropped). `box` is `[x0, y0, x1, y1]` in **rig** pixels, `x1`/`y1` exclusive — the space of `parts.json` and `recomposite_rig.png`, where the hole is found; `alpha` is `"silhouette"` (the painting's figure silhouette inside the box, the one `--seam silhouette` uses) or `"box"` (the whole box); `draw` is `"back"`, `"front"` or `{"before": "<plan part>"}`. A patch is always a region: its bone is `regions.<name>`, in the one place every region's bone lives, and a `meshes` entry for it is refused. `draw` sets assembled part order; an exclusively bound limb rider's final rig slot joins that limb's block (see the limbs subsection). See §5 for how to place one |
|
|
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
|
-
| `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?, 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>]`. `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 |
|
|
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?, 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 |
|
|
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
123
|
| `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?}, …], 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
124
|
| `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
|
-
| `meshes.<part>` | rig | **proposed**, then corrected. Exactly one of `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 every mode: `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) |
|
|
125
|
+
| `meshes.<part>` | rig | **proposed**, then corrected. Exactly one of `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 every mode: `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`. |
|
|
126
126
|
| `meshes.<part>.influence` | rig | **authored**, optional (issue #378), a mode beside `grid`, `contour` and `auto`: `{cell, radius, across, max, shape, hold_tip?}`, every field but `hold_tip` required, none defaulted. rig-c's `segments` lattice over the part at `cell` px, each vertex pulled by every link of the mesh's `segments` within `radius` px of it — a pull that falls to exactly 0 at `radius` (`shape` `"linear"` or `"smooth"`), across the `segments` entries or only within the nearest one (`across`), the strongest `max` kept. The lattice and the shares are computed by rig-c's own promised functions (`buildSegmentsLattice`, `segmentDistance`, `influenceShares`), so the rule is rig-c's (its AUTHORING §3.4.7), and the mesh is written with explicit weights like every other mode. `radius` is a length on this part: the rig stage measures the farthest lattice vertex's distance to its nearest link and refuses a radius at or under it (`RIG_INFLUENCE_REACH`), naming the distance. `propose --cloth` drafts it when a recipe declares `influence` and no `radius` (issue #518): the farthest vertex's distance plus 3 of the part's lattice cells, printed on a `LINT` line with both figures. Measured on the cloth fixture and the public `wind` example (#513: 8 covered parts, `render --folds` with the physics on under wind and a hip sway of 8° and 30°): a radius just above the floor folds **more** than the lattice (one skirt went from 0 to 55 folded frames), and a larger one is **not** safer (one fringe folded again at about 3–4× its farthest distance); +2 to +6 cells read 0 on every part, +2 at the edge. That reading counted folds only; read against `check` as well (the rig as built, under the wind schedule +1 → −1 → calm, `build --environment`, the three covered `wind` parts at the same number of cells), the window that holds is **+2 to +3 cells**, and +4 is the ceiling: `wind` `bottomwear`'s `CHECK_TIP_OVER_ROOT` ratio is 1.898 on the lattice, 1.801 at +2 cells, 1.590 at +3 and **1.471 at +4**, under the floor 1.4725, so the build fails there, and 1.351 at +6 (#513, rig-parts 1.52.0, rigc 2.60.0; the lattice, +3 and +4 read again on rig-parts 1.54.0, rigc 2.60.0, the same figures, #599). The drafted +3 sits in that window, one cell under the ceiling (no radius between +3 and +4 was read), and the window is a hypothesis until a third subject — each edge rests on one part — so state `radius` in the recipe to keep your own. `r`, `exponent`, `rule`, `influences`, `stray` and `ribs` belong to the distance rule or another mode and are refused beside it (`CONFIG_INFLUENCE_MODE`). `hold_tip` (issue #615) — `true` only, or absent: the pulled shares are smoothed by the lattice's held-fork passes (the cloth recipe's `split.hold_tip` sentence below: four passes of 1-ring mesh-edge averaging, self weight 0.5, floor 0.005) capped at the declared `max`, so no vertex binds more than `max` bones; absent, the shares are rig-c's as pulled and every byte is the one written before the field existed (`false`, a second spelling of absent, is `CONFIG_FIELD_TYPE`). The mesh's `mesh_report.json` row echoes it in `influence`. `propose --cloth` writes it, with `max` raised to at least 8 (the lattice's smoothing cap), on the parts a recipe with `influence` and `split.hold_tip: true` meshes; the rig stage reads it off the mesh and never the recipe. Measured on `wind` `bottomwear` and the cloth fixture's skirt under a 60° hip sway (#615, `render --folds`, physics on): `wind` `bottomwear` folds 41 frames as drafted before the field (max 6) and **0** with `hold_tip` and max 8, against its lattice's 5; with `hold_tip` at max 6 it reads 23, and at max 8 without `hold_tip` 3; the fixture skirt (recipe given `split.hold_tip`) reads 20 before and 0 with it, against its lattice's 0, and 0 at max 8 without it. So the raised `max` carries most of the gap and the smoothing the rest on `wind` (rig-parts 1.54.0, rigc 2.60.0; a split skirt without `hold_tip` is not smoothed and reads its 44 as before). For cloth and hair that should bend as one surface across its chains |
|
|
127
127
|
| `meshes.<part>.contour` | rig | **authored**, optional (issue #84): `{tolerance, margin, spacing, maxEdge?, budget?, stray?, bridges?, regions?, bust?}`. `tolerance` — rig-c's Douglas–Peucker tolerance on the traced outline, px, 0 or more; `margin` — how far the silhouette grows before it is traced, px: 0, or 1 or more (a pixel joins when its centre lies within `margin` of an art pixel's centre; a value above 0 and below 1 adds nothing and is refused, `CONFIG_FIELD_TYPE`); `spacing` — the background interior spacing, px, above 0; `maxEdge` (issue #265) — the longest outline edge, px, above 0: every simplified edge longer than it is cut into `ceil(length / maxEdge)` equal pieces, each cut point on the 1/256 px grid, before any region or rib touches the outline (absent: nothing is cut, and no byte moves; under 2/256 px the rig stage refuses it, `CONTOUR_PARAMETER`, because two cut points could snap together); the row echoes it in `params` and counts the points it added in `contour.outlineCut`, both only when declared; `budget` — the most vertices the mesh may have (refused above it, nothing thinned); `stray` — the largest island, in art pixels, that may be left out of the mesh (absent: none is); `bridges` (issue #326) — `true`, its one value: islands are read in this order — **dust first** (those `stray` leaves out), **then faint islands** (every pixel's alpha under 64, a quarter of full opacity: left out the same way, their pixels kept in the image but not meshed, so not drawn, and named in the row's `contour.bridges.faint` with their px, brightest alpha and box), **then every visible island is meshed and bridged, whatever the bridge costs** — overdraw is reported, never a reason to drop art; the largest island, or a tie for it, is never left out, faint or not: dropping it would draft the part without its art, and a part whose main body is faint is a question about the layer, which the plan and the author own, not one for the mesh — and the pieces are joined into the one outline rig-c takes by bridges — the kept islands, holes filled, grow together by `margin`, so islands closer than about twice the margin are one grown silhouette, traced as one; each silhouette is traced, simplified, capped, refined and triangulated as a one-island mesh is; then, starting from the silhouette with the most art, the nearest pair of a vertex on the joined outline and one on a silhouette still apart whose quad holds (wound as the mesh, crossing no outline, holding no other vertex, one closed outline after) is joined by that quad, two triangles over no art, until none is apart. Coverage and overshoot read the silhouettes' triangles; a bridge's area is in `meshArea` and in the row's `contour.bridges` (`islands`, `units`, and per join `unit`, `span` — its two crossing edges, px — `area`, `vertices`, `pair`; and `faint`, only when an island was left out as faint), and the row's `params` echoes `bridges`, both only when declared; `art_coverage` counts a faint island's pixels as art not covered. Absent, a second island is refused as below and no byte moves; on one island it writes the mesh the undeclared entry writes. Any other value is `CONFIG_FIELD_TYPE`; beside `ribs` it is `CONTOUR_PARAMETER` (a rib runs across one outline); a join no pair makes is `CONTOUR_BRIDGE`. A bridge stretches with whatever pulls its two ends apart, so it belongs on a part whose pieces ride one bone — the only case `mesh-draft` drafts; a bridge adds no vertex (issue #570): its four corners, `contour.bridges.joins[].vertices`, are outline vertices of the two silhouettes it joins, and they are weighted as every vertex of the mesh is, by distance to every bone the mesh's `segments` name — no step of the weighting reads which island a vertex lies on, so where two islands ride two bones (two legs in one `legwear` on `leg_r` and `leg_l`) each island's vertices, the corners among them, take weight from the other island's bones too (selftest `CW100`: on its fixture the left island's two corners each take 0.35821 from the right island's bone, and none of its vertices less than 0.30431), and a part whose pieces must not pull each other is split into one part per piece; `regions` — local deformation regions, each `{name, shape, bone, spacing, band}` with `shape` `"circle"` (`cx, cy, r`) or `"polygon"` (`points`, 3 or more): `bone` is the region's control bone (any bone `bones` declares), `spacing` the interior spacing inside the region and its band, `band` the width the bone's weight falls across. Every length and position is **rig px**, like every other in the config; the part image is the rig less `(x − 4, y − 4)` (its box less the pad), a translation, so a length is the same number in both. A region's `cx`, `cy`, `r`, `band` and `points` are multiples of 1/256 px (`CONFIG_FIELD_TYPE` otherwise); region names are unique per mesh (`CONFIG_REGION_NAME_UNIQUE`). `bust` (issue #475) — `{apex_r, apex_l, cleavage, alpha?: 0.22, clearance?: 3.8, bone_r?: "boob_r", bone_l?: "boob_l", spacing?: 14}`: derives the two circular regions `bust_r` and `bust_l` from the three rig-px landmarks `apex_r`, `apex_l` and `cleavage` (multiples of 1/256 px, `CONFIG_FIELD_TYPE` otherwise; projecting the torso midline `neck → chest → hip` onto `apex_r → apex_l` misses the cleavage by 14–93 px across all five calibrated 3/4-yaw characters, so all three points are required). With `d_s = \|cleavage − apex_s\|` and `D = \|apex_r − apex_l\|`, each side `s ∈ {r, l}` is placed at `cx = apex_s[0]`, `cy = apex_s[1]` with outer radius `R_s = d_s − clearance`, core radius `r_s = round(alpha × R_s)` and `band_s = round(R_s) − r_s` (`alpha` = 0.22, `clearance` = 3.8 px, `spacing` = 14 px, `bone_r` = `"boob_r"`, `bone_l` = `"boob_l"` by default, reproducing the five calibrated example characters within `<= 6 px`, max `\|ΔR\| = 5 px`, max `\|Δr\| = 3 px`). Refused when `clearance <= 0`, `R_r + R_l >= D`, or a derived `r_s` or `band_s` is not positive (`CONFIG_BUST_CLEARANCE`), when `bone_r` or `bone_l` is not declared in `bones` (`CONFIG_NAME_RESOLVES`), or when `contour.regions` also names `bust_r` or `bust_l` (`CONFIG_REGION_NAME_UNIQUE`). Both `propose` and `rig` read `contour.bust` through `contourRegionsOf` (`deriveBustRegions`), and hand-written `contour.regions` entries build byte-identically when `bust` is absent. The alpha threshold is not a field: art is alpha above 8, the lattice's and `check`'s |
|
|
128
128
|
| `meshes.<part>.ribs` | rig | **authored**, optional (issue #188), in the `contour` and `auto` modes: `{<chain>: {stations}, …}`, each key a chain this mesh's `segments` name. Each link of the chain gets a row of vertices across the part at its origin and at `stations` points evenly between its origin and its end (`stations`, a whole number, 0 or more, required; a chain of L links carries L × (stations + 1) ribs), each rib a row of vertices across the part, kept as a row of locked edges; the rule is "Ribs along a chain" under "A contour mesh". Absent places none and changes no byte. Refused: a lattice mesh with ribs (`CONFIG_RIBS_MODE` — its vertices are its grid's corners), a key that is not one of the mesh's chains (`CONFIG_NAME_RESOLVES`), an object naming no chain or a `stations` that is not a whole number from 0 (`CONFIG_FIELD_TYPE`); at the rig stage `CONTOUR_RIB_ART`, `CONTOUR_RIB_LINK`, `CONTOUR_RIB_CROSSING`, `CONTOUR_RIB_EDGE` (the contour refusals). The mesh's `mesh_report.json` row gains `ribs` — the declaration, the ribs placed and the vertices they hold — and its contour report (the source's, in `auto`) lists each rib's vertices |
|
|
129
129
|
| `meshes.<part>.influences` | rig | **authored**, optional (issue #284), in the `grid` and `contour` modes: `{maxInfluences?, floor?}`, at least one. `maxInfluences` — the most bones that pull one vertex, a whole number 1 or more, or `null`, no cap (every bone the mesh's `segments` name; `null` is the config's spelling of a bound declared absent, as in `maxOvershoot` and `weightJump`); absent is 4. `floor` — `"cut"` (the capped shares normalised, any under 0.03 dropped, the rest normalised again; what an absent `floor` means) or `"continuous"` (0.03 subtracted from every capped share, those at or below 0 dropped, the rest normalised again, so a bone fades out of a vertex instead of leaving it in one step). Absent, the mesh is weighted at 4 and the cut and every byte is the one written before the field existed; declared, it applies under either `rule`, and is echoed as `influences` in the mesh's `mesh_report.json` row. `propose` never writes it, and `mesh-draft` carries a lattice's declaration to the contour candidate it drafts. A cap that is not a whole number 1 or more or `null` (the string `"none"` included), another `floor`, or an object naming neither is `CONFIG_FIELD_TYPE`; a vertex the declared cut leaves with no bone is `RIG_INFLUENCES_KEPT`; beside `auto` it is `CONFIG_INFLUENCES_MODE` (that mode's cap and floor are `auto.influences`). What each setting trades is "The weight cut" below |
|
|
130
130
|
| `meshes.<part>.stray` | rig | **authored**, optional (issue #303), in the `grid` mode: the largest island, in art pixels, that may be left out of the lattice — the contour mode's `contour.stray`, with the same meaning, over the same islands (the 4-connected islands of the art, alpha above 8): every island of `stray` art px or fewer is cleared from the art the lattice and, under `rule: "heat"`, its silhouette are built over, except an island as large as the largest, which is never left out (two equal largest pieces both stay). Unlike the contour mode an island above the figure is not refused — the lattice bridges every island it keeps, as it always has. An island that sits in a cell the lattice keeps for other art leaves the lattice unchanged: there `stray` changes only the silhouette `rule: "heat"` reads, and gives back no triangle (demo `bottomwear`'s 2 px island, in the cell kept for the hem's tip, is that case). Absent, nothing is left out and every byte is the one written before the field existed; a figure that leaves nothing out changes no byte of `rig.json` or `motion.json`. The part's image is not touched: a pixel left out stays in it, and is drawn only where a cell kept for other art happens to cover it; `art_coverage` is over all the art, the islands left out included. Declared, the mesh's `mesh_report.json` row echoes `stray` and adds `stray_cleared` (`islands`, `pixels`, `art_pixels`, after `influences`), and the rig stage's mesh line ends `stray <n> left out <i> island(s), <p> of <a> art px`. A value that is not a whole number from 0 is `CONFIG_FIELD_TYPE`; beside `contour` or `auto` it is `CONFIG_STRAY_MODE` (those modes state it in `contour.stray` and `auto.source.stray`). `propose` and `mesh-draft` never write it |
|
|
131
|
-
| `regions.<part>` | rig | **proposed**: the bone a rigid part rides. Every plan part is exactly one of a mesh or a region (`CONFIG_PART_ATTACHED`) |
|
|
131
|
+
| `regions.<part>` | rig | **proposed**: the bone a rigid part rides. Every plan part is exactly one of a mesh or a region (`CONFIG_PART_ATTACHED`) Also accepts `{bone, gather?}`: `bone` is the same required bone name and `gather: false` keeps an exclusive non-segment limb rider at its authored draw position without changing its binding (issue #680). Remove `gather` for normal gathering; other values are refused and a non-rider is `RIG_GATHER_RIDER`. |
|
|
132
132
|
| `motion.duration` | rig; check (the loop is measured at this time) | proposed as 40 frames at 12 fps, `40/12` s, written `3.3333333333333335` (issue #252; the reference proposed 4 s, and every period it drafted is scaled with it so each track keeps its cycles per idle); a whole number of 1/12 s ticks, because `check` renders at 12 fps and compares frame 0 with the frame at this time — read within 10^-9 s (`TIME_SLACK`, issue #244), since a whole number of frames is often not exact in binary: rigc's 40th frame sits at `40 × (1/12)` = `3.333333333333333`. Half a frame off is `CHECK_LOOP_LAST_FRAME_AT_DURATION` |
|
|
133
133
|
| `motion.tracks` | rig | **proposed**, then tuned. Single `{bone, prop, amp, period, phase, base?}` or chain `{chain, amps, period, phase, lag}` — one amplitude per link, link `i` at phase `phase + lag·i`. Every `period` must divide `duration` (`CONFIG_PERIOD_DIVIDES_DURATION`). A bone property is keyed by one track (`CONFIG_BONE_PROPERTY_KEYED_ONCE`): a chain keys `rotate` on every link, the blink's `eyes` group `scaley` and its `brows` group `translatey` on every member, so a single track on any of those is a second track on it — rigc would refuse it one stage later, `animation "idle" has two tracks on eye.scaley`. The proposed breath (issues #252, #270) is `chest` `translatey` travelling 2.5 % of the torso's length peak to peak — the distance from the `neck` bone to the `hip` bone as the proposal writes them, the run the chest sits half way along, whichever rule placed them — (amplitude half of it to two decimals, `base` the amplitude, so the chest rises from the setup pose and returns); the `breath:` note prints the fraction, the length, the two bones and the pixels. Until #270 it was 2.5 % of the `topwear` part's height, and a sweater to the thighs (`scarf`, 690 px) breathed 2.9 times as deep as `demo`; on neck → hip `scarf` reads 431 px (10.78 px) and `demo` 192 px (4.80 px). Neck and hip on one point: no length to scale by, so the breath keeps the reference's amplitude 1.3 (2.6 px peak to peak) and the note says so — scale it to the figure. `chest` `scalex` and the `head` and `neck` rolls are a ratio and angles and are proposed the same on every figure. A chain link is turned along its chain (the `bones` row), so a `translatex`/`translatey` key on a bone whose parent is a turned link, or a `scale`/`shear` key on a turned link, would move or stretch along the link and not along the picture's axis: the rig stage refuses it (`RIG_KEY_FRAME_UNTURNED`); `rotate` is keyed on any bone |
|
|
134
134
|
| `motion.blink` | rig | **proposed**: `{t, eyes, brows, squash, brow_drop}`; the whole blink, `t` to `t + 0.364` s (`t + 0.314` s without brows: the brows' keys are the ones that end last), must fit inside the idle (`RIG_BLINK_INSIDE_IDLE`). The `eyes` group's `scaley` squashes every part on the eye bones about the bone's origin, the eyewhite's centre. Optional: a figure with no `eyewhite-r`/`-l` part has no eye bone, so `propose` writes no `blink` and notes `no blink: no eyewhite part (looked for: eyewhite-r, eyewhite-l), …`; with eyes and no `eyebrow-r`/`-l` part it writes the blink without `brows` and `brow_drop` and notes `blink without brows: …`. `brows` and `brow_drop` are stated together or not at all (`CONFIG_BLINK_BROWS_PAIRED`), and a group that names no bone is refused (`CONFIG_BLINK_GROUP_MEMBERS`) — rigc would refuse it one stage later, `group "eyes" declares no members` — as is a group that names one bone twice (`CONFIG_BLINK_GROUP_UNIQUE`; rigc: `group "eyes" names member "eye" twice`). An `irides-*` or `eyelash-*` part on a side with no eyewhite has no eye bone to ride: `propose` places it on `head` as a region, which the blink does not move, and notes `no eyewhite part for eye_r (looked for: eyewhite-r): iris (head:irides-r) is placed on head as a region, …`. The timing is fixed, not a field (table below) |
|
|
@@ -142,6 +142,19 @@ read by no CPU stage).
|
|
|
142
142
|
| `proposed_rig_scale` | assemble, rig, build, `propose --from-config`/`--compare` | **proposed** by `propose` (issue #354): `parts.json`'s `scale_rig_per_source`, the `assemble.rig_scale` the rig sections (`bones`, `meshes`, `limbs`, `motion`) were drafted at. Held equal to `assemble.rig_scale` when present (`CONFIG_PROPOSED_RIG_SCALE`; 0, negative or not a number: `CONFIG_FIELD_TYPE`). Absent on a hand-authored config, where no byte of any output moves |
|
|
143
143
|
| `requirements` | build (read in place of `--requirements` when the flag is not given), and so its check | **authored**, optional, never proposed (issue #556): a path, relative to the config file's directory, to the `spine-parts-requirements/1` file the build's check reads (§7, *Declared requirements*) — so a rig that needs one (a `not_swinging` part, a `may_fold`) rebuilds from its config alone. `build` reads it before assemble, as it reads the flag's file, and `check.json`'s `requirements.file` records it with `path` as declared. Given beside `--requirements`, the two must name the same file once resolved, or a file of the same bytes, and the declaration is read and recorded (a build given both writes what the config alone writes); otherwise `BUILD_REQUIREMENTS_CONFLICT`, naming both. Not a non-empty string: `CONFIG_FIELD_TYPE`; no such file, where the config is read from a path: `CONFIG_FILE_PRESENT`. `check`, `compose`, `mesh-draft`, `remesh` and `retune` do not read it: their `--requirements` is the only door. Absent, nothing is read and no byte of any output moves |
|
|
144
144
|
|
|
145
|
+
A skeleton alternate may declare `anchor: {neck: "head"}` (issue #543):
|
|
146
|
+
one or two body-18 keypoints mapped to declared base-bone origins, in rig pixels.
|
|
147
|
+
One pair reads offset with scale held at 1; two read scale and offset without
|
|
148
|
+
rotation, in canonical keypoint order. The existing registration bars stay
|
|
149
|
+
1 rig pixel for offset and 1 % for scale. `sets.json.registration` records the
|
|
150
|
+
result; an offset or scale over the bar refuses with
|
|
151
|
+
`ASSEMBLE_ALT_SKELETON_REGISTERED` and the required transform. No painting pixels
|
|
152
|
+
are resized or moved. With no `anchor`, the existing torso registration is
|
|
153
|
+
unchanged, including its refusal when a torso end has no declared bone.
|
|
154
|
+
The loader requires `skeleton`, one or two known keypoints, and known bone names
|
|
155
|
+
(`CONFIG_FIELD_PRESENT`, `CONFIG_FIELD_TYPE`, `CONFIG_KEY_KNOWN`,
|
|
156
|
+
`CONFIG_NAME_RESOLVES`).
|
|
157
|
+
|
|
145
158
|
**One drawing, one band; beyond it, another drawing (issue #472).** A single front-facing
|
|
146
159
|
`face` plate has one painted outline, one nose ridge, and two eyes in front-view topology.
|
|
147
160
|
Within the rated single-plate band (`FACE_RATED_BAND`: `yaw ±15°`, `pitch ±12°`),
|
|
@@ -614,7 +627,8 @@ the torso.
|
|
|
614
627
|
**Assembled order and final rig slot order are distinct** (issue #646). Assembly keeps
|
|
615
628
|
`parts.json` and its recomposite in the authored part order, including each patch's
|
|
616
629
|
`draw`. At rig time, each declared limb gathers its exclusively bound rider slots
|
|
617
|
-
locally into its existing segment block
|
|
630
|
+
locally into its existing segment block, unless its own `regions` or `meshes`
|
|
631
|
+
entry declares `gather: false` (issue #680). The block's anchor is its first segment
|
|
618
632
|
slot in the original setup draw order; block-anchor order and each limb's owned
|
|
619
633
|
slots' internal relative order are stable. This applies to every declared limb,
|
|
620
634
|
without inferring an anatomical pair or a torso target. A front painting patch
|
|
@@ -631,6 +645,23 @@ whose pixels overlap them, so setup RGBA equality must be measured on the author
|
|
|
631
645
|
input. Public generated setup comparisons are evidence for those inputs, not a
|
|
632
646
|
universal promise that all art keeps its compositing order.
|
|
633
647
|
|
|
648
|
+
An exclusive rider may keep its authored draw position while still following the
|
|
649
|
+
limb: write `"shawl": {"bone": "drape0", "gather": false}` in `regions`, or
|
|
650
|
+
`"gather": false` beside a mesh's existing fields. This excludes that part's slot
|
|
651
|
+
family from gathering and from a limb layout's inherited riders, including mesh
|
|
652
|
+
replay. It does not change the bone binding, weights, transforms, art, or the
|
|
653
|
+
shared-target layout rule. A named part targeted explicitly by a layout still
|
|
654
|
+
serves as that declared target. With no key, every existing gathering rule and
|
|
655
|
+
output byte is unchanged; a region may still use its historical bone string.
|
|
656
|
+
Only `false` is admitted; remove the key for normal gathering.
|
|
657
|
+
|
|
658
|
+
| rule | Found | Required |
|
|
659
|
+
| --- | --- | --- |
|
|
660
|
+
| <a id="RIG_GATHER_RIDER"></a>`RIG_GATHER_RIDER` | An opt-out on a declared limb segment, a part outside the limbs, or a nonexclusive/unbound part | Remove `gather` or bind a non-segment rider exclusively to one declared limb; actual base and alternate attachment bindings must all belong to that limb, reading every listed mesh weight reference, even zero weights |
|
|
661
|
+
|
|
662
|
+
Generated still pieces keep their authored family position; they do not acquire
|
|
663
|
+
a new binding.
|
|
664
|
+
|
|
634
665
|
**Explicit adjacency** (issue #647) is optional and takes effect at **rig time**,
|
|
635
666
|
after every base and alternate attachment has been built. For example, on an
|
|
636
667
|
existing limb named `unit_a`:
|
|
@@ -1092,6 +1123,12 @@ holes), `grownPixels` (added by the margin), `pinchFilledPixels` (added by the p
|
|
|
1092
1123
|
`grownHolePixels` (transparent pixels the grown silhouette encloses — a notch whose mouth grew
|
|
1093
1124
|
shut))
|
|
1094
1125
|
and, per region, the vertices its bone reaches (`g > 0`) and holds alone (`g = 1`).
|
|
1126
|
+
Across contour, automatic and influence reports, `regions[].bone` and `reach.nearest`
|
|
1127
|
+
name the authored template bones used to calculate the regions and reach. Stops and turn
|
|
1128
|
+
can rebind the emitted attachment after those calculations; these diagnostic names are
|
|
1129
|
+
not rewritten. The row's `bones` lists the final attachment bindings after rebinding.
|
|
1130
|
+
Use that list (or the emitted attachment), rather than a region or reach name, when
|
|
1131
|
+
resolving the bones the resulting rig actually binds (issue #560).
|
|
1095
1132
|
`art_coverage` is over all the part's art, stray islands included (in the automatic mode it is
|
|
1096
1133
|
not: there the islands `source.stray` leaves out are cleared from every reader's art, see
|
|
1097
1134
|
`source.stray` below). A lattice mesh's row is
|
|
@@ -1658,7 +1695,7 @@ same shape over the face bones, and `examples/demo/animations.json` holds seven
|
|
|
1658
1695
|
"animations": {
|
|
1659
1696
|
"sway": { "duration": 2, "loop": true, "tracks": [
|
|
1660
1697
|
{ "bone": "chest", "property": "rotate", "keys": [
|
|
1661
|
-
{ "t": 0, "v": [0] }, { "t": 0.5, "v": [3] }, { "t": 1.5, "v": [-3] }, { "t": 2, "v": [0] } ] },
|
|
1698
|
+
{ "t": 0, "v": [0], "curve": [0.15, 0, 0.35, 3] }, { "t": 0.5, "v": [3] }, { "t": 1.5, "v": [-3] }, { "t": 2, "v": [0] } ] },
|
|
1662
1699
|
{ "bone": "head", "property": "rotate", "keys": [
|
|
1663
1700
|
{ "t": 0, "v": [0] }, { "t": 1, "v": [-2] }, { "t": 2, "v": [0] } ] } ] } } }
|
|
1664
1701
|
```
|
|
@@ -1667,6 +1704,14 @@ same shape over the face bones, and `examples/demo/animations.json` holds seven
|
|
|
1667
1704
|
`CONFIG_FIELD_PRESENT: config.motion.animations_from (<file>).spec — is absent and required:
|
|
1668
1705
|
write "spec": "rigc-motion/1" beside "animations", …`, and another value is `CONFIG_FIELD_TYPE`
|
|
1669
1706
|
naming the value found and `"rigc-motion/1"`.
|
|
1707
|
+
- **Keys keep rig-c's motion fields, including `curve`.** The loader carries the named
|
|
1708
|
+
animations as written; rig-c gates them, as it gates this example in selftest `CF514`.
|
|
1709
|
+
[The core key format](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md#45-keys--times-values-curves)
|
|
1710
|
+
defines `curve` as four numbers per value channel: absolute control-point
|
|
1711
|
+
`[time, value, time, value]`, not normalized graph handles. The first chest key above
|
|
1712
|
+
shapes its span to the next key. A key carries `ease` or `curve`, never both, and
|
|
1713
|
+
the final key carries neither. Top-level motion fields are a separate contract:
|
|
1714
|
+
`animations_from` supplies `spec` and `animations`, not a second setup or easing table.
|
|
1670
1715
|
- **Key times strictly increase within a track, and the last is at `duration`** — rig-c's rule
|
|
1671
1716
|
(its AUTHORING §4.5, "`t` is in seconds and must strictly increase"; R7: no key past the
|
|
1672
1717
|
declared duration, and a duration more than a frame longer than the last key is refused).
|
|
@@ -1895,6 +1940,55 @@ and the total, `mesh-stats: total 1908 triangles over 6 mesh(es)`, the counts th
|
|
|
1895
1940
|
`mesh_report.json` will hold (§4, *Counting the triangles before a build*). On `reference-sample`
|
|
1896
1941
|
it runs in under a second; the build it saves runs the render and `check` as well.
|
|
1897
1942
|
|
|
1943
|
+
**Choose region spacing against the triangle budget.** Interior grid density grows
|
|
1944
|
+
roughly as area / spacing², including the transition band: for a circle that area
|
|
1945
|
+
extends to `r + band`, not just `r`. The outline, background grid and sampled region
|
|
1946
|
+
rings also contribute, so multiplying the *whole* triangle count by that ratio
|
|
1947
|
+
incorrectly scales the fixed part. Read the part's `mesh_report.json` row first, and use
|
|
1948
|
+
`mesh-stats` for the candidate rather than waiting for a rendered build.
|
|
1949
|
+
|
|
1950
|
+
A bounded calibration on the public [family office config](https://github.com/rig-c/examples/blob/d5a1768ce4a2d1e3f5726d1739cd0da4a63b0e13/family/roa/config.json)
|
|
1951
|
+
uses both `topwear` bust regions at spacing 14. Its pinned
|
|
1952
|
+
[mesh report](https://github.com/rig-c/examples/blob/d5a1768ce4a2d1e3f5726d1739cd0da4a63b0e13/family/roa/out/rig/mesh_report.json)
|
|
1953
|
+
has 500 vertices, 883 triangles, 115 hull vertices, 53 background interior vertices
|
|
1954
|
+
and 332 regional interior vertices. For this topology, `T = 2V - H - 2`; separating
|
|
1955
|
+
those contributions gives `T_fixed = 2(115 + 53) - 115 - 2 = 219` and a regional
|
|
1956
|
+
term of `2 × 332 = 664`. Freeze the local estimate before trying other spacings:
|
|
1957
|
+
|
|
1958
|
+
`T_est(s) = 219 + 664 × (14 / s)²`
|
|
1959
|
+
|
|
1960
|
+
Measured with Bun 1.4.2 and rig-c 2.60.0, changing **only both region spacings** in
|
|
1961
|
+
that pinned config, through the same `mesh-stats` reader (no repair application):
|
|
1962
|
+
|
|
1963
|
+
| Region spacing (px) | Estimated triangles | Actual triangles | Absolute relative error |
|
|
1964
|
+
| --- | ---: | ---: | ---: |
|
|
1965
|
+
| 14 (calibration) | 883.00 | 883 | 0% |
|
|
1966
|
+
| 10 | 1520.44 | 1470 | 3.43% |
|
|
1967
|
+
| 18 | 620.68 | 624 | 0.53% |
|
|
1968
|
+
| 22 | 487.89 | 491 | 0.63% |
|
|
1969
|
+
|
|
1970
|
+
The three held-out spacings stayed within 15%; this is a local planning rule,
|
|
1971
|
+
not a guarantee for another silhouette, band, overlap or meshing mode. Ring samples
|
|
1972
|
+
scale with perimeter / spacing, and point rejection and boundary splits change the
|
|
1973
|
+
counts too. Recalibrate when those inputs change; do not refit the estimate to the
|
|
1974
|
+
same points and call them validation.
|
|
1975
|
+
|
|
1976
|
+
For a per-mesh budget `B > T_fixed`, start at
|
|
1977
|
+
`s >= s0 × sqrt((T0 - T_fixed) / (B - T_fixed))`, then count the candidate.
|
|
1978
|
+
An author choosing 700 triangles here gets about 16.45 px; spacing 18 actually
|
|
1979
|
+
counts 624. If `B <= T_fixed`, coarsening the soft region alone is not the remedy.
|
|
1980
|
+
Core's `A13_MESH_BUDGET` reads
|
|
1981
|
+
[`invariants.meshTriangles`](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md#37-invariants--what-the-artifact-cannot-say-about-itself)
|
|
1982
|
+
from the rig spec; this is not an additional parts-config field, and a dry count
|
|
1983
|
+
is not a compiler or appearance verdict. Use the actual count for the budget decision.
|
|
1984
|
+
|
|
1985
|
+
To repeat the table, check out that public example pin, copy its config to
|
|
1986
|
+
`work/spacing18.json`, change both
|
|
1987
|
+
`meshes.topwear.contour.regions[].spacing` values to 18, and run from the example
|
|
1988
|
+
repository root (repeat with 10, 14 and 22):
|
|
1989
|
+
|
|
1990
|
+
`rig-parts mesh-stats --config work/spacing18.json --parts family/roa/out`
|
|
1991
|
+
|
|
1898
1992
|
`build` on `reference-sample` as tracked (PR #187; the values above are the ones tuned for its `hop`, issue #183):
|
|
1899
1993
|
|
|
1900
1994
|
```
|
|
@@ -2501,6 +2595,13 @@ the fields the block holds, and a missing `assemble.plan` names
|
|
|
2501
2595
|
`assemble --propose-plan`, which prints one. `build` runs `rig`, so it asks the
|
|
2502
2596
|
full loader before its assemble stage writes anything.
|
|
2503
2597
|
|
|
2598
|
+
`comfy paint` records each seed in `painting_<seed>_meta.json` beside the PNG:
|
|
2599
|
+
|
|
2600
|
+
| meta field | what the graph used |
|
|
2601
|
+
| --- | --- |
|
|
2602
|
+
| `checkpoint`, `loras`, `sampler` | the selected checkpoint and resolved LoRA and sampler fields |
|
|
2603
|
+
| `upscale` | `{ model, then }`: `UPSCALE_MODEL` and `UPSCALE_THEN` from `src/graphs.ts`, the model loader and subsequent scale factor (issue #698); automatic model selection is unchanged |
|
|
2604
|
+
|
|
2504
2605
|
0. **The painting (optional).** `rig-parts comfy paint --config config.json --out inputs --host <url>`
|
|
2505
2606
|
generates `painting_<seed>.png` on a ComfyUI box; any other route to a painting
|
|
2506
2607
|
skips this step and leaves `generation` out. Config: the `paint` row.
|
|
@@ -2888,7 +2989,7 @@ valued destination path. Its modes have different ownership:
|
|
|
2888
2989
|
| `propose --head-box` | existing regular config | `seethrough.head_box` |
|
|
2889
2990
|
| `assemble --propose-plan` | existing regular config; must name `--config` itself | `assemble.plan`, `assemble.extend_below_crop` |
|
|
2890
2991
|
| ordinary `propose --parts` without `--cloth` | existing regular config | each present `PROPOSAL_CONFIG_SECTIONS` value: `bones`, `meshes`, `regions`, `limbs`, `motion`, `constraints`, `turn`, `proposed_rig_scale` |
|
|
2891
|
-
| ordinary `propose --parts … --only-missing` (
|
|
2992
|
+
| ordinary `propose --parts … --only-missing` (issues #671, #679) | existing regular config | only resolvable `meshes.<part>` or `regions.<part>` for an unattached part: attached covers existing `meshes` and `regions`, source parts consumed by the config's own `limbs.<name>.segments[].from`, and `assemble.patches` (always regions), with or without `--keypoints`. Entries are checked against the config's bones and chains, including mesh and `auto` bone/region references; an unresolved entry is never written. Each skipped part gets a note naming its attachment or the unresolved reference and why. An accepted split part from `full:drape-<s>` / `full:hand-<s>` also gains its missing `assemble.plan` row (drape before the full run's `handwear-<s>` row, hand after it); added row by row and entry by entry, every existing byte as read |
|
|
2892
2993
|
| `propose --cloth <input.json>` | new file | the recipe's edits spliced into the cloth config; §3, *The config written*, gives entry ownership, hand-edit conflicts and `--from <previous.json>` |
|
|
2893
2994
|
|
|
2894
2995
|
For the first three modes (not `--only-missing`), each selected field replaces its whole value; other
|
|
@@ -2907,8 +3008,8 @@ and refuses this flag; `--from` belongs to the cloth mode only.
|
|
|
2907
3008
|
`--only-missing` (issue #671) is the upgrade path for a config proposed before a stage
|
|
2908
3009
|
made a part it never named — the 1.37.0 arm split's `drape_<s>` and `hand_<s>`
|
|
2909
3010
|
([MIGRATION](MIGRATION.md#after-1370-merged-arm-layers-are-split-issue-490)): the same
|
|
2910
|
-
loader validates the candidate
|
|
2911
|
-
|
|
3011
|
+
loader validates the candidate after unresolved entries have been skipped with a note
|
|
3012
|
+
naming the part, reference and reason; a skipped entry gets no plan row, and a part of any
|
|
2912
3013
|
other origin gets no plan row; nothing missing keeps the bytes and mtime; stderr names each added row and entry. It is a usage error with `--head-box`, `--cloth`
|
|
2913
3014
|
or `--from-config`, or without `--parts` or `--write-config`.
|
|
2914
3015
|
All four modes use one file-writing adapter. Fresh cloth output keeps its
|
|
@@ -3474,7 +3575,7 @@ See-through with another seed.
|
|
|
3474
3575
|
| <a id="CONFIG_TURN_REQUIRED"></a>`CONFIG_TURN_REQUIRED` | `motion.animations_from` carries `turn` or `tilt` `derive` keys while `config.turn` is absent, or an attached head part (`face`, `hair_front`, `hair_back`) is missing from `config.turn.depths` (issue #478): without `turn.depths` the head pivot and back-of-head counter-parallax cannot be derived | run `propose --full` (or `--head`) to draft `config.turn`, or declare `config.turn` with `pivot` and `depths` covering `face`, `hair_front` and `hair_back` |
|
|
3475
3576
|
| <a id="CONFIG_FACE_BAND_EXCEEDED"></a>`CONFIG_FACE_BAND_EXCEEDED` | `turn.band` or a `motion.animations_from` `turn`/`tilt` `derive.degrees` exceeds the single-plate rated band (`FACE_RATED_BAND`: `yaw <= 15°`, `pitch <= 12°`, issue #472) while no `assemble.alternates` entry replaces `face`; the detail gives the requested angle, the rated limit and both remedies | clamp the angle to `±15°` yaw / `±12°` pitch, or declare an `assemble.alternates` entry covering `face` for the 3/4 or profile plate |
|
|
3476
3577
|
| <a id="CONFIG_PROPOSED_RIG_SCALE"></a>`CONFIG_PROPOSED_RIG_SCALE` | `proposed_rig_scale` (the `scale_rig_per_source` `propose` drafted the rig sections at, issue #354) differs from `assemble.rig_scale`: the coordinates in `bones`, `meshes`, `limbs` and `motion` are in that rig canvas's pixels and do not scale when `assemble.rig_scale` changes | re-run `assemble` and `propose` at the new `assemble.rig_scale`, or restore `assemble.rig_scale` to `proposed_rig_scale` |
|
|
3477
|
-
| <a id="CONFIG_BUST_CLEARANCE"></a>`CONFIG_BUST_CLEARANCE` | `meshes.<part>.contour.bust
|
|
3578
|
+
| <a id="CONFIG_BUST_CLEARANCE"></a>`CONFIG_BUST_CLEARANCE` | `meshes.<part>.contour.bust`: `clearance <= 0`, `R_r + R_l >= D` where `R_s = round(d_s - clearance)` and `D = \|apex_r − apex_l\|`, a non-positive core `r_s = round(alpha × R_s)`, or a negative band `R_s − r_s`; the detail names the rounded values found | use the detail's first passing clearance on 0.01 px steps, checked against the same rounded rules (not the unrounded distance bound); if no such value exists, move `cleavage` or the apices, or change `alpha`, then retry. A larger clearance can also erase a core, so do not keep increasing it blindly |
|
|
3478
3579
|
| <a id="CONFIG_SET_COVERS_SLOT"></a>`CONFIG_SET_COVERS_SLOT` | `motion.animations_from` (issue #473): a track key carries `"set": "<name>" \| null` on a track other than `property: "attachment"`, names an alternate set not declared in `assemble.alternates`, or names an alternate set that does not cover the track's `slot` (neither in `slots` nor in `hides`); the detail names the set, the slot and the slots that set covers | declare the set in `assemble.alternates`, add the slot to that set's `parts` (or `hides`), or key `"set"` on a slot the set covers |
|
|
3479
3580
|
| <a id="CONFIG_SET_COVERS_BONE"></a>`CONFIG_SET_COVERS_BONE` | `assemble.alternates[i].drawn.<bone>` (issue #476): a subset set (`parts` present) states a `drawn` world angle for a bone none of its covered parts ride; the detail names the bone, the set, and the bones its covered parts ride | remove the uncovered bone from that set's `drawn`, or add the part that rides it to `parts` |
|
|
3480
3581
|
| <a id="CONFIG_LIMB_SET_JOINTS"></a>`CONFIG_LIMB_SET_JOINTS` | `assemble.alternates[i]` (issue #476): a gesture set over a limb chain declared in `config.limbs.<limb>` names the unsplit `from` layer instead of the limb's segment `part`s, covers (or hides) only a subset of the limb chain's segments, or declares custom polygon `cuts` on the limb; the detail names the limb and its segment parts | cover all segment `part`s of `config.limbs.<limb>` in `parts` with no custom `cuts`, so `assemble` cuts the set at the base's joints |
|
|
@@ -3674,6 +3775,17 @@ exits 0, and `mesh_draft.json` and the console name the reading and the amount.
|
|
|
3674
3775
|
| <a id="REMESH_INPUT_CHECK_MOVED"></a>`REMESH_INPUT_CHECK_MOVED` | under `--record-input-check`, a file under `--rig` or `--parts` (or the requirements file) is not the same bytes after check-input read it as when the input was first hashed; the file and both digests are named. The check may have measured bytes the record's rows do not name, so neither the record nor the revision is written | leave the input alone while the run measures it, and run again |
|
|
3675
3776
|
| <a id="REMESH_BONES_POSED"></a>`REMESH_BONES_POSED` | rig-c cannot pose the input's bones at the setup pose — its expansion of the rig's `stops`, or its evaluation of the bones (a bone `inherit` the runtime resolves to no mode), refuses with the sentence quoted; nothing was written | read rig-c's sentence; rigc's gate over the input passed, so report it with the line |
|
|
3676
3777
|
|
|
3778
|
+
**Revision ancestry (issue #531).** Both `remesh` and `retune` keep every prior
|
|
3779
|
+
root `remesh.json` / `retune.json` byte for byte at
|
|
3780
|
+
`provenance/<command>-<sha256>.json`. The new record's optional `input.provenance`
|
|
3781
|
+
rows name each parent (`source`, `path`, `bytes`, `sha256`), so a revision of a
|
|
3782
|
+
revision keeps its earlier records recoverable, including mixed commands. Existing
|
|
3783
|
+
history is carried forward unchanged. A conflicting history path is refused by
|
|
3784
|
+
`REMESH_PRESERVED` / `RETUNE_PRESERVED`. `revision` hashes the files actually
|
|
3785
|
+
written, excluding only the new root provenance itself (a file cannot hash itself);
|
|
3786
|
+
a newly recorded `input-check.json` is hashed with its new bytes. The rig splice
|
|
3787
|
+
and hold rules are unchanged; a first revision has no parent rows.
|
|
3788
|
+
|
|
3677
3789
|
A remesh changes one part's mesh and nothing else: every file of the input but
|
|
3678
3790
|
`rig.json` and `mesh_report.json` is copied as bytes, `rig.json` keeps every byte
|
|
3679
3791
|
outside the part's attachment, and the parts the config does not reproduce — repairs
|
|
@@ -3860,6 +3972,7 @@ documents do not ship). Each is an input this package built; none is an author's
|
|
|
3860
3972
|
| <a id="CHECK_PACK_SHAPE"></a>`CHECK_PACK_SHAPE` | the pack line disagrees with the `--pack-shape` the build was run with — it ends `, shape rect` under `polygon` or `, shape polygon` under `rect`, or it has no shape clause (the 1.5–2.0 form, read as `rect`) under `polygon` | a rigc older than 2.1.0 on `PATH`: rigc 2.0.3 takes `--pack-shape` without a word, packs by rectangles and prints the form with no shape clause, so this refusal is what catches it — `bun install` (this package depends on rig-c ^2.20.4); otherwise a rigc problem, report it with `rigc --version` |
|
|
3861
3973
|
| <a id="BUILD_ARTIFACT_PRESENT"></a>`BUILD_ARTIFACT_PRESENT` | the packed build lacks its `.json`, `.atlas` or page | a rigc problem; report it |
|
|
3862
3974
|
| <a id="BUILD_REQUIREMENTS_CONFLICT"></a>`BUILD_REQUIREMENTS_CONFLICT` | `build --requirements <file>` names a file with other bytes than the one `config.requirements` declares (issue #556): the detail names both, each resolved (the flag against the working directory, the declaration against the config's) with its sha256 — or `no such file`. Refused before assemble writes anything. The same file by both, or a copy of its bytes, is not refused: the declaration is read and recorded | drop the flag to build from the config's file, or point `config.requirements` at the flag's |
|
|
3975
|
+
| <a id="BUILD_STAGE_REQUEST"></a>`BUILD_STAGE_REQUEST` | an internal build worker was given a missing or malformed request, an unknown stage, or incomplete runner, input, output or scratch paths; the worker refuses before running a stage. This is the internal process protocol, not a public command or option | invoke `rig-parts build` with its documented flags; if that command produces this refusal, report the named request defect rather than constructing or modifying a worker request |
|
|
3863
3976
|
| <a id="REQUIREMENTS_FILE"></a>`REQUIREMENTS_FILE` | `--requirements` names no file, or one that does not parse as a JSON object. Refused before anything is built (by `build`, before assemble) | the path of a `spine-parts-requirements/1` file |
|
|
3864
3977
|
| <a id="REQUIREMENTS_FIELD"></a>`REQUIREMENTS_FIELD` | a field of the file is missing, of the wrong type, or not one the format reads: `spec`, `fps` (no default), `requirements`, each requirement's `name` (letters, digits, underscores; once each), `kind`, `animation` and its kind's fields — every bar among them (`within_px`, `fraction`, `tolerance`, `least_drive` above 0, `within_degrees` from 0 to 180, `lo_degrees` ≤ `hi_degrees`, `within_ratio` ≥ 1) — and each target's `bone`, `animation` and exactly one of `at` and `keys` (times strictly increasing), and `not_planted`, `not_swinging`, `rises` and `rests` when given (each a non-empty list of part names, each once; no part both in `not_swinging` and in `rises` or `rests`), and `may_fold` when given (a non-empty list of `{ "slot", "animation", "why" }`, every one a non-blank string, each pair once; issue #320). `note`, `*_note` (strings) and `x-…` (any value) are read by nothing, as in the config | write the field; the bar is yours |
|
|
3865
3978
|
| <a id="REQUIREMENTS_RESOLVES"></a>`REQUIREMENTS_RESOLVES` | a bone, an `ik` or `transform` constraint (by name and `constraint_type`, as rig-c resolves it), a slot, a mesh attachment or an animation the file names is not in `rig.json` or `motion.json`, or a seam's part or a `not_planted`, `not_swinging`, `rises` or `rests` name is not in `parts.json` — the detail lists the ones that are; or an animation whose name cannot be a directory. Refused before anything is built | the name as the rig spells it |
|
package/docs/STABILITY.md
CHANGED
|
@@ -127,7 +127,7 @@ part name, `[i]` an entry of a list):
|
|
|
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
129
|
- **assemble** — required: `rig_scale`, `plan` (from plain `assemble` on); optional: `extend_below_crop`, `patches`, `cuts`, `alternates`, `head_face_underfill`
|
|
130
|
-
- **assemble.alternates[i]** — required: `name`; optional: `source`, `full`, `head`, `parts`, `hides`, `head_box`, `cuts`, `skeleton`, `drawn`, `tips`, `front` (issues #454, #465, #652, #664)
|
|
130
|
+
- **assemble.alternates[i]** — required: `name`; optional: `source`, `full`, `head`, `parts`, `hides`, `head_box`, `cuts`, `skeleton`, `anchor`, `drawn`, `tips`, `front` (issues #454, #465, #543, #652, #664)
|
|
131
131
|
- **assemble.extend_below_crop[i]** — required: `part`, `run`, `tag`
|
|
132
132
|
- **assemble.patches[i]** — required: `name`, `box`, `alpha`, `draw`
|
|
133
133
|
- **assemble.patches[i].draw**, when an object — required: `before`
|
|
@@ -142,7 +142,7 @@ part name, `[i]` an entry of a list):
|
|
|
142
142
|
- **bones[i]**, a chain — required: `chain`, `parent`, `points`, `tip`; optional: `link_inherit`
|
|
143
143
|
- **stops[i]** — required: `chain`, `against`, `at`, `inward`, `outward`; optional: `links`, `lower` (issue #404)
|
|
144
144
|
- **stops[i].lower** — required: `inward`, `outward`
|
|
145
|
-
- **meshes.<part>** — exactly one of `grid`, `contour`, `auto`, `influence`; required in every mode: `segments`, and `r` in every mode but `influence`, which refuses it; optional in every mode: `exponent`, `rule
|
|
145
|
+
- **meshes.<part>** — exactly one of `grid`, `contour`, `auto`, `influence`; required in every mode: `segments`, and `r` in every mode but `influence`, which refuses it; optional in every mode: `exponent`, `rule`, `gather` (issue #680, false only: preserve an exclusive non-segment rider's authored draw position without changing its binding; absent, output bytes unchanged); optional with `contour` or `auto`: `ribs`; optional with `grid` or `contour`: `influences` (issue #284; beside `auto` it is refused, CONFIG_INFLUENCES_MODE); optional with `grid`: `stray` (issue #303; beside `contour` or `auto` it is refused, CONFIG_STRAY_MODE)
|
|
146
146
|
- **meshes.<part>.influence** — required: `cell`, `radius`, `across`, `max`, `shape` (issue #378); optional: `hold_tip` (issue #615, the value true only); beside it `r`, `exponent`, `rule`, `influences`, `stray` and `ribs` are refused by name
|
|
147
147
|
- **meshes.<part>.influences** — optional, at least one: `maxInfluences` (a whole number, 1 or more, or null for no cap), `floor` ("cut" or "continuous")
|
|
148
148
|
- **meshes.<part>.ribs.<chain>** — required: `stations`
|
|
@@ -166,7 +166,7 @@ part name, `[i]` an entry of a list):
|
|
|
166
166
|
- **cloth.<tag>.split** — required: `at`, `into`; optional: `hold_tip`
|
|
167
167
|
- **cloth.<tag>.strength** — required: `trunk`, `branch`, `edge`
|
|
168
168
|
- **cloth.<tag>.swing** — required: `scales`
|
|
169
|
-
- **regions.<part>** — a bone name
|
|
169
|
+
- **regions.<part>** — a bone name, or `{bone, gather?}` with the same required bone name and optional `gather: false` (issue #680); absent, normal gathering and historical bytes are unchanged. An opt-out requires an exclusive non-segment limb rider ([named refusal](AUTHORING.md#RIG_GATHER_RIDER))
|
|
170
170
|
- **motion** — required: `duration`, `tracks`; optional: `blink`, `animations_from`
|
|
171
171
|
- **motion.tracks[i]**, a single track — required: `bone`, `prop`, `amp`, `period`, `phase`; optional: `base`
|
|
172
172
|
- **motion.tracks[i]**, a chain track — required: `chain`, `amps`, `period`, `phase`, `lag`
|
|
@@ -214,6 +214,23 @@ every number) are AUTHORING §3's tables, and the loader refuses any other by na
|
|
|
214
214
|
| the scene report | `compose` | spec `spine-parts-scene-report/1` |
|
|
215
215
|
| `idle.png`, `idle-indexed.png`, `idle.gif` | `loop`, `build --loop` | APNG and GIF encodings of the rendered idle |
|
|
216
216
|
|
|
217
|
+
Skeleton alternate registration accepts an optional `anchor` mapping of one or
|
|
218
|
+
two body-18 keypoints to declared base-bone origins (issue #543). One pair holds
|
|
219
|
+
scale at 1; two determine scale and offset. The registration bars and painting
|
|
220
|
+
pixels are unchanged, and omitting the field retains torso registration.
|
|
221
|
+
|
|
222
|
+
Painting generation metadata includes `upscale: {model, then}` (issue #698),
|
|
223
|
+
read from the same `UPSCALE_MODEL` and `UPSCALE_THEN` constants as the graph.
|
|
224
|
+
This adds provenance; it does not change model selection.
|
|
225
|
+
|
|
226
|
+
Revision ancestry is additive (issue #531): a previous root `remesh.json` or
|
|
227
|
+
`retune.json` is preserved at `provenance/<command>-<sha256>.json`, and optional
|
|
228
|
+
`input.provenance` rows name its source, path, bytes and SHA-256. The chain survives
|
|
229
|
+
same-command and mixed-command revisions without changing their rig splice or
|
|
230
|
+
hold. `revision` rows name actual output bytes, including a new `input-check.json`
|
|
231
|
+
when recorded, and exclude the new root provenance itself. A first revision has
|
|
232
|
+
no parent rows. Hashes and names are deterministic.
|
|
233
|
+
|
|
217
234
|
Files authors write for this package, each with a spec id the reader holds:
|
|
218
235
|
`spine-parts-requirements/1` (`check --requirements`), `spine-parts-scene/1`
|
|
219
236
|
(`compose --scene`), `spine-parts-keypoints/1` (`propose --keypoints`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-parts",
|
|
3
|
-
"version": "1.60.
|
|
3
|
+
"version": "1.60.2",
|
|
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": {
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"bin/rig-parts.cjs",
|
|
41
41
|
"cli.ts",
|
|
42
42
|
"tools/configwrite.ts",
|
|
43
|
+
"tools/build-process.ts",
|
|
44
|
+
"tools/alternate-cli.ts",
|
|
43
45
|
"src",
|
|
44
46
|
"workflows",
|
|
45
47
|
"docs/AUTHORING.md",
|