rig-parts 2.55.0 → 2.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -196
- package/cli.ts +55 -9
- package/docs/AUTHORING.md +221 -25
- package/docs/MIGRATION.md +2 -2
- package/docs/PAINTING.md +1 -1
- package/docs/STABILITY.md +76 -15
- package/package.json +1 -1
- package/src/build.ts +27 -8
- package/src/bustlandmarks.ts +118 -22
- package/src/check.ts +9 -9
- package/src/config.ts +134 -3
- package/src/configrelocation.ts +3 -0
- package/src/depthworkflow.ts +7 -1
- package/src/outputpaths.ts +107 -0
- package/src/rig.ts +56 -5
- package/src/runstamp.ts +176 -19
- package/src/scene.ts +112 -25
- package/src/sceneclips.ts +83 -2
- package/src/scenerepeat.ts +111 -0
- package/src/turn.ts +225 -2
- package/src/turnoverlap.ts +23 -0
package/docs/STABILITY.md
CHANGED
|
@@ -88,8 +88,8 @@ required references are explicit inventory rows. Symlinks and special files
|
|
|
88
88
|
are refused. Inputs are hashed again before atomic publication.
|
|
89
89
|
|
|
90
90
|
Base and alternate `scene.figure_mask` are declared but not consumed, read,
|
|
91
|
-
hashed or bound by this command.
|
|
92
|
-
|
|
91
|
+
hashed or bound by this command. Standalone `assemble` on a scene painting writes
|
|
92
|
+
the figure's mask `figure_rig.png` beside `parts.json` (issue #1177). The plate is outside this
|
|
93
93
|
command's inputs. `painting_in_rig` is written beside `parts.json` in both
|
|
94
94
|
standalone assemble and build layouts and is consumed and hash-checked.
|
|
95
95
|
|
|
@@ -593,7 +593,7 @@ and do not certify visibility. See the
|
|
|
593
593
|
| `propose` | `--head-box` with `--full`, `--canvas`; optional `--no-back-hair`, `--write-config` (existing config, issue #356), `--help` (`-h`) |
|
|
594
594
|
| `propose` | `--parts`, `--source`, `--out`; optional `--compare` or `--from-config` (one of them), `--keypoints`, `--person` and `--wrist-snap` (each with `--keypoints`), `--full`, `--head` (the turn control's depths; not with `--from-config`), `--grid-rule` (`figure` or `part`, the drafted lattice's spacing; not with `--from-config`), `--cloth` (a config whose `cloth` block is the recipe, issue #364; not with `--from-config`), `--write-config` (existing config for an ordinary proposal, issue #356; a new file with `--cloth`, issue #537; not with `--from-config` — additive: without it nothing `propose` writes changes), `--from` (the config the recipe is changed from, only with `--write-config`, issue #571 — additive: without it nothing `--write-config` writes changes), `--only-missing` (only with `--parts` and `--write-config`, not with `--cloth` or `--from-config`, issue #671 — additive: without it nothing `--write-config` writes changes) `--bust-landmarks` (rig-pixel apex_r/apex_l and optional cleavage; a `<file>.provenance.json` beside it is read and checked, and its pending shape needs `--write-config`, issue #1382), or `--no-bust` (non-blank omission reason), one required when drafting a chest-holding torso, both incompatible with `--from-config`; on a sampled body-turn neck config, either with `--write-config` and without `--full` / `--head` writes the chest alone (issue #1436), `--help` (`-h`) |
|
|
595
595
|
| `propose` | `--parts`, `--source`, `--out`, `--full`, `--head`, `--write-config` together: the [neck draft](AUTHORING.md#a-neck-that-moves-on-its-own) for an existing config with `turn.body` and one neck plan row; reassembles under `<out>/rig`, preserves the sampled turn and drafts a rigid neck unit (issue #826) |
|
|
596
|
-
| `bust-landmarks` | `--from-act`, `--parts`, `--config`, `--out`; optional `--write-config` (takes the act's `alpha`, `clearance`, `spacing`, `bone_r` and `bone_l` into the config's existing `meshes.<part>.contour.bust` when the act's three points are the declared ones, a field the act omits removed; the config is untouched when none differs, and when the act moves the points, whose shape is then pending in the record (issue #1443) — additive: without it nothing the command writes changes), `--help` (`-h`) (issue #1382; one `rig-review/act@9` chest row to the landmarks file `propose` reads, with `<out>.provenance.json` beside it) |
|
|
596
|
+
| `bust-landmarks` | `--from-act`, `--parts`, `--config`, `--out`; optional `--write-config` (takes the act's `alpha`, `clearance`, `spacing`, `bone_r` and `bone_l` into the config's existing `meshes.<part>.contour.bust` when the act's three points are the declared ones, a field the act omits removed; the config is untouched when none differs, and when the act moves the points, whose shape is then pending in the record (issue #1443) — additive: without it nothing the command writes changes), `--help` (`-h`) (issue #1382; one `rig-review/act@9` chest row, or the one row of a `rig-review/act@10` chest-landmarks carrier (issue #1539), to the landmarks file `propose` reads, with `<out>.provenance.json` beside it) |
|
|
597
597
|
| `compare` | `--left`, `--right`; optional `--map`, `--help` (`-h`) |
|
|
598
598
|
| `rig` | `--config`, `--parts`, `--out`; optional `--idle-keys` (ctl, direct), `--page-edges` (pot, free), `--pack-shape` (rect, polygon), `--page-size`, `--help` (`-h`) |
|
|
599
599
|
| `check-parts` | `--parts`, `--out`; optional `--json`, `--help` (`-h`) |
|
|
@@ -643,8 +643,11 @@ derives a missing cleavage from the config's own `neck` and `hip` bones, and
|
|
|
643
643
|
says which source the cleavage came from. A carrier that is not a contour mesh
|
|
644
644
|
is refused by name, `PROPOSE_BUST_CARRIER_MESH`; the chest flags with `--full` or
|
|
645
645
|
`--head` stay `PROPOSE_NECK_MODE`. The row digest rule (the sha256 of the row's `edit` with object keys sorted recursively, recomputed and refused on a mismatch) is a copy of review's request digest. The act's grammar is review's. This package reads
|
|
646
|
-
`rig-review/act@9
|
|
647
|
-
|
|
646
|
+
`rig-review/act@9`, and from issue #1539 the `chest-landmarks` carrier of a
|
|
647
|
+
`rig-review/act@10` comment-only act, and refuses another act version by name
|
|
648
|
+
until a later minor version reads it. A record written from an act@10 carries
|
|
649
|
+
`act.carrier_file` under the same spec `rig-parts-bust-landmarks-provenance/1`;
|
|
650
|
+
a record from an act@9 is byte-unchanged.
|
|
648
651
|
|
|
649
652
|
The [command reference](AUTHORING.md#command-reference) describes each mode;
|
|
650
653
|
[writing proposed config fields](AUTHORING.md#writing-proposed-config-fields)
|
|
@@ -752,7 +755,7 @@ part name, `[i]` an entry of a list):
|
|
|
752
755
|
- **meshes.<part>.influences** — optional, at least one: `maxInfluences` (a whole number, 1 or more, or null for no cap), `floor` ("cut" or "continuous")
|
|
753
756
|
- **meshes.<part>.ribs.<chain>** — required: `stations`
|
|
754
757
|
- **meshes.<part>.contour** — required: `tolerance`, `margin`, `spacing`; optional: `maxEdge`, `budget`, `stray`, `bridges`, `regions`, `bust`
|
|
755
|
-
- **meshes.<part>.contour.regions[i]** — required: `name`, `shape`, `bone`, `spacing`, `band`, and `cx`, `cy`, `r` for a circle or `points` for a polygon
|
|
758
|
+
- **meshes.<part>.contour.regions[i]** — required: `name`, `shape`, `bone`, `spacing`, `band`, and `cx`, `cy`, `r` for a circle or `points` for a polygon; optional: `cover`
|
|
756
759
|
- **meshes.<part>.contour.bust** — required: `apex_r`, `apex_l`, `cleavage`; optional: `alpha`, `clearance`, `bone_r`, `bone_l`, `spacing` (issue #475)
|
|
757
760
|
- **meshes.<part>.auto** — required: `source`, `sourceBounds`, `targets`, `influences`, `budget`, `minArtSamples`, `motion`; optional: `protect`, `regions`, the three Stage B opt-ins `boundaryRuns`, `retriangulate`, `removalOrder`, and `stimulus`
|
|
758
761
|
- **meshes.<part>.auto.source** — required: `tolerance`, `margin`, `spacing`; optional: `stray`
|
|
@@ -1171,7 +1174,7 @@ execution in historical evidence is inferred from a current export.
|
|
|
1171
1174
|
| `parts.json`, `parts/<name>.png` | `assemble`, `build` | one record per part: `from` (`<run>:<tag>` with a See-through v3 tag, `<run>:author:<label>` for a layer the author made — issue #256, read by no role rule — or `painting:<name>` for a patch), `cut_from` on a cut's piece only (the plan part it was cut from, issue #230), `limb` on a limb segment's part only (issue #349: `name`, `segment`, `of`, `bone`, and below a joint `joint`, `range` when the config segment declares one (issue #360), and `cap` — `at`, `width`, `radius`, `box`, `layer_px`, `image_px` with a cap image, `image_layer` after it when that image was a hidden-art layer — issue #359, `<run>:<layer>:hidden` — `missing_px`, `short_px` (`left`, `right`) after it only when `missing_px` is above 0 (issue #557, additive), `excluded_px` after them only on a subset set's limb part whose cap the set exclusion took a pixel of (issue #603, additive: each pixel taken out of the count it was in, so the cap's counts are the written PNG's), then `shape` and `upper_px` under the segment's `cap_shape` — `upper_px` without the shape only when the upper segment gave a pixel (issue #557, additive) — and after them `lower_px`, `lower_kept_px` and `lower_missing_px` under `cap_shape: "ball"` (issue #579, additive), and `edge`, `feather_radius` and `feathered_px` under its `edge`, and `cut_band`, `cut_offset`, `cut_at`, `cut_crossed`, `joint_crossed`, `band_px` and `stroke_luma_max` (when the band has a split) under its `cut_band`, issue #360), the box `x`, `y`, `w`, `h` (rig px), the pixel counts `src/parts.ts` documents (`opaque_px`, `visible_px`, `occluded_px`, `projected_core_px`, `source_px_taken`, `visible_not_projected_px`, `refused_drift_px`, `merged_px` — on a subset set's limb part counted after the set exclusion, issue #603 — `seam_override_px`, and `fringe_pushed_back` when not empty); per-part `taken_layers` (with optional `transport`, issue #973, and optional `split` — `occluder`, `image`, `sha256`, `covered_px`, `visible_px` — on a split take, additive, issue #1242) and `provenance` (`unchanged_layer_px`, `hand_px`, `automatic_px`, `edits`, `automatic`, additive, issue #823); optional top-level [`assembly_config`](#assembly-config-reading), `motion_seams`, `occluder_plates` (one record per `assemble.occluders` entry declaring `plate` — `receipt`, `receipt_sha256`, `occluder_sha256`, `painting_sha256`, `output_sha256`, `mask_sha256`, additive, issue #1237), `occluder_grow` (one record per `assemble.occluders` entry with `grow > 0` — `occluder`, `image`, `grow`, `covered_px_before`, `covered_px_after`, additive, issue #1251), `occluder_guard` (one record per `assemble.occluders` entry with `guard > 0` — `occluder`, `image`, `guard`, `guarded_px_before`, `guarded_px_after`, additive, issue #1259), `alternates` and `cut_ownership` (one row per cut, independent of RGBA equality, issue #823, with optional `under_plate` — `receipt`, `receipt_sha256`, `occluder_sha256`, `painting_sha256`, `output_sha256`, `mask_sha256` — on a `{plate}` under, additive, issue #1230); `rig_size`, `scale_rig_per_source`, `ghost_px`, `recomposite`, and `scene` (`figure_alpha_above`, `figure_px`, `figure_mask`) under `config.scene` only, with the figure's mask `figure_rig.png` beside the recomposite (issue #242), and the same bytes beside `parts.json` when the two directories differ (issue #1177); `single_run_pad` (`file_size`, `side`, `left`, `top`) last, only for one run whose file is not the `seethrough.resolution` square (issue #366) |
|
|
1172
1175
|
| `rig/rig.json`, `rig/motion.json`, `rig/images/` | `rig`, `build`, `compose` | rig-c's rig spec and motion spec, `spec` `rigc-rig/1` and `rigc-motion/1`: the format is rig-c's, and this package writes only what rig-c's parser accepts; a bone carries `inherit` only where config.bones declares one, rig-c's mode name as written (issue #348) |
|
|
1173
1176
|
| `rig/mesh_report.json` | `rig`, `build` | one row per mesh: `part`, `vertices`, `triangles`, `hull`, `bones` (the sorted names the attachment's weights bind in the written `rig.json`, in every mode — since 1.49.1 (issue #536) a rig with `turn` or `stops` names the twins and `<link>_d` bones there, where the row named the segment bones they replace: a fix of a wrong name, not a format change; a rig with neither writes the bytes it wrote), `max_influences`, `mean_influences`, `art_coverage`, then `grid` (a lattice); or `mode` "explicit" with `image_sha256` and `region_sha256` (the verified guards; counts and coverage are measured from the supplied mesh, no legacy generator report is adopted); `mode` "contour" with `params`, `contour`, `regions` (`params.maxEdge` and `contour.outlineCut` only when the mesh declares `contour.maxEdge`; `params.bridges` and `contour.bridges` — `islands`, `units`, `joins`, and `faint` only when an island was left out as faint — only when it declares `contour.bridges`); or `mode` "influence" with `influence` (as declared), `reach` (`farthest`, `at`, `nearest`, `capped`, `widest`) and `lattice` (rig-c's `SegmentsLatticeReport`: `cols`, `rows`, `artCells`, `keptCells`, `passes`, `islands`) (issue #378); or `mode` "auto" with `settings`, `source`, `result`, `residuals`, `worst_residual`, `worst_region`, `motion_amplitude`, `termination`, `weights`, `regions`, `deformation`, `quality_report` (rig-c's `mesh-quality-report/1` document whole), `motion_report`, and, only when they apply, `stray_cleared` (after `source`, when `source.stray` is declared), `skinning_residual` and `replay` (`AutoMeshReport` in `src/rig.ts`); in every mode, `exponent` when the mesh declares one (after `grid`, or after `mode`); `influences`, as declared, when a lattice or contour mesh declares it (after `exponent`, or where `exponent` would be); `stray` and `stray_cleared` when a lattice mesh declares `stray` (after `influences`, or where `influences` would be); `ribs` when a contour or auto mesh declares them (after `exponent`, or after `mode`), and then `contour.ribs` (`source.contour.ribs` in the automatic mode) |
|
|
1174
|
-
| `check/check.json` and the rest of `check/` | `check`, `build`, `compose` | [Check verdict spec](#check-report-rig-parts-check1) followed by the reference's fields in its order (`gate_spine_html_green`, `rigc_entry`, `pack_mode` (with `page_size` under `--page-size` only, issue #1273, additive), `environment` after it under `--environment` only (
|
|
1177
|
+
| `check/check.json` and the rest of `check/` | `check`, `build`, `compose` | [Check verdict spec](#check-report-rig-parts-check1) followed by the reference's fields in its order (`gate_spine_html_green`, `rigc_entry`, `pack_mode` (with `page_size` under `--page-size` only, issue #1273, additive), `environment` after it under `--environment` only (issues #538, #1554, additive: `path` relative to `check`'s `--out`, `sha256`, `steps`), `loop_max_diff`, the seam figures — `seam_mean`, `seam_px_over_40`, `seam_px_over_80` and, from issue #216, `seam_frame_scale`, the frame scale the bar divides the count by), `loop_physics` after `loop_max_diff` when the rig declares a physics constraint, `seam_border` after the seam figures when `parts.json` declares a scene (issue #242), `seam_pairs` after the seam figures when the seam bar fails or `--seam-pairs` asks (each row's picture under `check/seam/`; `--keep-stills` leaves the setup-pose still and its `frames.json` under `check/setup_still/`), then the judgement lines (`BREATH_VISIBLE`, `BLINK_NO_HOLE`, `CHAIN_LAG`, `TIP_OVER_ROOT`, `STILL_REGIONS_DARK`, `TEXTURE_STRETCH`), `ANIMATIONS_DO_NOT_FOLD` after them when `motion.json` holds an animation, the idle included — on every rig with an idle since issue #333 (issues #320, #363: `status`, `animations`, `fps`, `physics_left_out`, `folding` — each `animation`, `slot`, `attachment`, `frames`, `worst_frame`, `worst_triangles`, `triangles`, `physics_on`, `physics_off`, `physics_constraints`, `declared`, `line` — `folding_undeclared`, `declared_not_folding`, `bar`), `FEET_STAY_LEVEL` after it when a `footwear` part rides a bone that hangs from another and `motion.json` holds an animation (issue #348: `status`, `reason` on a SKIP only, `animations`, `fps`, `physics_left_out`, `bar_degrees`, `bar`, `feet` — each `part`, `bone`, `hangs_from`, `status`, `frames_posed`, `worst`), `LIMB_ONE_BONE` after it (and after `STRESS_OFF_CHAIN` where that is written) when `parts.json` holds a limb segment's part (issue #349: `status`, `parts` — each `part`, `limb`, `bone`, `status`, `others`), `SEAM_OVER_RANGE` after it when a limb record carries a `range` (issue #360: `status`, `frame_scale`, `physics_left_out`, `bar` — `mean`, `rig_px_over_40`, `level` — and `joints`, each `part`, `limb`, `segment`, `joint`, `bone`, `range`, `at`, `radius`, `under_px`, `status`, `poses` — each `degrees`, `status`, `mean`, `px_over_40`, `px_over_80`, `rig_px_over_40`, and `step_px` (`left`, `right`) only on a joint whose cap record carries `short_px` (issue #557, additive) — and `unread` on a joint not read), `SEAM_OVER_MOTION` after it when `parts.json` holds a limb segment or `--requirements` a `seam` (issue #493 retains existing pair warnings; issue #686 gates proven body-root pairs only, on gapOpen plus UNDER-owned ghost: `status` — `WARN`, `CLEAR`, `SKIP` or `FAIL` — `reason` on a SKIP only, `fps`, `floor`, `pairs` — each `pair`, `a`, `b`, `declared`, optional `root` (`limb`, `bone`, `parent`) on a proven body-root pair, and `unread` on a pair not read — `animations`, `warnings`, `rows` — each `pair`, `animation`, `status`, `drawn`, `banded`, `opens`, `px`, `max_px`, `under_floor`, and only on new-root rows stock `gapOpen` plus UNDER-owned `ghostA`/`ghostB` cells selected by resolved per-frame draw order gate their summed count against the unchanged strict one-cell floor on the original raw kind boxes (their union when both kinds contribute), never narrowed partition boxes, while `gapCovered` and OVER-owned ghost cells are excluded (issue #711); `cells` retains partition counts, UNDER owner and counted total, `worst` retains frame/count/cell/box, and `roots` retains status, mode `gap-open+under-ghost`, ghost_owner `resolved-draw-order`, pairs, failed, reason and optional unmeasured bindings; eligible candidates whose valid setup bands are all zero retain a named unmeasured root and SKIP bar, including when no pair is selected; measured root FAIL wins over SKIP, while measured PASS plus an unmeasured root remains SKIP; every eligible body drawing with stock setup `banded > 0` is selected, including both when a parent is shared; issue #708 resolves a body slot on its exact generated turn child to the same named carrier only after unique identity-bone/control/per-part-transform proof, without changing pair identity, setup selection or the direct-carrier path; setup-only observation preserves the authored motion and default drawing, root-free inputs add no setup compile/render, and no animation remains SKIP rather than a measured zero; existing internal pair warnings and their exits are unchanged; issue #941 adds optional `required` only under the requirements file's `seam_over_motion.required: true` — `status` (`PASS` or `FAIL`), `mode` `gap-open`, `bar_px` 0, `pairs` (each `pair`, `class` — `body-root`, `internal-joint` or `explicit` — `frames`, `background_frames`, `max_px`) and `failed` — and with it the key is written even when no pair is declared; issue #591 adds optional `worlds` on physics rigs with readable declared pairs and animations: `default` and `still`, each `wind`, `gravity`, `status` (`REPORTED` or `SKIP`), `reason` on SKIP, `dir` only when rendered (relative to check.json: `seam_motion/default` or `seam_motion/still`, the complete retained render with frames.json and each animation's raw seam.json), and `rows` — pair, animation, status, drawn, banded, `gap` and `ghost`, each `max_px` and `worst` only; worst carries `index`, `px`, `cell`, `box`. Per-frame hits stay in the raw sidecars. These raw reference readings add no bar or warning and leave the custom environment reading unchanged), `CLOTH_SETTLES` after it when the rig declares a physics constraint and has an idle (issue #501, a warning and not a bar: `status` — `WARN` or `CLEAR` — `fps`, `frames`, `duration`, `floor_rig_px_per_s`, `floor`, `levers`, `warnings`, `rows` — each `tip`, `root`, `links`, `point`, `settles_at`, `max_rig_px_per_s`, `min_rig_px_per_s`), `PHYSICS_CONTRIBUTES` after it when the rig declares a physics constraint and has an idle and parts (issue #1320, report-only, no bar and no threshold: `status` — `WARN` when a part under physics reads exactly 0, else `CLEAR`; a named `SKIP` writes no key — `off` (what "physics off" means: the same compiled build posed with the poser's physics off, not the spec with its constraints left out), `points`, `world`, `poser`, `fps`, `frames`, `warnings`, `rows` — each `part`, `constraints`, `external_force`, then `vertices`, `frames_read`, `max_rig_px`, `p95_rig_px`, `mean_rig_px`, `max_of_diagonal`, `moves`, or `unmeasured` with its reason), `RECOMPOSITE_HOLES` (its first figure `declared_scene` when `parts.json` declares a scene), `SETUP_POSE_VS_SOURCE`, `WIND_BAND` after it under `--wind-band` only (issues #590, #1554, additive: `status` `"REPORTED"`, `spec` `"rig-parts-wind-band/1"`, `path` relative to `check`'s `--out`, `sha256`, `steady_wind_only` `true`, `gravity` `[0, 1]`, `min`, `max`, `step`, `steps`, `fps`, `animations`, `max_gap`, `max_ghost`, `holds_from`, `holds_to`, `pairs_holding_all`, and `pairs` — each `pair`, `a`, `b`, `holds_all`, `holds_from`, `holds_to`, `first_break_below`, `first_break_above`, `worst_gap`, `worst_ghost`, `steps`), `skipped`, `config` under `build` only (issue #607, additive: `path` as `--config` was typed, `sha256` of the bytes the build read; `check` and `compose` read no config and write none), a `requirements` block under `--requirements` (or `build`'s `config.requirements`) — `file` first from issues #556 and #1554, additive: `path` relative to `check`'s `--out`, `sha256`, `keys` — and `PASS`; `check/build/skeleton.json`, `.atlas` and `.png` are the packed artifact rig-c writes, and `check/build-report.json` (`<out>/build-report.json` under standalone `check`) is rig-c's own `build-report/1` (`--report`) for that primary packed compile, written verbatim by `rigc` beside `check/build/` (and listed in `check/build/run.json`'s `outputs[]` as `../build-report.json`) on a failing compile as on a green one (issue #1394; `rig` keeps no compile report because its gate and `--lead-in` compiles are throwaway scratch runs whose outputs are deleted). Missing stock partitions or resolved owner are named refusals, never zero. No whole-box exemption or consumer compositor remains; internal warnings and reference raw readings are unchanged. |
|
|
1175
1178
|
| `part_support_domains.json` | `assemble`, `build` | optional `rig-parts-support-domains/1` independent cut masks and unavailable reasons, with per-domain config-entry provenance and parts/PNG/payload digests; additive beside parts.json, whose bytes and PNGs are unchanged. Legacy output may omit it. `PART_SUPPORT_REPORT` reads pairs in the assembly placement frame and Unowned in actual setup, never as an acceptance gate. |
|
|
1176
1179
|
| `layers.json`, `<index>_<name>.png` | `layers --export` | the wrapper form `layers` reads (issue #359): `width`, `height`, then `layers` — each `name`, `filename`, `left`, `top`, `right`, `bottom`, `depth_median` (the input's own; `null` for a PSD, the manifest's order then being the draw order) — drawn layers in draw order, then the hidden-art layers; a PNG's name is its index and its layer's name, and the manifest, not the file name, says which layer it is |
|
|
1177
1180
|
| the template `.psd` | `layers --template` | one empty layer per name `templateLayerNames` (`src/layers.ts`) holds, bottom first; the same canvas writes the same bytes |
|
|
@@ -1185,14 +1188,14 @@ execution in historical evidence is inferred from a current export.
|
|
|
1185
1188
|
| `input-check.json` | `remesh --record-input-check`, `retune --record-input-check` | spec `rig-parts-input-check/1` (issue #617, additive): `versions` (`parts`, `rigc` — `rigc --version`'s whole output), `options` (`page_edges`, `pack_shape`, `page_size` when `--page-size` is given, `requirements` — null, or `path` as resolved and `sha256`), `rig` and `parts` (`dir` as resolved, `files` — `path`, `bytes`, `sha256` per file: every file under `--rig`; `parts.json` and every file under `parts/`), `check` (the input's check side as `remesh.json` carries it); `--input-check` reads it back, and either command's serves the other |
|
|
1186
1189
|
| composed turn producer inputs | `compose` | issue #1344 intentionally admits previously refused yaw/pitch derive maps, turn deform offsets/transforms, depth-grid generator images, bone inherit modes and producer mesh/fold invariants; every embedded reference is resolved and prefixed except the shared default skin. Mesh-slot ceilings sum and per-mesh triangle ceilings take the maximum, using actual counts only for unbudgeted members. Weighted lengths scale; image-sized depth grids at scale other than 1 are refused by `SCENE_SCALE_EXACT`. Other nested constructs remain refused. Previously passing scene payloads are byte-identical; the existing `check/check.json` requirement is retained, so `rig` plus `rigc build` alone is not a checked character. |
|
|
1187
1190
|
| named scene plates | `compose` | issue #1345 adds optional `plates[]`: required `name`, `image`, `provenance`, `at: [x, y]`; optional `note`, `editor_receipts`, `opaque_backdrop`. `at` is two finite integers for the image top-left in canvas pixels, y down from the top-left origin; negatives/outside allowed, no scale, native image size including oversize. Each bone/slot/attachment uses its declared name, bone under root at `(0,0)`; attachment centre is `stage.x + at[0] + width/2`, `cropToSpineY(at[1] + height/2, canvas.height)`. Each layer's token is required exactly once in draw order, with duplicate/missing/unknown/collision refusals. Names cannot collide with root, legacy plate, shared idle, character ids or prefixed bones/slots/animations; a plate name already refused by `SCENE_PLATE_NAME_FREE` or `SCENE_PLATE_NAME_UNIQUE` does not also draw a cascaded `SCENE_ORDER_COMPLETE` (issue #1350). Only that layer's explicit `opaque_backdrop: true` exempts it from compose alpha checks; an opaque declared backdrop must additionally meet width >= canvas.width AND height >= canvas.height (the rig stage), matching core 3.8.0 A19 size inference; otherwise SCENE_PLATE_BACKDROP_SIZE refuses before emission (placement coverage of the stage is the scene author's, not checked by the tool). Transparent layers have no size floor. rigc A19 remains enabled. Named images use `scene-plate.<index>.png` (atlas region `scene-plate.<index>`, by declaration index) with collision checks. The `[compose]` header line names composed `plates[]` in declaration order (`<N> named plate(s): <name>, ...`) when `plates[]` is non-empty and prints `no plate` only when neither `plate` nor `plates[]` is present (issue #1350). The additive report `plates` array records declaration, native size and PNG hash; absent declaration retains legacy output bytes and fixed first-plate behavior. |
|
|
1188
|
-
| scene named animations | `compose` | issue #1346 adds optional `scene.animations`, a name-to-rigc-MotionAnimation map resolved against final scene bones/groups/easings. New names add clips at their own declared durations; `idle` appends timelines while retaining existing character tracks, deforms, metadata and physics.
|
|
1191
|
+
| scene named animations | `compose` | issue #1346 adds optional `scene.animations`, a name-to-rigc-MotionAnimation map resolved against final scene bones/groups/easings. A scene-authored key on `root` moves the whole scene, including plates and characters. Imported character animations, including `idle`, are refused with `SCENE_ROOT_SHARED` if they key `root` directly or through a group. New names add clips at their own declared durations; `idle` appends timelines while retaining existing character tracks, deforms, metadata and physics. Without `idle_repeats`, idle duration mismatch is `SCENE_DURATION_AGREES`. Issue #1511 adds `characters[].idle_repeats`, a safe integer of at least two requiring an explicit scene idle. Its declared duration equals each source period times its count exactly, with an omitted count playing once. Each repeated source must close at its non-wrapping stored end. Character keys and absolute Bezier time handles repeat on the source clock, with one equivalent key at a shared endpoint and continuous physics across it. Scene timelines append once, prefixed side clips keep their durations, and the gated composed idle also closes at its stored end. `scene.json` retains each source `idle_duration`, adds `idle_repeats` only on opted-in rows, and gives the scene period as top-level `idle_duration`. `compose-run.json` keeps its schema. Imported non-idle names remain reserved. Core owns missing fields, unknown bones/references, duplicate property tracks and bad times. Unknown prefixed bones also name the character ID. Generated names `<id>:yaw_dial`, `<id>:pitch_dial`, and `<id>:<turn.body.slider>` (default `<id>:body_yaw_dial`) are stable; renaming them requires a major version. A dial exists only when generated by its character. Rotation keys use that slider's declared `[from, max]` bounds; out-of-range values are `SCENE_DIAL_KEY_RANGE`, unreadable bounds `SCENE_DIAL_RANGE_DECLARED`, never guessed. Slider-input keys require explicit numeric values; derive inputs are refused as `SCENE_DIAL_KEY_DECLARED`, including derive alongside a raw value. Bounds apply to the matching scalar or paired translate/scale/shear input channel; inherited group names are refused with `CE_COMPILE_ANIMATION_GROUP_UNKNOWN`. Each declared clip's gated posed endpoints at 0 and duration must agree before emission (`SCENE_ANIMATION_LOOP_CLOSES`), with physics simulation left out only for observation. Absent declaration retains stable output bytes at the same paths. Core `check/build/run.json` records fresh `started_at` and `finished_at` clocks; comparisons report these raw differences separately and require all other receipt fields and output bytes to match. |
|
|
1189
1192
|
| scene loop refusal detail | `compose` | Issue #1358 enriches `SCENE_ANIMATION_LOOP_CLOSES` with the first differing bone or slot, channel, start/end values and numeric tolerance 0 (exact equality). The existing exact JSON endpoint comparison is unchanged: bones, slots, draw order, drawn geometry, clipping polygons and clipped geometry remain covered. Selection follows that family order, then producer row and field order; geometry-only differences name the slot and geometry channel. Physics is still excluded only from observation. The refusal code, acceptance, emitted rig/motion and built scene bytes are unchanged. |
|
|
1190
1193
|
| scene canvas framing | `compose` | Issue #1491 adds optional `characters[].canvas_clip` to `spine-parts-scene/1`. Literal `true` requires finite placed bounds, overflow past a canvas edge and an intersection with positive width and height. The respective refusals are `SCENE_CHARACTER_CLIP_BOUNDS`, `SCENE_CHARACTER_CLIP_UNUSED` and `SCENE_CHARACTER_CLIP_EMPTY`. Other explicit values are `SCENE_FIELD_TYPE`. Omitting the key retains the exact containment rule, output bytes and console text. The opted-in character row in `scene.json` adds `canvas_clip: true` and `clipped_bounds` after the original `bounds`. Both boxes are canvas pixels, y down, with exclusive right and bottom edges. The console appends the clipped box only for those rows. The rig-c gate and packed build retain the full art and geometry. For a scene with any opt-in, compose check renders use the stage viewport unless the render specifies its own. Preview size caps and sampling stay in effect. Native-size renders and consumer playback use the authored stage rectangle as described in [Canvas framing for intentional overflow](AUTHORING.md#canvas-framing-for-intentional-overflow-issue-1491). |
|
|
1191
|
-
| scene placement pivot | `compose` | Issue #1498 adds optional literal `true` at `characters[].placement_pivot` in `spine-parts-scene/1`. It emits the identity `<id>:placement` under `root` and requires a scene-authored `translate`, `translatex` or `translatey` key in final scene pixels. The existing placement math stays on the original first-level bones, root regions and root weights. Source root bindings use the unkeyed identity `<id>:root` child when needed. `SCENE_FIELD_TYPE` refuses other explicit values, `SCENE_PIVOT_NAME_FREE` a source bone collision, `SCENE_PIVOT_UNUSED` an unused declaration and `SCENE_PIVOT_TRACK` a forbidden property or carrier key. `SCENE_PLATE_NAME_FREE` still governs named plate collisions. Core's unknown-bone refusal, rig gate, scene clip timing and endpoint closure still apply. `scene.json` adds `placement_pivot` with the generated name after the bounds fields and counts the generated bones for that character. `compose-run.json` binds the declaration through `scene.sha256` with its existing shape and key order. Omitting the declaration preserves default output bytes at the same paths, subject to the existing Core receipt clocks. |
|
|
1194
|
+
| scene placement pivot | `compose` | Issue #1498 adds optional literal `true` at `characters[].placement_pivot` in `spine-parts-scene/1`. It emits the identity `<id>:placement` under `root` and requires a scene-authored `translate`, `translatex` or `translatey` key in final scene pixels. The existing placement math stays on the original first-level bones, root regions and root weights. Source root bindings use the unkeyed identity `<id>:root` child when needed. `SCENE_FIELD_TYPE` refuses other explicit values, `SCENE_PIVOT_NAME_FREE` a source bone collision, `SCENE_PIVOT_DECLARED` an unresolved pivot targeted directly or through a bone group without an opt-in, `SCENE_PIVOT_UNUSED` an unused declaration and `SCENE_PIVOT_TRACK` a forbidden property or carrier key. `SCENE_PLATE_NAME_FREE` still governs named plate collisions. Core's unknown-bone refusal, rig gate, scene clip timing and endpoint closure still apply. `scene.json` adds `placement_pivot` with the generated name after the bounds fields and counts the generated bones for that character. `compose-run.json` binds the declaration through `scene.sha256` with its existing shape and key order. Omitting the declaration preserves default output bytes at the same paths, subject to the existing Core receipt clocks. |
|
|
1192
1195
|
| `compose-run.json` | `compose` | spec `rig-compose-run/1` (issue #1348), separate from `rig-run/1`; a stable contract as of 2.44.0. Written at the `--out` root only after the gate and check are green and no accepted failing character remains, so an `--accept` preview writes none. Fixed keys in order: `spec`, `scene` (`path`, `sha256`), `characters` (each `id`, `build`, `files`, each file `path`, `sha256`, then optional `placement`), `plate` (`path`, `sha256`, or null), `plates` (each `name`, `path`, `sha256`). Scene and plate paths are the supplied and declared paths; character file paths are build-relative. Characters sort by `id`, files by `path`, named plates by `name`, in code-unit order. Each character's files are exactly `check/check.json`, `parts.json`, `rig/rig.json`, `rig/motion.json` and each distinct image the default skin names under `rig/images/`, including a generator's depth image. Every `sha256` is of the raw file bytes compose consumed before the gate. Only a character with `canvas_clip: true` has `placement`, with `canvas_clip: true`, `bounds` and `clipped_bounds` in that order from the scene report. There are no clocks, directory extras, requirements or CLI-option inventory, so identical inputs at identical supplied paths give identical record bytes. Compose owns the name: a file of that name at the `--out` root is deleted at the start of every compose, before stage validation, so a refused rerun leaves none. For scenes without opt-in, legacy outputs retain stable bytes, with the existing nested Core receipt clock comparison described above. |
|
|
1193
1196
|
| the scene report | `compose` | spec `spine-parts-scene-report/1`; the plate block carries `sha256` of the plate PNG's bytes after `size` (issue #1183, additive under *What "stable" means here*: a new report key in a minor version, so the spec stays `/1`); `pack_mode` records `page_size` only when `--page-size <px>` is given (issue #1352, additive; without `--page-size`, rigc's default 2048 px page and padding 2 on each side bound any plate or region side to at most 2044 px before `CE_ATLAS_REGION_EXCEEDS_PAGE`) |
|
|
1194
1197
|
| `idle.png`, `idle-indexed.png`, `idle.gif` | `loop`, `build --loop` | APNG and GIF encodings of the rendered idle |
|
|
1195
|
-
| `run.json` | `rig`, `assemble` | spec `rig-run/1` (issue #1165, additive): `spec`, `package` (`name`, `version`), `command` (`"rig"` or `"assemble"`), `started_at` and `finished_at` (UTC ISO-8601 millisecond timestamps ending in `Z`, read in the CLI layer), `config` (`path` relative to `--out`, `sha256` of the config file on disk), `inputs` on `assemble` (
|
|
1198
|
+
| `run.json` | `rig`, `assemble` | spec `rig-run/1` (issue #1165, additive): `spec`, `package` (`name`, `version`), `command` (`"rig"` or `"assemble"`), `started_at` and `finished_at` (UTC ISO-8601 millisecond timestamps ending in `Z`, read in the CLI layer), `config` (`path` relative to `--out`, `sha256` of the config file on disk), `inputs` on `assemble` (issues #1316, #1554, additive: one `{role, path, sha256}` entry for each of `--source`, `--full` and `--head` that was given, in that order, with `path` relative to `--out` by the per-platform link rule — naming `<dir>/layers.json` when given a directory — and `sha256` of the file `path` names), and `outputs` (`path` relative to `--out`, `sha256` of each written output file on disk, sorted by `path` in code-unit order and excluding `run.json` itself); written only after the command's gate is green |
|
|
1196
1199
|
| the difference inventory (`--out`) | `diff-components` | spec `rig-parts-diff-components/1` by default (issue #1005: `stack`, `painting`, `definition`, `error_px`, `uncovered_error_px`, `components` — each `id`, `px`, `box`, `coverage`, `uncovered_px`, `borders` — and `below_floor`, byte-identical to 2.38.1), and spec `rig-parts-diff-components/2` under `--owners` (issue #1291: adds `owners` — each `{part, px}`, the topmost `parts.json` part above `COVERED_ALPHA` per covered pixel, back to front — before `borders` on every component); `--verify` verifies both `/1` and `/2` reports (with `--owners`, `/2` is required), while a `/1`-only reader (`readDiffComponents(text, input, [DIFF_COMPONENTS_SPEC])`) refuses `/2` by name |
|
|
1197
1200
|
| the draft comparison (`--out`) | `diff-drafts` | spec `rig-parts-draft-diff/1` (issue #1369), a stable contract as of 2.45.0: fixed keys in order `spec`, `left` and `right` (each `parts_sha256`, `part_count`, `composite_sha256`), `canvas` (`width`, `height`), `order` (`"same"` or `"changed"`), `parts` (one entry per part name in the union of both sides, sorted by `name` in code-unit order: `name`, `status`, then `left` and `right` on the sides that hold the part, each `sha256`, `box`, `index`, then `pixels_equal` and `pixels` on `changed` only), `composite` and `summary`; no clock and no file paths. The command records no threshold and judges nothing; it exits 0 whenever the report is written. [Draft-to-draft assemble comparison](AUTHORING.md#draft-to-draft-assemble-comparison-issue-1369) defines each field. |
|
|
1198
1201
|
| the external mask receipt (`--out`) | `external-receipt` | spec `rig-parts-external-receipt/1` (issue #1368), a stable contract as of 2.45.0: keys in write order `spec`, `kind` (`"mask"`), `file` and `painting` (each `path` relative to the receipt directory, then `sha256` of the file bytes), `grid` (`width`, `height` of the decoded painting) and `producer` (`tool`, optional `model`, then exactly one of `checkpoint_sha256`, `graph_sha256`, `script_sha256`); UTF-8 JSON, two-space indentation, trailing newline. `--verify` reads it back and writes nothing. The producer is the caller's declaration, not a proof of which tool made the mask. [External mask receipt](AUTHORING.md#external-mask-receipt) defines each field. |
|
|
@@ -1400,9 +1403,9 @@ home path). On `assemble`, `inputs` sits between `config` and `outputs` (issue #
|
|
|
1400
1403
|
additive): one `{ "role", "path", "sha256" }` entry (keys in that order) for each of
|
|
1401
1404
|
`--source`, `--full` and `--head` that was given, in the fixed order `source`, `full`,
|
|
1402
1405
|
`head` (an input not given is absent from the list, never `null` or guessed), with
|
|
1403
|
-
`/`-separated `path` relative to
|
|
1404
|
-
|
|
1405
|
-
`inputs` key. Every `sha256` is computed from the bytes on disk after writing. A refused
|
|
1406
|
+
`/`-separated `path` relative to `--out` by the `rig-run/2` link rule (naming
|
|
1407
|
+
`<dir>/layers.json` when the input is a directory, issue #1554) and `sha256` of the file
|
|
1408
|
+
`path` names on disk; `rig` writes no `inputs` key. Every `sha256` is computed from the bytes on disk after writing. A refused
|
|
1406
1409
|
run writes no `run.json`. By default, `started_at` and `finished_at` record wall-clock
|
|
1407
1410
|
time read in `cli.ts` (`src/` remains pure). With that default, `run.json` is outside
|
|
1408
1411
|
the byte-for-byte
|
|
@@ -1432,6 +1435,64 @@ and writes no stamp. `build` and the in-process stages write no `run.json`.
|
|
|
1432
1435
|
`rig-run/1` is stable: its keys, their order and their meaning do not change within
|
|
1433
1436
|
the spec. A key added, removed or redefined is a new spec version.
|
|
1434
1437
|
|
|
1438
|
+
### Run record (`check-run.json` and `build-run.json`, spec `rig-run/2`)
|
|
1439
|
+
|
|
1440
|
+
`check` writes `<out>/check-run.json` and `build` writes `<out>/build-run.json`
|
|
1441
|
+
(issue #1541) whenever the run completed its check report, green or not. The names
|
|
1442
|
+
cannot be a `run.json`: `rig` and `assemble` write `rig-run/1` as `run.json`, and
|
|
1443
|
+
rigc writes its own `run.json` in a packed build directory (`check/build/`). Neither
|
|
1444
|
+
file is in `check.json`, and no byte comparison this package makes reads them.
|
|
1445
|
+
|
|
1446
|
+
```json
|
|
1447
|
+
{
|
|
1448
|
+
"spec": "rig-run/2",
|
|
1449
|
+
"package": { "name": "@rig-c/parts", "version": "<package.json version>" },
|
|
1450
|
+
"command": "build",
|
|
1451
|
+
"started_at": "2026-11-25T00:00:00.000Z",
|
|
1452
|
+
"finished_at": "2026-11-25T00:00:01.000Z",
|
|
1453
|
+
"config": { "path": "../config.json", "sha256": "<hex>" },
|
|
1454
|
+
"outputs": [
|
|
1455
|
+
{ "path": "check/check.json", "sha256": "<hex>" }
|
|
1456
|
+
],
|
|
1457
|
+
"argv": ["build", "--config", "../config.json", "--source", "../painting.png", "--full", "../layers/full", "--out", "."]
|
|
1458
|
+
}
|
|
1459
|
+
```
|
|
1460
|
+
|
|
1461
|
+
Key order is fixed as shown: `spec`, `package`, `command`, `started_at`,
|
|
1462
|
+
`finished_at`, `config` (`build` only; `check` reads no config), `outputs`, `argv`.
|
|
1463
|
+
`package` and the two times (`SOURCE_DATE_EPOCH` included) are as in `rig-run/1`.
|
|
1464
|
+
`config` is the config's `sha256` and its path relative to the real `--out`
|
|
1465
|
+
directory, with the config's directory resolved through its links and the file's
|
|
1466
|
+
own name kept: a config given through a link is recorded by the link's name.
|
|
1467
|
+
`outputs` lists every file under the paths the run cleared and wrote —
|
|
1468
|
+
for `check`, the report files its `wrote` line names and the directories it names
|
|
1469
|
+
(`build/`, `idle_frames/`, …); for `build`, the paths it clears before it starts —
|
|
1470
|
+
sorted by `/`-separated `path` in UTF-16 code-unit order, each with the `sha256` of
|
|
1471
|
+
its bytes. A run record is not listed: `run.json` (rigc's carries its own clock) and
|
|
1472
|
+
any `-run.json`. Two runs of the same inputs from the same layout differ only in
|
|
1473
|
+
`started_at` and `finished_at`.
|
|
1474
|
+
|
|
1475
|
+
`argv` is the command to re-run, then the options as given — not the defaults the
|
|
1476
|
+
run used — in the order of the command's flag table (`check --help` lists it):
|
|
1477
|
+
valued flags first, a repeated `--alt` in the order given, then the switches
|
|
1478
|
+
present. Every path is written relative to the `--out` directory with `/`
|
|
1479
|
+
separators: both taken from the working directory, the `--out` directory and the
|
|
1480
|
+
path's directory resolved through their links, and the path's own name kept (a path
|
|
1481
|
+
given through a link is written by the link's name, as `config.path` is);
|
|
1482
|
+
`--out` itself is `.`; a path that cannot be written that way (another Windows drive)
|
|
1483
|
+
is written as given. These arguments reproduce the check with the same package
|
|
1484
|
+
version, run from the --out directory. When `--out` was given through a link, the
|
|
1485
|
+
replay's `build/skeleton.json`, `build/skeleton.model.json` and `check.json` can
|
|
1486
|
+
differ from the first run's: rigc spells the skeleton's `images` path from the `--out`
|
|
1487
|
+
it is handed without resolving links (rig-c/core#1773). Every other output and key
|
|
1488
|
+
matches. A switch's default is not written, so a later
|
|
1489
|
+
version that changed it would replay differently; that is why the version is in
|
|
1490
|
+
`package`. The record is written after the report, in place, and is never a reason to refuse
|
|
1491
|
+
the check; a run killed while writing it can leave a partial record, and no other
|
|
1492
|
+
file.
|
|
1493
|
+
|
|
1494
|
+
`rig-run/2` is stable on the same terms as `rig-run/1`.
|
|
1495
|
+
|
|
1435
1496
|
## Environment
|
|
1436
1497
|
|
|
1437
1498
|
The installed package reads two environment variables and no other: `PATH`, where
|
|
@@ -1518,14 +1579,14 @@ prepared-reference implementation, packaged locally with `rig-c` metadata versio
|
|
|
1518
1579
|
Its grid-selection replays bind one exact reference and schedule, then compare each
|
|
1519
1580
|
fresh gated candidate.
|
|
1520
1581
|
The number of candidate probes, gated builds and packed-page checks is
|
|
1521
|
-
unchanged; a changed bound or reference input is refused. In one exclusive
|
|
1582
|
+
unchanged; a changed bound or reference input is refused. In one exclusive remote-pool
|
|
1522
1583
|
WSL ABBA invocation, using the same rig-c tarball in both arms and two runs per
|
|
1523
1584
|
arm, the strict switched `bottomwear` input derived from public `reference-demo` took 56.00–56.28 s
|
|
1524
1585
|
with one-shot comparison and 50.55–51.40 s with preparation included; the similarly switched public
|
|
1525
1586
|
`reference-sample` input took 18.96–20.41 s and 16.39–18.71 s respectively.
|
|
1526
1587
|
The paired differences were 4.59–5.74 s and 1.70–2.57 s. These are observed
|
|
1527
1588
|
wall times for those inputs, not an execution limit or a machine-wide idle
|
|
1528
|
-
measurement; load outside the
|
|
1589
|
+
measurement; load outside the remote job pool was not measured. The prior count
|
|
1529
1590
|
bounds remain the termination guarantee.
|
|
1530
1591
|
|
|
1531
1592
|
## Determinism
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-parts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
4
4
|
"description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/src/build.ts
CHANGED
|
@@ -70,6 +70,7 @@ import { setFocusProblems } from './setfocus.ts';
|
|
|
70
70
|
import { createHash } from 'node:crypto';
|
|
71
71
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
72
72
|
import { basename, dirname, join, relative, resolve, sep } from 'node:path';
|
|
73
|
+
import { makeOutDir } from './outputpaths.ts';
|
|
73
74
|
import { type AnimFrame, EncodeError, encodeApng, encodeIndexedApng, INDEXED_DEFAULTS } from './apng.ts';
|
|
74
75
|
import { assemble, type AssembleResult, boxOf, cutLines, edgeSplitLines, ERROR_LIMIT, type ExcludedCount, excludedLines, setExclusions, islandLines, setIslandSources, type IslandCount, hiddenLines, SINGLE_RUN_FACE_TAGS, singleRunHeadBox, softOcclusionLine, driftLine, limbLines, FIGURE_MASK_FILE, figureMaskLines, figuresLine, groundWarning, holeKindsLine, holeLines, measurePinholes, measureRecomposite, pinholeProblems, pinholesLine, type ProjectRule, recomposite, recompositeRecord, scenePhrase, type SeamRule, sourceInRig, projectedStageFields, stageFields, uncoveredLine, underBox } from './assemble.ts';
|
|
75
76
|
import { allocationClause, type Reducer, stageBClause, unboundedClause } from './automesh.ts';
|
|
@@ -1169,10 +1170,10 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
1169
1170
|
|
|
1170
1171
|
// Emit only after green: every refusal above has already thrown.
|
|
1171
1172
|
if (input.resetBuildOutput === true) resetBuildOutput(dirname(outs.partsJson));
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1173
|
+
makeOutDir(outs.partsDir);
|
|
1174
|
+
makeOutDir(dirname(outs.partsJson));
|
|
1175
|
+
makeOutDir(dirname(outs.recomposite));
|
|
1176
|
+
makeOutDir(dirname(outs.errorMap));
|
|
1176
1177
|
const paintingBytes = encodePngBytes(result.paintingInRig);
|
|
1177
1178
|
result.parts.painting_in_rig = { path: PAINTING_IN_RIG_FILE,
|
|
1178
1179
|
sha256: createHash('sha256').update(paintingBytes).digest('hex'), resample: 'lanczos3-rgb-opaque' };
|
|
@@ -2427,6 +2428,19 @@ export function requirementText(name: string, line: RequirementLine): string {
|
|
|
2427
2428
|
return `${name}: ${line.status} — ${[...(line.status === 'NOT MEASURABLE' ? [String(line.reason)] : []), ...rest.map(([k, v]) => `${k} ${showFigure(v)}`)].join('; ')}`;
|
|
2428
2429
|
}
|
|
2429
2430
|
|
|
2431
|
+
/**
|
|
2432
|
+
* What a completed check wrote under its `--out`, as its `wrote` line names it: the report files in the order the
|
|
2433
|
+
* check wrote them, then the directories it wrote whole (`build`, and `idle_frames`, the requirements, seam and
|
|
2434
|
+
* setup-still directories when they were written). The `check-run.json` record lists the files under these.
|
|
2435
|
+
*/
|
|
2436
|
+
export function checkWrote(r: CheckReport, out: string): { written: string[]; dirs: string[] } {
|
|
2437
|
+
return {
|
|
2438
|
+
written: r.written,
|
|
2439
|
+
dirs: ['build', ...(r.idle === null ? [] : ['idle_frames']), ...(r.requirements === null ? [] : [REQUIREMENTS_DIR]),
|
|
2440
|
+
...(r.figures.seam_pairs === undefined ? [] : [SEAM_DIR]), ...(existsSync(join(out, STILL_DIR)) ? [STILL_DIR] : [])],
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2430
2444
|
/**
|
|
2431
2445
|
* Run the check and print its report. Returns the report; `figures.PASS` says
|
|
2432
2446
|
* whether every bar was met, and each one that was not is printed as a FAIL
|
|
@@ -2520,7 +2534,8 @@ export function checkStage(input: CheckStageInput, rigc: RigcRunner, bin: string
|
|
|
2520
2534
|
log(` ${summaryText(r.requirements.summary)}`);
|
|
2521
2535
|
}
|
|
2522
2536
|
log(` gate: rig-play ${fig.gate_spine_html_green ? 'green' : 'RED'} (${fig.rigc_entry.entry}${fig.rigc_entry.spine_core === null ? ', rigc\'s own validator' : `, the spine-core ${fig.rigc_entry.spine_core} round trip`})`);
|
|
2523
|
-
|
|
2537
|
+
const wrote = checkWrote(r, input.out);
|
|
2538
|
+
log(` wrote ${[...wrote.written.map((w) => join(input.out, w)), ...wrote.dirs.map((d) => `${join(input.out, d)}/`)].join(', ')}`);
|
|
2524
2539
|
for (const p of r.problems) log(failLine(p));
|
|
2525
2540
|
log(checkSummaryLine(r));
|
|
2526
2541
|
return r;
|
|
@@ -2937,13 +2952,17 @@ export interface BuildRunners {
|
|
|
2937
2952
|
scratch: string;
|
|
2938
2953
|
}
|
|
2939
2954
|
|
|
2955
|
+
/** The `rig-run/2` record `build` writes beside its outputs (issue #1541); cleared with them, so a refused build leaves none. */
|
|
2956
|
+
export const BUILD_RUN_FILE = 'build-run.json';
|
|
2940
2957
|
/** Every path `build` writes under `--out`, relative — and so every path it clears first. */
|
|
2941
|
-
export const BUILD_OWNS: readonly string[] = ['parts', 'parts.json', SOURCE_COVER_FILE, PAINTING_IN_RIG_FILE, 'recomposite_rig.png', ERROR_MAP_FILE, 'rig', 'check', 'idle.gif', 'idle.png', 'idle-indexed.png'];
|
|
2958
|
+
export const BUILD_OWNS: readonly string[] = ['parts', 'parts.json', SOURCE_COVER_FILE, PAINTING_IN_RIG_FILE, 'recomposite_rig.png', ERROR_MAP_FILE, 'rig', 'check', 'idle.gif', 'idle.png', 'idle-indexed.png', BUILD_RUN_FILE];
|
|
2959
|
+
/** The single files a build may also write at the top of its `--out`, cleared with {@link BUILD_OWNS}. */
|
|
2960
|
+
export const BUILD_OWNS_FILES: readonly string[] = [CUT_MATERIAL_SOURCES, EDGE_RESIDUAL_FILE, SUPPORT_DOMAINS_FILE, FIGURE_MASK_FILE];
|
|
2942
2961
|
|
|
2943
2962
|
function resetBuildOutput(out: string): void {
|
|
2944
|
-
|
|
2963
|
+
makeOutDir(out);
|
|
2945
2964
|
for (const p of BUILD_OWNS) rmSync(join(out, p), { recursive: true, force: true });
|
|
2946
|
-
for (const p of
|
|
2965
|
+
for (const p of BUILD_OWNS_FILES) rmSync(join(out, p), { force: true });
|
|
2947
2966
|
}
|
|
2948
2967
|
|
|
2949
2968
|
/** Only selects when cleanup occurs; the real config loader still decides validity. */
|
package/src/bustlandmarks.ts
CHANGED
|
@@ -19,6 +19,14 @@ import { type PartsFile, readParts } from './parts.ts';
|
|
|
19
19
|
* not imported; its grammar for the act is its own, and this reader refuses by
|
|
20
20
|
* name what it cannot use.
|
|
21
21
|
*
|
|
22
|
+
* Issue #1539: the comment-only act (`rig-review/act@10`, kind `comments`) is read
|
|
23
|
+
* too. Its rows sit in the one `value.carriers[]` entry of kind `chest-landmarks`,
|
|
24
|
+
* whose `chestLandmarks` rows are act@9's rows unchanged and go through the same
|
|
25
|
+
* row reader and checks. That carrier's `file` (`{path, sha256}`) must equal the
|
|
26
|
+
* envelope's `source.model`, the binding Review writes; the reader holds it to
|
|
27
|
+
* that and records it in the provenance record. Carriers of another kind (the
|
|
28
|
+
* mesh edits) are not this command's and are not read.
|
|
29
|
+
*
|
|
22
30
|
* The row's `sha256` is recomputed and a mismatch is refused: sha256 (lowercase
|
|
23
31
|
* hex) of `JSON.stringify` of the row's raw `edit` with object keys sorted
|
|
24
32
|
* recursively (`Object.keys(v).sort()`) and array order kept. That rule is a
|
|
@@ -35,8 +43,16 @@ import { type PartsFile, readParts } from './parts.ts';
|
|
|
35
43
|
* staged; a failure removes the temporaries and leaves earlier files as they were.
|
|
36
44
|
*/
|
|
37
45
|
|
|
38
|
-
/** The act schema this command reads; another act version is refused by name. */
|
|
46
|
+
/** The chest-landmarks act schema this command reads; another act version is refused by name. */
|
|
39
47
|
export const BUST_LANDMARKS_ACT_SCHEMA = 'rig-review/act@9';
|
|
48
|
+
/** Issue #1539: the comment-only act schema, read for its one `chest-landmarks` carrier. */
|
|
49
|
+
export const BUST_LANDMARKS_COMMENT_ACT_SCHEMA = 'rig-review/act@10';
|
|
50
|
+
/** The two act schemas, as every refusal of the act names them. */
|
|
51
|
+
const ACCEPTED_ACTS = `${BUST_LANDMARKS_ACT_SCHEMA} or ${BUST_LANDMARKS_COMMENT_ACT_SCHEMA}`;
|
|
52
|
+
/** The act schemas a provenance record may name. */
|
|
53
|
+
type ActSchema = typeof BUST_LANDMARKS_ACT_SCHEMA | typeof BUST_LANDMARKS_COMMENT_ACT_SCHEMA;
|
|
54
|
+
/** A model file as Review names one: a path and its sha256. */
|
|
55
|
+
export interface ModelFile { path: string; sha256: string }
|
|
40
56
|
/** The provenance record's spec. */
|
|
41
57
|
export const BUST_LANDMARKS_PROVENANCE_SPEC = 'rig-parts-bust-landmarks-provenance/1';
|
|
42
58
|
/** The provenance record is written beside `--out` under this suffix, as `depth-bind` writes `<map>.binding.json`. */
|
|
@@ -69,7 +85,9 @@ export interface BustLandmarksFile {
|
|
|
69
85
|
/** The provenance record written beside the landmarks file. Fixed key order, no clock. */
|
|
70
86
|
export interface BustLandmarksProvenance {
|
|
71
87
|
spec: typeof BUST_LANDMARKS_PROVENANCE_SPEC;
|
|
72
|
-
|
|
88
|
+
/** `carrier_file` (issue #1539) is present exactly when `schema` is the comment-only act: the chest carrier's `file`,
|
|
89
|
+
* which equals the act's `source.model`. A chest-landmarks act's record has none, so its bytes are as before. */
|
|
90
|
+
act: { schema: ActSchema; act_id: string; file_sha256: string; carrier_file?: ModelFile };
|
|
73
91
|
row_sha256: string;
|
|
74
92
|
slot: string;
|
|
75
93
|
source: { hash: string; frame: { width: number; height: number } };
|
|
@@ -83,6 +101,8 @@ export interface BustLandmarksProvenance {
|
|
|
83
101
|
}
|
|
84
102
|
|
|
85
103
|
interface ChestRow {
|
|
104
|
+
/** Where the act holds the rows: `value.chestLandmarks`, or `value.carriers[k].chestLandmarks` in a comment-only act. */
|
|
105
|
+
base: string;
|
|
86
106
|
index: number;
|
|
87
107
|
slot: string;
|
|
88
108
|
skin: string;
|
|
@@ -116,9 +136,9 @@ const sha256 = (bytes: Uint8Array | string): string => createHash('sha256').upda
|
|
|
116
136
|
const isPoint = (v: unknown): v is Point => Array.isArray(v) && v.length === 2 && v.every(n => typeof n === 'number' && Number.isFinite(n));
|
|
117
137
|
const isName = (v: unknown): v is string => typeof v === 'string' && v.length > 0;
|
|
118
138
|
|
|
119
|
-
/** Read one
|
|
120
|
-
function readRow(raw: unknown, index: number, problems: Problem[]): ChestRow | null {
|
|
121
|
-
const at =
|
|
139
|
+
/** Read one `<base>[i]` row; every problem it has is pushed, and null returned when any is. */
|
|
140
|
+
function readRow(raw: unknown, index: number, problems: Problem[], base: string): ChestRow | null {
|
|
141
|
+
const at = `${base}[${index}]`;
|
|
122
142
|
const before = problems.length;
|
|
123
143
|
const fail = (object: string, detail: string): void => { problems.push({ code: 'BUST_LANDMARKS_ROW', object, detail }); };
|
|
124
144
|
if (!isObject(raw)) {
|
|
@@ -178,52 +198,118 @@ function readRow(raw: unknown, index: number, problems: Problem[]): ChestRow | n
|
|
|
178
198
|
const landmarks: BustLandmarksFile = { apex_r: [...(bust.apex_r as Point)], apex_l: [...(bust.apex_l as Point)] };
|
|
179
199
|
if (Object.hasOwn(bust, 'cleavage')) landmarks.cleavage = [...(bust.cleavage as Point)];
|
|
180
200
|
return {
|
|
181
|
-
index, slot: edit.slot as string, skin: edit.skin as string, attachment: edit.attachment as string,
|
|
201
|
+
base, index, slot: edit.slot as string, skin: edit.skin as string, attachment: edit.attachment as string,
|
|
182
202
|
hash: source.hash as string, frame, landmarks, shape, sha256: digest as string,
|
|
183
203
|
};
|
|
184
204
|
}
|
|
185
205
|
|
|
206
|
+
/** A `{path, sha256}` model file, or null when the value is not one. */
|
|
207
|
+
const modelFile = (v: unknown): ModelFile | null =>
|
|
208
|
+
isObject(v) && isName(v.path) && typeof v.sha256 === 'string' && SHA256_PATTERN.test(v.sha256) ? { path: v.path, sha256: v.sha256 } : null;
|
|
209
|
+
|
|
210
|
+
/** The act as read: its schema and id, the rows, and with a comment-only act the chest carrier's `file`. */
|
|
211
|
+
interface ReadAct { schema: ActSchema; actId: string; rows: ChestRow[]; carrierFile?: ModelFile }
|
|
212
|
+
|
|
186
213
|
/** Read the act's envelope and rows: every problem pushed, the rows that read returned. */
|
|
187
|
-
function readAct(bytes: Buffer | string, path: string, problems: Problem[]):
|
|
214
|
+
function readAct(bytes: Buffer | string, path: string, problems: Problem[]): ReadAct | null {
|
|
188
215
|
if (typeof bytes === 'string') {
|
|
189
|
-
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `is not readable (${bytes}); a ${
|
|
216
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `is not readable (${bytes}); a ${ACCEPTED_ACTS} JSON file is required` });
|
|
190
217
|
return null;
|
|
191
218
|
}
|
|
192
219
|
let raw: unknown;
|
|
193
220
|
try { raw = JSON.parse(bytes.toString('utf8')); }
|
|
194
221
|
catch (error) {
|
|
195
|
-
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `does not parse as JSON (${error instanceof Error ? error.message : String(error)}); a ${
|
|
222
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `does not parse as JSON (${error instanceof Error ? error.message : String(error)}); a ${ACCEPTED_ACTS} JSON file is required` });
|
|
196
223
|
return null;
|
|
197
224
|
}
|
|
198
225
|
if (!isObject(raw)) {
|
|
199
|
-
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `is ${show(raw)}; a ${
|
|
226
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: path, detail: `is ${show(raw)}; a ${ACCEPTED_ACTS} act object is required` });
|
|
200
227
|
return null;
|
|
201
228
|
}
|
|
202
229
|
const before = problems.length;
|
|
203
|
-
|
|
230
|
+
const schema = raw.schema;
|
|
231
|
+
if (schema !== BUST_LANDMARKS_ACT_SCHEMA && schema !== BUST_LANDMARKS_COMMENT_ACT_SCHEMA) {
|
|
232
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path} schema`, detail: `is ${show(schema)}; "${BUST_LANDMARKS_ACT_SCHEMA}" (the chest-landmarks act) or "${BUST_LANDMARKS_COMMENT_ACT_SCHEMA}" (the comment-only act with a chest-landmarks carrier) is required` });
|
|
233
|
+
}
|
|
204
234
|
if (!isName(raw.actId)) problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path} actId`, detail: `is ${show(raw.actId)}; a non-empty act id is required` });
|
|
205
235
|
const value = raw.value;
|
|
206
|
-
|
|
236
|
+
let base = 'value.chestLandmarks';
|
|
237
|
+
let list: unknown = isObject(value) ? value.chestLandmarks : undefined;
|
|
238
|
+
let carrierFile: ModelFile | undefined;
|
|
239
|
+
if (schema === BUST_LANDMARKS_COMMENT_ACT_SCHEMA) {
|
|
240
|
+
const carrier = chestCarrier(raw, path, problems);
|
|
241
|
+
if (carrier === null) return null;
|
|
242
|
+
base = `value.carriers[${carrier.index}].chestLandmarks`;
|
|
243
|
+
list = carrier.rows;
|
|
244
|
+
carrierFile = carrier.file ?? undefined;
|
|
245
|
+
}
|
|
207
246
|
if (!Array.isArray(list) || list.length === 0) {
|
|
208
|
-
problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path}
|
|
247
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path} ${base}`, detail: `is ${Array.isArray(list) ? 'an empty list' : show(list)}; one chest-landmarks row is required` });
|
|
209
248
|
return null;
|
|
210
249
|
}
|
|
211
|
-
const rows = list.map((item, index) => readRow(item, index, problems)).filter((row): row is ChestRow => row !== null);
|
|
212
|
-
|
|
250
|
+
const rows = list.map((item, index) => readRow(item, index, problems, base)).filter((row): row is ChestRow => row !== null);
|
|
251
|
+
if (problems.length > before || carrierFile === undefined && schema === BUST_LANDMARKS_COMMENT_ACT_SCHEMA) return null;
|
|
252
|
+
return { schema: schema as ActSchema, actId: raw.actId as string, rows, ...(carrierFile === undefined ? {} : { carrierFile }) };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Issue #1539: the one `chest-landmarks` carrier of a comment-only act, its rows and its `file` bound to the act's
|
|
257
|
+
* `source.model`. None is `BUST_LANDMARKS_NO_CHEST_CARRIER`; a `file` that is missing, malformed or not the model
|
|
258
|
+
* the act is bound to is `BUST_LANDMARKS_CARRIER_FILE` (`file` null then, the rows still read so every problem is
|
|
259
|
+
* named at once). Other carriers (mesh edits) are not read.
|
|
260
|
+
*/
|
|
261
|
+
function chestCarrier(raw: Record<string, unknown>, path: string, problems: Problem[]): { index: number; rows: unknown; file: ModelFile | null } | null {
|
|
262
|
+
const value = raw.value;
|
|
263
|
+
const carriers = isObject(value) ? value.carriers : undefined;
|
|
264
|
+
if (carriers !== undefined && !Array.isArray(carriers)) {
|
|
265
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path} value.carriers`, detail: `is ${show(carriers)}; a list of carriers is required` });
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
const list = carriers ?? [];
|
|
269
|
+
const chest = list.flatMap((c: unknown, index) => isObject(c) && c.kind === 'chest-landmarks' ? [{ index, carrier: c }] : []);
|
|
270
|
+
if (chest.length === 0) {
|
|
271
|
+
const found = !isObject(value) ? `value is ${show(value)}` : carriers === undefined ? 'has no carriers'
|
|
272
|
+
: `has ${list.length === 0 ? 'an empty carrier list' : `carriers of kind ${list.map((c: unknown) => show(isObject(c) ? c.kind : c)).join(', ')}`} and none of kind "chest-landmarks"`;
|
|
273
|
+
problems.push({
|
|
274
|
+
code: 'BUST_LANDMARKS_NO_CHEST_CARRIER', object: `${path} value.carriers`,
|
|
275
|
+
detail: `act ${show(raw.actId)} (${BUST_LANDMARKS_COMMENT_ACT_SCHEMA}) ${found}; one value.carriers[] entry of kind "chest-landmarks", with chestLandmarks rows and a file equal to source.model, is required: the comment-only act carries the chest points only there (a mesh-edits carrier is not this command's)`,
|
|
276
|
+
});
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
if (chest.length > 1) {
|
|
280
|
+
problems.push({ code: 'BUST_LANDMARKS_ACT', object: `${path} value.carriers`, detail: `has ${chest.length} carriers of kind "chest-landmarks" (value.carriers[${chest.map(c => c.index).join('], [')}]); one is required, as Review writes each carrier kind at most once` });
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
const { index, carrier } = chest[0];
|
|
284
|
+
const at = `${path} value.carriers[${index}].file`;
|
|
285
|
+
const file = modelFile(carrier.file);
|
|
286
|
+
const model = isObject(raw.source) ? modelFile(raw.source.model) : null;
|
|
287
|
+
const before = problems.length;
|
|
288
|
+
if (file === null) problems.push({ code: 'BUST_LANDMARKS_CARRIER_FILE', object: at, detail: `is ${show(carrier.file)}; {path, sha256}, a non-empty path and 64 lowercase hex digits, is required: the model file the points were placed on` });
|
|
289
|
+
if (model === null) {
|
|
290
|
+
const found = isObject(raw.source) ? raw.source.model : raw.source;
|
|
291
|
+
problems.push({ code: 'BUST_LANDMARKS_CARRIER_FILE', object: `${path} source.model`, detail: `is ${show(found)}; {path, sha256}, a non-empty path and 64 lowercase hex digits, is required: the chest carrier's file is bound to the model the act was made on` });
|
|
292
|
+
}
|
|
293
|
+
if (file !== null && model !== null && (file.path !== model.path || file.sha256 !== model.sha256)) {
|
|
294
|
+
const differs = [file.path === model.path ? '' : 'path', file.sha256 === model.sha256 ? '' : 'sha256'].filter(Boolean).join(' and ');
|
|
295
|
+
problems.push({ code: 'BUST_LANDMARKS_CARRIER_FILE', object: at, detail: `is ${show(file)}; source.model ${show(model)} is required (the ${differs} differ${differs.includes(' and ') ? '' : 's'}): the points were placed on another model file than the one the act is bound to` });
|
|
296
|
+
}
|
|
297
|
+
return { index, rows: carrier.chestLandmarks, file: problems.length > before ? null : file };
|
|
213
298
|
}
|
|
214
299
|
|
|
215
300
|
/** One chest row: the landmarks file names no part, and `propose` drafts one chest carrier, so one row is required. */
|
|
216
301
|
function oneRow(rows: readonly ChestRow[], problems: Problem[]): ChestRow | null {
|
|
217
302
|
if (rows.length === 1) return rows[0];
|
|
303
|
+
const base = rows[0]?.base ?? 'value.chestLandmarks';
|
|
218
304
|
const bySlot = new Map<string, number[]>();
|
|
219
305
|
for (const row of rows) bySlot.set(row.slot, [...(bySlot.get(row.slot) ?? []), row.index]);
|
|
220
306
|
for (const [slot, indices] of bySlot) {
|
|
221
307
|
if (indices.length > 1) {
|
|
222
|
-
problems.push({ code: 'BUST_LANDMARKS_PART_ROWS', object: `slot "${slot}"`, detail: `has ${indices.length} rows (
|
|
308
|
+
problems.push({ code: 'BUST_LANDMARKS_PART_ROWS', object: `slot "${slot}"`, detail: `has ${indices.length} rows (${base}[${indices.join('], [')}]); one row per part is required` });
|
|
223
309
|
}
|
|
224
310
|
}
|
|
225
311
|
if (bySlot.size > 1) {
|
|
226
|
-
problems.push({ code: 'BUST_LANDMARKS_ROWS', object:
|
|
312
|
+
problems.push({ code: 'BUST_LANDMARKS_ROWS', object: base, detail: `names ${bySlot.size} parts (${[...bySlot.keys()].map(s => `"${s}"`).join(', ')}); one chest row is required, because propose drafts one chest carrier and the landmarks file names no part` });
|
|
227
313
|
}
|
|
228
314
|
return null;
|
|
229
315
|
}
|
|
@@ -278,7 +364,7 @@ export function bustPointsMoved(act: { apex_r: readonly number[]; apex_l: readon
|
|
|
278
364
|
}
|
|
279
365
|
|
|
280
366
|
function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfig | null, writeConfig: boolean, problems: Problem[]): { fields: ShapeField[]; pending: PendingBustShape['fields']; moved: boolean } {
|
|
281
|
-
const at =
|
|
367
|
+
const at = `${row.base}[${row.index}]`;
|
|
282
368
|
if (parts !== null) {
|
|
283
369
|
const [width, height] = parts.rig_size;
|
|
284
370
|
if (row.frame.width !== width || row.frame.height !== height) {
|
|
@@ -458,7 +544,10 @@ export function planBustLandmarks(input: { act: string; parts: string; config: s
|
|
|
458
544
|
const text = bustLandmarksText(row.landmarks);
|
|
459
545
|
const provenance: BustLandmarksProvenance = {
|
|
460
546
|
spec: BUST_LANDMARKS_PROVENANCE_SPEC,
|
|
461
|
-
act: {
|
|
547
|
+
act: {
|
|
548
|
+
schema: act.schema, act_id: act.actId, file_sha256: sha256(actBytes),
|
|
549
|
+
...(act.carrierFile === undefined ? {} : { carrier_file: { path: act.carrierFile.path, sha256: act.carrierFile.sha256 } }),
|
|
550
|
+
},
|
|
462
551
|
row_sha256: row.sha256,
|
|
463
552
|
slot: row.slot,
|
|
464
553
|
source: { hash: row.hash, frame: { width: row.frame.width, height: row.frame.height } },
|
|
@@ -605,8 +694,12 @@ export function readBustSidecar(landmarksPath: string, landmarksBytes: Uint8Arra
|
|
|
605
694
|
if (raw.spec !== BUST_LANDMARKS_PROVENANCE_SPEC) fail(`${path} spec`, `is ${show(raw.spec)}; "${BUST_LANDMARKS_PROVENANCE_SPEC}" is required`);
|
|
606
695
|
const hex = (v: unknown): v is string => typeof v === 'string' && SHA256_PATTERN.test(v);
|
|
607
696
|
const act = raw.act;
|
|
608
|
-
|
|
609
|
-
|
|
697
|
+
// Issue #1539: a comment-only act's record carries the chest carrier's file; a chest-landmarks act's carries none.
|
|
698
|
+
const comment = isObject(act) && act.schema === BUST_LANDMARKS_COMMENT_ACT_SCHEMA;
|
|
699
|
+
const carrierFile = isObject(act) ? act.carrier_file : undefined;
|
|
700
|
+
if (!isObject(act) || (act.schema !== BUST_LANDMARKS_ACT_SCHEMA && !comment) || !isName(act.act_id) || !hex(act.file_sha256)
|
|
701
|
+
|| (comment ? modelFile(carrierFile) === null : Object.hasOwn(act, 'carrier_file'))) {
|
|
702
|
+
fail(`${path} act`, `is ${show(act)}; {schema: "${BUST_LANDMARKS_ACT_SCHEMA}", act_id, file_sha256}, or {schema: "${BUST_LANDMARKS_COMMENT_ACT_SCHEMA}", act_id, file_sha256, carrier_file: {path, sha256}}, is required`);
|
|
610
703
|
}
|
|
611
704
|
if (!hex(raw.row_sha256)) fail(`${path} row_sha256`, `is ${show(raw.row_sha256)}; 64 lowercase hex digits are required`);
|
|
612
705
|
if (!isName(raw.slot)) fail(`${path} slot`, `is ${show(raw.slot)}; the chest carrier's part name is required`);
|
|
@@ -643,7 +736,10 @@ export function readBustSidecar(landmarksPath: string, landmarksBytes: Uint8Arra
|
|
|
643
736
|
const a = act as Record<string, unknown>, src = source as Record<string, unknown>, f = frame as Record<string, unknown>;
|
|
644
737
|
const provenance: BustLandmarksProvenance = {
|
|
645
738
|
spec: BUST_LANDMARKS_PROVENANCE_SPEC,
|
|
646
|
-
act: {
|
|
739
|
+
act: {
|
|
740
|
+
schema: a.schema as ActSchema, act_id: a.act_id as string, file_sha256: a.file_sha256 as string,
|
|
741
|
+
...(comment ? { carrier_file: modelFile(carrierFile) as ModelFile } : {}),
|
|
742
|
+
},
|
|
647
743
|
row_sha256: raw.row_sha256 as string,
|
|
648
744
|
slot: raw.slot as string,
|
|
649
745
|
source: { hash: src.hash as string, frame: { width: f.width as number, height: f.height as number } },
|