@rig-c/parts 2.50.0 → 2.52.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/docs/STABILITY.md CHANGED
@@ -457,6 +457,33 @@ invalid fields with the same named rules as `readParts`. It never opens,
457
457
  hashes or decodes PNGs and preserves the manifest reader's named refusals.
458
458
  Legacy manifests may omit alternates, depth and painting declarations.
459
459
 
460
+ ## Cloth targets data export
461
+
462
+ The stable named export `./cloth-targets.json` (`@rig-c/parts/cloth-targets.json`)
463
+ ships the cloth-recipe target tags as a data-only JSON file (issue #1433):
464
+
465
+ ```json
466
+ {
467
+ "schema": "rig-parts/cloth-targets@1",
468
+ "targets": [
469
+ "bottomwear",
470
+ "back hair",
471
+ "front hair",
472
+ "handwear-r",
473
+ "handwear-l"
474
+ ]
475
+ }
476
+ ```
477
+
478
+ The object carries fixed key order (`schema`, then `targets`), two-space
479
+ indentation, and one trailing newline. `targets` lists the tags in
480
+ `CLOTH_TARGETS`' order, held equal to `src/cloth.ts` by a tree control
481
+ (`bun tools/check_cloth_targets.ts --write` regenerates the file). Consumers
482
+ read or resolve the file by its package exports key
483
+ (`@rig-c/parts/cloth-targets.json`), not by its internal path inside the
484
+ package. Adding a tag to `targets` is a minor change; removing or renaming a
485
+ tag, or changing `schema`, is a major change.
486
+
460
487
  ## Commands and flags
461
488
 
462
489
  Exit codes are part of the interface: **0** the command did what it says, **1** it
@@ -521,7 +548,7 @@ and do not certify visibility. See the
521
548
  | `diff-drafts` | `--left`, `--right`, `--out`; optional `--help` (`-h`) (issue #1369; draft-to-draft assemble comparison, `rig-parts-draft-diff/1`) |
522
549
  | `depth-prepare` | `--parts`, `--config`, `--out`; optional `--help` (`-h`) (issue #897; separate numeric-depth recipe) |
523
550
  | `depth-bind` | `--map`, `--input`, `--part`; optional `--help` (`-h`) (issue #1284; exclusive receipt creation from current file bytes) |
524
- | `depth-apply` | `--parts`, `--manifest`, `--config`, `--rig-config`, `--out`; optional `--help` (`-h`) (issue #897; original character config is read-only) |
551
+ | `depth-apply` | `--parts`, `--manifest`, `--config`, `--rig-config`, `--out`; optional `--groups` (a comma-separated list of the recipe's groups to apply, issue #1449), `--help` (`-h`) (issue #897; original character config is read-only) |
525
552
  | `layers` | one positional path: a wrapper directory, a `layers.json` or a `.psd` (a file literally named `-h` is reached as `./-h`); with it, optional `--export` (a directory to write the wrapper form into, issue #359); or `--template` with `--canvas` and no path; or a positional head run with `--full`, `--source`, `--config` together for `PLAN_HEAD_GARMENT_OVERLAP` (issue #826); or `--help` (`-h`) |
526
553
  | `sheet` | `--source`, `--layers` (repeatable), `--out`; optional `--cell`, `--cols`, `--help` (`-h`) |
527
554
  | `inputs` | `--source`, `--config`, `--out`; optional `--help` (`-h`) |
@@ -532,9 +559,9 @@ and do not certify visibility. See the
532
559
  | `assemble` | `--propose-plan` with `--source`, `--full`, `--config`, optional `--head`, `--write-config` (must name `--config` itself, issue #356); or `--source`, `--full`, `--config`, `--out`, optional `--head` (without it, one run: issue #359), `--seam` (near-white, silhouette), `--project` (core, visible), `--alt` (repeatable `<name>=<source>:<full>[:<head>]`, issue #454), `--requirements` (source-bound cut-material evidence only when the file declares `cut_material`, issue #888); or `--emit-fill-masks` (a directory) with `--source`, `--full`, `--config`, optional `--head` (each cut's hidden-band mask on the painting grid, issue #1230); or `--help` (`-h`) |
533
560
  | `head-crop-preflight` | `--full`, `--canvas`, `--head-box` (JSON coordinate array); optional `--help` (`-h`); read-only advice before the head run, original alpha > 8 samples (issue #1082) |
534
561
  | `propose` | `--head-box` with `--full`, `--canvas`; optional `--no-back-hair`, `--write-config` (existing config, issue #356), `--help` (`-h`) |
535
- | `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`, `--help` (`-h`) |
562
+ | `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`) |
536
563
  | `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) |
537
- | `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`, a field the act omits removed; the config is untouched when none differs — 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) |
564
+ | `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) |
538
565
  | `compare` | `--left`, `--right`; optional `--map`, `--help` (`-h`) |
539
566
  | `rig` | `--config`, `--parts`, `--out`; optional `--idle-keys` (ctl, direct), `--page-edges` (pot, free), `--pack-shape` (rect, polygon), `--page-size`, `--help` (`-h`) |
540
567
  | `check-parts` | `--parts`, `--out`; optional `--json`, `--help` (`-h`) |
@@ -563,19 +590,27 @@ command in the table. This page does not separate provisional commands. The
563
590
  promise covers its command line and flags, and its refusal codes:
564
591
  `BUST_LANDMARKS_ACT`, `BUST_LANDMARKS_ROW`, `BUST_LANDMARKS_SLOT`,
565
592
  `BUST_LANDMARKS_PART_ROWS`, `BUST_LANDMARKS_ROWS`, `BUST_LANDMARKS_FRAME`,
566
- `BUST_LANDMARKS_SHAPE` and `BUST_LANDMARKS_OUT`. It also covers the landmarks
593
+ `BUST_LANDMARKS_SHAPE` and `BUST_LANDMARKS_OUT`, and `CONFIG_BUST_CLEARANCE` for points the
594
+ shape `propose` will check them with does not fit (issue #1441). It also covers the landmarks
567
595
  file it writes, which holds the three keys `propose` reads, in rig px. And it
568
596
  covers the provenance record: its spec id `rig-parts-bust-landmarks-provenance/1`,
569
597
  its keys and their order: `spec`, `act` (`schema`, `act_id`, `file_sha256`),
570
598
  `row_sha256`, `slot`, `source` (`hash`, `frame`), `landmarks_sha256`, and, only
571
- when the config declared no `contour.bust` and the act's shape differs from the
572
- defaults, `shape` (`status`, `pending` or `applied`, and `fields`, in the
599
+ when the act's shape differs from the config's after defaults and the config
600
+ declared no `contour.bust` or the act moves its points (issue #1443), `shape` (`status`, `pending` or `applied`, and `fields`, in the
573
601
  shorthand's key order). `propose --bust-landmarks` reads that record when it
574
602
  sits beside the landmarks file, writes a pending shape with `--write-config` and
575
603
  marks it applied, and refuses by name `PROPOSE_BUST_SIDECAR`,
576
604
  `PROPOSE_BUST_SIDECAR_DIGEST`, `PROPOSE_BUST_SIDECAR_PART` and
577
605
  `PROPOSE_BUST_PENDING`; with no record beside the file it reads the file as
578
- before. 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
606
+ before. On a sampled body-turn neck config (`turn.body` and a plan part tagged
607
+ `neck`, issue #1436), `--bust-landmarks` or `--no-bust` with `--write-config` and
608
+ without `--full` and `--head` is the chest-only write: it writes the chest
609
+ carrier's `contour.bust` and the `boob_r` / `boob_l` bones and no other entry,
610
+ derives a missing cleavage from the config's own `neck` and `hip` bones, and
611
+ says which source the cleavage came from. A carrier that is not a contour mesh
612
+ is refused by name, `PROPOSE_BUST_CARRIER_MESH`; the chest flags with `--full` or
613
+ `--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
579
614
  `rig-review/act@9` only, and refuses another act version by name until a later
580
615
  minor version reads it.
581
616
 
@@ -808,7 +843,8 @@ literally, but cannot be siblings. `diagnosticSiblings` checks the entire siblin
808
843
  scope before its writes, using the mapped folders' ASCII lowercase spellings.
809
844
  A collision raises `DIAGNOSTIC_PATH_SEGMENT` naming both original inputs,
810
845
  both folder spellings and their shared case-folded folder. Scopes are extremes
811
- animations, retained render sets, selected alternate-set folders, and each of
846
+ animations, retained render sets (a preflight on the animation names before
847
+ any render), selected alternate-set folders, and each of
812
848
  `requirements/as-declared`, `requirements/released` and `requirements/full`.
813
849
  Check preflights all known scopes before creating or clearing its output;
814
850
  requirement measurement also preflights before cleanup, and retained copies
@@ -823,14 +859,22 @@ applied. The suffix is appended after unit mapping and included in that length
823
859
  check; it does not change the name's encoding.
824
860
 
825
861
  `extremes/<segment>/` uses the original animation name. Retained render sets
826
- use its mapped animation name plus `@<fps>fps` only outside the protocol
827
- 12 fps, with `frames.json`'s `sets[].dir` updated to the actual directory.
828
- A setup-only set maps its renderer directory instead. The original animation
829
- fields, including `extremes.json`, and the public `<id>:<name>` animation
830
- names stay unchanged. Readers follow `sets[].dir` rather than reconstructing
831
- a folder from `animation`. Safe unchanged indexes retain their original bytes.
832
- Fixed root sidecar names and bytes are copied verbatim; only the frame index
833
- may change its set directory references.
862
+ are named by rig-c's render, not by this package (issue #1367): from
863
+ rig-c/core#1744 on, `rigc render` writes each frame-set folder with this same
864
+ mapping plus `@<fps>fps` outside the protocol 12 fps, and records it under
865
+ `frames.json`'s `sets[].dir`. The retained copy takes every `sets[].dir` as it
866
+ is and copies `frames.json` byte for byte; it maps no name a second time. A
867
+ `sets[].dir` that is absent, not a string, empty, absolute, a dot segment,
868
+ holds a path separator or a unit outside `[A-Za-z0-9_@+.~-]`, ends in `.`, is
869
+ a Windows device basename, or is longer than 255 characters is refused as
870
+ `FRAMES_SIDECAR` naming the set and the value, as are two recorded folders
871
+ that share an ASCII-case-folded spelling; every set is validated before a
872
+ destination is created. A render from a core before rig-c/core#1744 records
873
+ an unsafe animation name raw, so its copy is refused rather than renamed. The
874
+ original animation fields, including `extremes.json`, and the public
875
+ `<id>:<name>` animation names stay unchanged. Readers follow `sets[].dir`
876
+ rather than reconstructing a folder from `animation`. Fixed root sidecar names
877
+ and bytes are copied verbatim.
834
878
 
835
879
  The same mapping applies to alternate-set folders in `setup_still/`,
836
880
  `setup_still_auto/` and `seam/`, the complete ranked seam-picture filename stem,
@@ -1066,7 +1110,7 @@ execution in historical evidence is inferred from a current export.
1066
1110
  | `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) |
1067
1111
  | `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) |
1068
1112
  | `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) |
1069
- | `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 (issue #538, additive: `path` as given, `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 GAP on proven body-root pairs only (gap-only; mixed ghost remains INFO until rig-c/core#1555 supplies owners): `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`), `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 (issue #590, additive: `status` `"REPORTED"`, `spec` `"rig-parts-wind-band/1"`, `path` as given, `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 issue #556, additive: `path` as typed or declared, `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. |
1113
+ | `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 (issue #538, additive: `path` as given, `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 GAP on proven body-root pairs only (gap-only; mixed ghost remains INFO until rig-c/core#1555 supplies owners): `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 (issue #590, additive: `status` `"REPORTED"`, `spec` `"rig-parts-wind-band/1"`, `path` as given, `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 issue #556, additive: `path` as typed or declared, `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. |
1070
1114
  | `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. |
1071
1115
  | `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 |
1072
1116
  | the template `.psd` | `layers --template` | one empty layer per name `templateLayerNames` (`src/layers.ts`) holds, bottom first; the same canvas writes the same bytes |
@@ -1428,11 +1472,13 @@ from the CLI), `SK04` (the skeleton), `RG03` (two lattice builds), `CW20` and
1428
1472
  loop's replay, every Stage B opt-in, a gradation, the multi-interval selection's
1429
1473
  policy path and the residual veto), `CK02`, `CK33` and `CK79` (`check`, its
1430
1474
  stretch geometry, and `check --requirements`), `DG13` (`basis.json`), `LP08`
1431
- (the indexed APNG) and `ST26` (the `compare` printout). With the public examples
1432
- fetched, the `chain` suite builds each of them and holds `parts.json`
1433
- (`CH02`), `rig.json`, `motion.json` and `mesh_report.json` (`CH03`),
1434
- `check.json` (`CH04`) and the gate file (`CH05`) to its tracked `expected/`,
1435
- field by field, with the tolerances `CH07` plants against.
1475
+ (the indexed APNG) and `ST26` (the `compare` printout). The `chain` suite builds
1476
+ the synthetic validation variants and holds `parts.json` (`CH02`), `rig.json`,
1477
+ `motion.json` and `mesh_report.json` (`CH03`), `check.json` whole (`CH04`) and the
1478
+ gate file (`CH05`) to their tracked `expected/`, with the tolerances `CH07` plants
1479
+ against. The public examples' `expected/` files are this package's own snapshots:
1480
+ `tools/regenerate_examples.ts` writes them on Linux, and CI rebuilds the fetched
1481
+ examples and compares the files whole with its `--check` (issue #1439).
1436
1482
 
1437
1483
  ### Opt-in hybrid provenance (issue #399)
1438
1484
 
@@ -1899,7 +1945,14 @@ edited base image. No new flag bypasses rig-c or existing check bars.
1899
1945
 
1900
1946
  Receipt association is additive `provenance.edited_part` metadata: the complete
1901
1947
  receipt and `dir`, `edit: "edited_parts[i]"`, `changed_px`,
1902
- `changed_counted_px`, `changed_excluded_px` and `removed_opaque_px`.
1948
+ `changed_counted_px`, `changed_excluded_px` and `removed_opaque_px`, then,
1949
+ when `removed_opaque_px` is above 0, `removed_opaque_regions` (issue #1383,
1950
+ additive): one `{box: [x, y, w, h], px}` per 8-connected region of removed
1951
+ positions, in part pixels, sorted by `y`, `x`, `h`, `w`, `px`, whose `px` sum
1952
+ to `removed_opaque_px`. An edit that removes nothing, and a build without the
1953
+ block, writes the same bytes as before. A manifest without the field reads as
1954
+ before; a reader that predates it refuses a manifest that carries it
1955
+ (`PARTS_FIELD_TYPE`).
1903
1956
  The four counts describe exact baseline-to-edited RGBA differences;
1904
1957
  `hand_px` keeps its existing final-alpha-above-8 partition meaning.
1905
1958
  The receipt covers the whole file, including unchanged and transparent
@@ -1927,7 +1980,11 @@ encoding, convexity sign and refusal remedies are in
1927
1980
  [AUTHORING](AUTHORING.md#per-part-provider-maps-897). No existing build path
1928
1981
  calls these stages; no-config builds retain their existing behavior and bytes.
1929
1982
  Group numbers and unit depths are explicit; no provider or absolute scale is
1930
- inferred. A new depth stage never replaces Core's rig gate.
1983
+ inferred. `depth-apply --groups` (#1449) applies a subset of the recipe's
1984
+ groups against the same manifest and records it in the report's `selection`
1985
+ field (`groups`, `leftOut`), written after `cleared` and before `parts`; the
1986
+ field is absent without the flag, so those reports keep their bytes, and
1987
+ `recipeSha256` and `manifestSha256` are unchanged by a selection. A new depth stage never replaces Core's rig gate.
1931
1988
  `relief` is an explicit rig-pixel value, not an implicit width multiplier.
1932
1989
  Part-width and head-referenced calibrations are authored recipe choices;
1933
1990
  changing a calibration requires preparing its recipe again. Compare the same
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@rig-c/parts",
3
- "version": "2.50.0",
3
+ "version": "2.52.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": {
7
7
  "./assembly-reading": "./src/assembly-reading.ts",
8
+ "./cloth-targets.json": "./src/cloth-targets.json",
8
9
  "./*": "./*"
9
10
  },
10
11
  "bin": {
@@ -74,7 +75,7 @@
74
75
  },
75
76
  "dependencies": {
76
77
  "ag-psd": "^31.0.2",
77
- "@rig-c/core": "3.8.0"
78
+ "@rig-c/core": "3.8.1"
78
79
  },
79
80
  "devDependencies": {
80
81
  "@esotericsoftware/spine-core": "4.3.13",
package/src/build.ts CHANGED
@@ -97,6 +97,7 @@ import {
97
97
  splitSchedule,
98
98
  untestedIntervals,
99
99
  } from './autoreplay.ts';
100
+ import { physicsLines } from './physicscontrib.ts';
100
101
  import { besideIdleLine, checkSummaryLine, inputFileRecord, type InputFileRecord, CLOTH_LINE, type ClothLine, clothWarnText, figureOpeningLines, frameRuns, MOTION_SEAM_LINE, type MotionSeamLine, type MotionSeamPlant, motionSeamRequiredLine, motionSeamWarnText, motionJointContactLines, FOLD_LINE, type FoldsLine, LEVEL_LINE, type LevelLine, LIMB_LINE, type LimbLine, STRESS_LINE, SWEEP_LINE, type SweepLine, buildGateLines, causeLines, environmentLine, IDLE_FPS, IDLE_MAX_PX, maxRgbDiff, REQUIREMENTS_DIR, type CheckReport, type PackLine, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, GATE_PROFILE, JUDGEMENT_LINES, type JudgementLine, packedBuildArgs, packedBuildLabel, type PackMode, parsePageSize, readCheckEnvironment, readWindBand, type PackShape, type PageEdges, readFrameSet, rigcFailed, rigcIdentity, rigcRanClause, REPORTED_LINES, type ReportedLine, type RigcRunner, runCheck, SEAM_DIR, SEAM_MEAN_BAR, seamPairText, seamRigPxText, SOURCE_LINE, SEAM_PX_BAR, SEAM_PX_LEVEL, SEAM_PX_LEVEL_HIGH, SPINEBOY_YARDSTICK, STILL_DIR, WIND_BAND_LINE, windBandLines } from './check.ts';
101
102
  import { type CharacterConfig, type Cut, type Extend, loadConfigAndAnimations, loadConfigWithBytes, loadEarlyConfig, type Patch, type PlanEntry } from './config.ts';
102
103
  import { coreCompileGuideLine, failLine, foldName, PartsError, type Problem, refuseIfAny } from './errors.ts';
@@ -2446,6 +2447,7 @@ export function checkStage(input: CheckStageInput, rigc: RigcRunner, bin: string
2446
2447
  if (r.motionSeam.required !== undefined) log(` ${motionSeamRequiredLine(r.motionSeam.required)}`);
2447
2448
  for (const [i, l] of figureOpeningLines(r.figureOpenings).entries()) log(` ${i === 0 ? '' : ' '}${l}`);
2448
2449
  for (const [i, l] of clothLines(r.cloth).entries()) log(` ${i === 0 ? '' : ' '}${l}`);
2450
+ if (r.physics !== undefined) for (const [i, l] of physicsLines(r.physics).entries()) log(` ${i === 0 ? '' : ' '}${l}`);
2449
2451
  for (const name of REPORTED_LINES) log(` ${judgementLine(name, fig[name])}`);
2450
2452
  if (fig.sets !== undefined) {
2451
2453
  for (const [setName, setFig] of Object.entries(fig.sets)) {
@@ -1,7 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { accessSync, constants, existsSync, lstatSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
3
3
  import { basename, dirname, join, resolve, sep } from 'node:path';
4
- import { type CharacterConfig, DEFAULT_BUST_ALPHA, DEFAULT_BUST_BONE_L, DEFAULT_BUST_BONE_R, DEFAULT_BUST_CLEARANCE, DEFAULT_BUST_SPACING, loadConfig } from './config.ts';
4
+ import { bustClearanceDetail, type CharacterConfig, DEFAULT_BUST_ALPHA, DEFAULT_BUST_BONE_L, DEFAULT_BUST_BONE_R, DEFAULT_BUST_CLEARANCE, DEFAULT_BUST_SPACING, loadConfig } from './config.ts';
5
5
  import { BUST_SHAPE_FIELDS, type BustShapeKey, type ConfigWritePatch, type PendingBustShape } from './configwrite.ts';
6
6
  import { SHA256_PATTERN } from './editreceipt.ts';
7
7
  import { PartsError, type Problem } from './errors.ts';
@@ -228,6 +228,32 @@ function oneRow(rows: readonly ChestRow[], problems: Problem[]): ChestRow | null
228
228
  return null;
229
229
  }
230
230
 
231
+ /** Where one field of the shape the points are checked with came from (issue #1441). */
232
+ export type BustShapeSource = 'the config' | 'the pending record' | 'the default';
233
+ /** The shape the three points are checked with: each field's value and where it came from. */
234
+ export type EffectiveBustShape = { readonly [K in BustShapeKey]: { readonly value: unknown; readonly source: BustShapeSource } };
235
+
236
+ /**
237
+ * Issue #1441: the shape the points are checked with, the one the config write will hold. Each field is the pending
238
+ * record's where it names one, else the config's declared `contour.bust` field, else the default. The one rule, read
239
+ * by `propose --bust-landmarks` on both routes and by `bust-landmarks` before it writes the landmarks file.
240
+ */
241
+ export function effectiveBustShape(declared: Readonly<Record<string, unknown>> | undefined, pending: Readonly<Partial<Record<BustShapeKey, unknown>>> | undefined): EffectiveBustShape {
242
+ const pick = (key: BustShapeKey): { value: unknown; source: BustShapeSource } =>
243
+ pending !== undefined && Object.hasOwn(pending, key) && pending[key] !== undefined ? { value: pending[key], source: 'the pending record' }
244
+ : declared !== undefined && Object.hasOwn(declared, key) && declared[key] !== undefined ? { value: declared[key], source: 'the config' }
245
+ : { value: SHAPE_DEFAULTS[key], source: 'the default' };
246
+ return { alpha: pick('alpha'), clearance: pick('clearance'), bone_r: pick('bone_r'), bone_l: pick('bone_l'), spacing: pick('spacing') };
247
+ }
248
+
249
+ /** The two fields the clearance rule reads (`bustClearanceDetail`): the ones a refusal of the points names. */
250
+ export const BUST_POINT_SHAPE_FIELDS = ['alpha', 'clearance'] as const;
251
+
252
+ /** The clause a refusal of the points carries: the two fields the clearance rule reads, each with its source. */
253
+ export function bustShapeClause(shape: EffectiveBustShape): string {
254
+ return `the shape checked: alpha ${show(shape.alpha.value)} (${shape.alpha.source}), clearance ${show(shape.clearance.value)} (${shape.clearance.source})`;
255
+ }
256
+
231
257
  /** The five shape fields after defaults, from a partial spec. */
232
258
  const effective = (spec: Partial<Shape>): Shape => ({ ...SHAPE_DEFAULTS, ...spec });
233
259
 
@@ -240,7 +266,18 @@ type ShapeField = { key: ShapeKey; value?: number | string };
240
266
  * field to write: the act's value where the act spells it out, the key's removal where the act omits it. With no
241
267
  * `contour.bust`, a field that differs from the default is returned as pending, for the sidecar.
242
268
  */
243
- function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfig | null, writeConfig: boolean, problems: Problem[]): { fields: ShapeField[]; pending: PendingBustShape['fields'] } {
269
+ /**
270
+ * Issue #1443: the act moves the points when apex_r or apex_l differs from the declared one in either coordinate, or
271
+ * when its cleavage differs from the declared one. An act with no cleavage moves the points too: propose derives one
272
+ * from a midline this command does not have, so it cannot be held equal, and the pending path loses nothing (propose
273
+ * writes the points and the shape in one staged write).
274
+ */
275
+ export function bustPointsMoved(act: { apex_r: readonly number[]; apex_l: readonly number[]; cleavage?: readonly number[] }, declared: { apex_r: readonly number[]; apex_l: readonly number[]; cleavage: readonly number[] }): boolean {
276
+ const same = (a: readonly number[], b: readonly number[]): boolean => a.length === b.length && a.every((v, i) => v === b[i]);
277
+ return !same(act.apex_r, declared.apex_r) || !same(act.apex_l, declared.apex_l) || act.cleavage === undefined || !same(act.cleavage, declared.cleavage);
278
+ }
279
+
280
+ function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfig | null, writeConfig: boolean, problems: Problem[]): { fields: ShapeField[]; pending: PendingBustShape['fields']; moved: boolean } {
244
281
  const at = `value.chestLandmarks[${row.index}]`;
245
282
  if (parts !== null) {
246
283
  const [width, height] = parts.rig_size;
@@ -257,12 +294,12 @@ function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfi
257
294
  if (row.skin !== 'default') {
258
295
  problems.push({ code: 'BUST_LANDMARKS_SLOT', object: `${at}.edit.skin`, detail: `is "${row.skin}"; "default" is required: this package writes every mesh into the default skin` });
259
296
  }
260
- if (config === null) return { fields: [], pending: {} };
297
+ if (config === null) return { fields: [], pending: {}, moved: false };
261
298
  const mesh = Object.hasOwn(config.meshes, row.slot) ? config.meshes[row.slot] : undefined;
262
299
  if (mesh === undefined || !('contour' in mesh)) {
263
300
  const found = mesh === undefined ? 'no mesh in config.meshes' : `a ${['grid', 'auto', 'influence', 'explicit'].find(m => m in mesh) ?? 'non-contour'} mesh`;
264
301
  problems.push({ code: 'BUST_LANDMARKS_SLOT', object: `${at}.edit.slot`, detail: `"${row.slot}" has ${found}; a part whose config.meshes entry is a contour mesh is required (the chest carrier propose drafts)` });
265
- return { fields: [], pending: {} };
302
+ return { fields: [], pending: {}, moved: false };
266
303
  }
267
304
  // No contour.bust yet (a first draft made with --no-bust) reads as the defaults: propose drafts contour.bust from the
268
305
  // three points alone, so the defaults are the values the redraft builds with.
@@ -275,6 +312,9 @@ function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfi
275
312
  ...(declared.bone_l === undefined ? {} : { bone_l: declared.bone_l }),
276
313
  });
277
314
  const actShape = effective(row.shape);
315
+ // Issue #1443: with the points moved, the shape is not written against the config's old points: it waits in the
316
+ // sidecar like a first draft's, and propose writes it with the new points.
317
+ const moved = declared !== undefined && bustPointsMoved(row.landmarks, declared);
278
318
  const fields: ShapeField[] = [];
279
319
  const pending: PendingBustShape['fields'] = {};
280
320
  for (const key of SHAPE_KEYS) {
@@ -282,8 +322,10 @@ function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfi
282
322
  const spelled = row.shape[key];
283
323
  // No contour.bust yet: the field differs from the default, so the act spells it. It is left pending in the
284
324
  // sidecar for propose --write-config to write with the three points (shape fields alone make no contour.bust).
285
- if (declared === undefined) {
286
- if (spelled !== undefined) pending[key] = spelled;
325
+ // Points moved (issue #1443): the same, and a field the act leaves out where the config declares another value
326
+ // is pending as the default's value, since the record holds values and the act's shape is the default there.
327
+ if (declared === undefined || moved) {
328
+ pending[key] = spelled ?? SHAPE_DEFAULTS[key];
287
329
  continue;
288
330
  }
289
331
  if (writeConfig) {
@@ -296,7 +338,17 @@ function checkRow(row: ChestRow, parts: PartsFile | null, config: CharacterConfi
296
338
  detail: `is ${show(actShape[key])}${spelled === undefined ? ' (absent, the default)' : ''}; meshes.${row.slot}.contour.bust.${key} ${show(configShape[key])}, ${from}, is required: the landmarks file carries no such field; run again with --write-config to take the act's value into the config; propose --write-config keeps the config's shape fields on the redraft (#1428)`,
297
339
  });
298
340
  }
299
- return { fields, pending };
341
+ // Issue #1441: the points against the shape propose will check them with, so this command refuses what propose
342
+ // refuses. The config after this command: the act's fields with --write-config, else the declared ones. A cleavage
343
+ // the act leaves out is derived by propose from a midline this command does not have, so it is checked there.
344
+ const after = declared === undefined ? undefined : writeConfig && !moved ? { ...row.shape } : { ...declared };
345
+ const shape = effectiveBustShape(after, pending);
346
+ const { apex_r, apex_l, cleavage } = row.landmarks;
347
+ if (cleavage !== undefined && typeof shape.alpha.value === 'number' && typeof shape.clearance.value === 'number') {
348
+ const detail = bustClearanceDetail({ apex_r, apex_l, cleavage }, shape.alpha.value, shape.clearance.value);
349
+ if (detail !== null) problems.push({ code: 'CONFIG_BUST_CLEARANCE', object: `${at}.edit.bust`, detail: `${detail}; ${bustShapeClause(shape)}` });
350
+ }
351
+ return { fields, pending, moved };
300
352
  }
301
353
 
302
354
  /** A path's device and inode, or null when nothing is there. */
@@ -382,6 +434,9 @@ export interface BustLandmarksPlan {
382
434
  texts: readonly [string, string];
383
435
  /** With `writeConfig`: the act's shape fields that differ from the config's `contour.bust`; null when none differs. */
384
436
  configPatch: ConfigWritePatch | null;
437
+ /** Issue #1443: the config declares `contour.bust` and the act moves its points ({@link bustPointsMoved}), so a
438
+ * differing shape is pending in the record and the config is not written. */
439
+ moved: boolean;
385
440
  }
386
441
 
387
442
  /**
@@ -398,7 +453,7 @@ export function planBustLandmarks(input: { act: string; parts: string; config: s
398
453
  const parts = collect(() => readParts(join(partsDir, 'parts.json')), problems);
399
454
  const config = collect(() => loadConfig(configPath), problems);
400
455
  const row = act === null ? null : oneRow(act.rows, problems);
401
- const { fields, pending } = row === null ? { fields: [], pending: {} } : checkRow(row, parts, config, input.writeConfig === true, problems);
456
+ const { fields, pending, moved } = row === null ? { fields: [], pending: {}, moved: false } : checkRow(row, parts, config, input.writeConfig === true, problems);
402
457
  if (problems.length > 0 || act === null || row === null || typeof actBytes === 'string') throw new PartsError(problems);
403
458
  const text = bustLandmarksText(row.landmarks);
404
459
  const provenance: BustLandmarksProvenance = {
@@ -414,6 +469,7 @@ export function planBustLandmarks(input: { act: string; parts: string; config: s
414
469
  landmarks: row.landmarks, provenance, out, provenancePath: out + BUST_LANDMARKS_PROVENANCE_SUFFIX,
415
470
  texts: [text, JSON.stringify(provenance, null, 2) + '\n'],
416
471
  configPatch: fields.length === 0 ? null : { kind: 'bust-shape', part: row.slot, fields },
472
+ moved,
417
473
  };
418
474
  }
419
475
 
package/src/check.ts CHANGED
@@ -11,6 +11,7 @@ import { ART_JOINT_LINE, artJointLine, type ArtJointLine } from './artjoints.ts'
11
11
  import { BOUNDARY_COLOUR_LINE, BOUNDARY_COLOUR_UNMEASURED_CODE, BOUNDARY_COLOUR_UNMEASURED_SUFFIX, measureBoundaryColour, type BoundaryColourMeasured } from './boundarycolour.ts';
12
12
  import { BEHIND_SEAM_LINE, behindTurnAnimations, measureBehindSeams, type BehindSeamsMeasured } from './behindseams.ts';
13
13
  import { baseAnchorMoves, type AnchorRegion } from './baseanchor.ts';
14
+ import { PHYSICS_CONTRIBUTES_LINE, measurePhysicsContribution, physicsLine, type PhysicsContributionLine } from './physicscontrib.ts';
14
15
  /**
15
16
  * The check stage: build a rig through rig-c, gate it under both
16
17
  * profiles, render its idle, and measure the two things the gate cannot see —
@@ -97,7 +98,7 @@ import { createRequire } from 'node:module';
97
98
  import type { Candidate, Piece, Viewport as RootCoverageViewport } from '@rig-c/core/render-shared';
98
99
  import { fillHoles } from './raster/morph.ts';
99
100
  import { closeSync, copyFileSync, cpSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
100
- import { diagnosticSegment, diagnosticSiblings } from './outputpaths.ts';
101
+ import { diagnosticSegment, diagnosticSiblings, unsafeSegmentReason } from './outputpaths.ts';
101
102
  import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
102
103
  import { measureRecomposite, type RecompositeFigures, recompositeRecord, scenePhrase, sourceInRig, figureSilhouette } from './assemble.ts';
103
104
  import { type BoneTransform, computeExactFrameTransforms, cropToSpineY, normaliseDegrees, toBoneLocal } from './coords.ts';
@@ -1070,36 +1071,45 @@ function retainedCheckRenderPlan(source: string) {
1070
1071
  const bytes = readFileSync(index, 'utf8');
1071
1072
  const raw: unknown = JSON.parse(bytes);
1072
1073
  if (!isRecord(raw) || !Array.isArray(raw.sets)) return sidecarProblem(index, 'requires a frames.json sets array to retain a render');
1073
- const seen = new Set<string>();
1074
- const sourceDirs: string[] = [];
1075
- const names: Array<{ name: string; suffix?: string }> = [];
1076
- const sets = raw.sets.map((set: unknown) => {
1077
- if (!isRecord(set) || typeof set.dir !== 'string' || set.dir.length === 0 || isAbsolute(set.dir) || set.dir.split(/[\\/]/).includes('..')) return sidecarProblem(index, 'requires local set directories to retain a render');
1078
- // One render samples every set at the same rate. Preserve the rate suffix
1079
- // on ordinary safe names, but never infer a public name from that suffix.
1080
- const suffix = typeof set.fps === 'number' && set.fps !== IDLE_FPS ? `@${set.fps}fps` : '';
1081
- const dir = typeof set.animation === 'string' ? diagnosticSegment(set.animation, suffix) : diagnosticSegment(set.dir);
1082
- if (seen.has(dir)) return sidecarProblem(index, `retained set directory ${JSON.stringify(dir)} is repeated`);
1083
- seen.add(dir);
1084
- sourceDirs.push(set.dir);
1085
- names.push(typeof set.animation === 'string' ? { name: set.animation, suffix } : { name: set.dir });
1086
- return { ...set, dir };
1074
+ // Issue #1367: rig-c's render names each frame-set folder (rig-c/core#1744)
1075
+ // and records it under sets[].dir. That value is copied as it is, never
1076
+ // rebuilt from the animation's name; it is joined under the output only once
1077
+ // it is one safe path segment, and two that one case-insensitive
1078
+ // filesystem would make one folder are refused before anything is copied.
1079
+ const problems: Problem[] = [];
1080
+ const folded = new Map<string, { at: number; dir: string }>();
1081
+ const dirs = raw.sets.map((set: unknown, i: number): string => {
1082
+ const which = `${index} sets[${i}]` + (isRecord(set) && typeof set.animation === 'string' ? ` (animation ${JSON.stringify(set.animation)})` : '');
1083
+ if (!isRecord(set)) {
1084
+ problems.push({ code: 'FRAMES_SIDECAR', object: which, detail: 'is not an object; a set record with a "dir" is required to retain a render' });
1085
+ return '';
1086
+ }
1087
+ const why = unsafeSegmentReason(set.dir);
1088
+ if (why !== null) {
1089
+ problems.push({ code: 'FRAMES_SIDECAR', object: which, detail: `"dir" ${set.dir === undefined ? '' : JSON.stringify(set.dir) + ' '}${why}; one path segment of [A-Za-z0-9_@+.~-], not ending in ".", not a Windows device name and at most 255 characters is required to retain a render, as rigc render records it from rig-c/core#1744 on — Parts copies "dir" as it is and maps nothing` });
1090
+ return '';
1091
+ }
1092
+ const dir = set.dir as string;
1093
+ const previous = folded.get(dir.toLowerCase());
1094
+ if (previous !== undefined) {
1095
+ problems.push({ code: 'FRAMES_SIDECAR', object: which, detail: `"dir" ${JSON.stringify(dir)} and sets[${previous.at}] "dir" ${JSON.stringify(previous.dir)} are one folder ${JSON.stringify(dir.toLowerCase())} on a case-insensitive filesystem; distinct case-folded set directories are required to retain a render` });
1096
+ } else folded.set(dir.toLowerCase(), { at: i, dir });
1097
+ return dir;
1087
1098
  });
1088
- diagnosticSiblings(names, 'retained render sets');
1089
- return { bytes, raw, sets, sourceDirs };
1099
+ refuseIfAny(problems);
1100
+ return { bytes, dirs };
1090
1101
  }
1091
1102
 
1092
- /** Copy a retained render and bind its index to portable set directories. */
1103
+ /** Copy a retained render: each set's folder and `frames.json` as rigc wrote them (issue #1367). */
1093
1104
  export function retainCheckRender(source: string, target: string): void {
1094
- const { bytes, raw, sets, sourceDirs } = retainedCheckRenderPlan(source);
1105
+ const { bytes, dirs } = retainedCheckRenderPlan(source);
1095
1106
  mkdirSync(target, { recursive: true });
1096
1107
  // Root sidecars and set-local filenames are fixed renderer protocol names.
1097
1108
  for (const entry of readdirSync(source, { withFileTypes: true })) {
1098
1109
  if (entry.isFile() && entry.name !== 'frames.json') copyFileSync(join(source, entry.name), join(target, entry.name));
1099
1110
  }
1100
- sourceDirs.forEach((dir, i) => cpSync(join(source, dir), join(target, sets[i].dir), { recursive: true }));
1101
- const changed = sets.some((set, i) => set.dir !== sourceDirs[i]);
1102
- writeFileSync(join(target, 'frames.json'), changed ? JSON.stringify({ ...raw, sets }, null, 2) + '\n' : bytes);
1111
+ for (const dir of dirs) cpSync(join(source, dir), join(target, dir), { recursive: true });
1112
+ writeFileSync(join(target, 'frames.json'), bytes);
1103
1113
  }
1104
1114
 
1105
1115
  /**
@@ -2834,6 +2844,8 @@ export interface CheckFigures {
2834
2844
  [MOTION_SEAM_LINE]?: MotionSeamLine;
2835
2845
  /** Written only when the rig declares a physics constraint and has an idle (issue #501): {@link ClothLine}, a warning, never a bar. */
2836
2846
  [CLOTH_LINE]?: ClothLine;
2847
+ /** Written only when it reads a part under physics (issue #1320): {@link PhysicsContributionLine}, a warning, never a bar. */
2848
+ [PHYSICS_CONTRIBUTES_LINE]?: PhysicsContributionLine;
2837
2849
  [COINCIDE_LINE]?: SupportReport;
2838
2850
  RECOMPOSITE_HOLES: ReportedLine;
2839
2851
  /** Issue #933: openings inside the figure over motion across undeclared setup-overlapping layer pairs; omitted when SKIP. */
@@ -3268,6 +3280,8 @@ export interface CheckReport {
3268
3280
  behindSeams: BehindSeamsMeasured | null;
3269
3281
  /** `CLOTH_SETTLES` (issue #501): a warning, never a bar — in `check.json` only when the rig declares a physics constraint and has an idle; its SKIP is printed either way. */
3270
3282
  cloth: ClothLine;
3283
+ /** `PHYSICS_CONTRIBUTES` (issue #1320): a warning, never a bar — in `check.json` only when it reads a part under physics; its SKIP is printed either way. */
3284
+ physics?: PhysicsContributionLine;
3271
3285
  /** `WIND_BAND` (issue #590): the steady-wind band each declared seam pair holds, written under `--wind-band` only. */
3272
3286
  windBand?: WindBandLine;
3273
3287
  /**
@@ -3289,9 +3303,9 @@ export function barsSummary(r: Pick<CheckReport, 'bars'>): string {
3289
3303
  return `${measured.length} of ${measured.length + skipped.length} bar(s) measured, ${skipped.length} skipped${skipped.length === 0 ? '' : ` (${skipped.map((s) => s.bar).join(', ')})`}`;
3290
3304
  }
3291
3305
 
3292
- /** The summary's warning clause: each warning line that read something, named, with the warnings they printed together, and `SETUP_PAINTING_MOSTLY_UNCOVERED` only when it printed one (issue #1421); empty when none read. */
3306
+ /** The summary's warning clause: each warning line that read something, named, with the warnings they printed together, and `PHYSICS_CONTRIBUTES` (issue #1320) and `SETUP_PAINTING_MOSTLY_UNCOVERED` only when they printed one (issue #1421); empty when none read. */
3293
3307
  export function warningsClause(r: Pick<CheckReport, 'motionSeam' | 'cloth' | 'figures'>): string {
3294
- const read = [...(r.motionSeam.status === 'SKIP' || (r.motionSeam.roots !== undefined && r.motionSeam.pairs.every(p => p.root !== undefined)) ? [] : [{ name: MOTION_SEAM_LINE, n: r.motionSeam.warnings }]), ...(r.cloth.status === 'SKIP' ? [] : [{ name: CLOTH_LINE, n: r.cloth.warnings }]), ...(setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) === 0 ? [] : [{ name: SETUP_PAINTING_UNCOVERED_WARNING, n: setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) }])];
3308
+ const read = [...(r.motionSeam.status === 'SKIP' || (r.motionSeam.roots !== undefined && r.motionSeam.pairs.every(p => p.root !== undefined)) ? [] : [{ name: MOTION_SEAM_LINE, n: r.motionSeam.warnings }]), ...(r.cloth.status === 'SKIP' ? [] : [{ name: CLOTH_LINE, n: r.cloth.warnings }]), ...((r.figures[PHYSICS_CONTRIBUTES_LINE]?.warnings ?? 0) === 0 ? [] : [{ name: PHYSICS_CONTRIBUTES_LINE, n: r.figures[PHYSICS_CONTRIBUTES_LINE]?.warnings ?? 0 }]), ...(setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) === 0 ? [] : [{ name: SETUP_PAINTING_UNCOVERED_WARNING, n: setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) }])];
3295
3309
  if (read.length === 0) return '';
3296
3310
  return `; ${read.reduce((a, x) => a + x.n, 0)} warning(s) (${read.map((x) => x.name).join(', ')}, not a bar)`;
3297
3311
  }
@@ -3318,7 +3332,7 @@ export type CheckStatus = 'PASS' | 'FAIL' | 'SKIP' | 'WARN' | 'CLEAR' | 'REPORTE
3318
3332
  * never skipped); `loop` SKIP when `loop_max_diff` is null, `seam` SKIP when `seam_mean` is null, otherwise FAIL when
3319
3333
  * {@link barsNotMet} names it and PASS when it does not. Every other block carries its own `status` key and is copied:
3320
3334
  * the judgement lines, then {@link FOLD_LINE}, {@link LEVEL_LINE}, {@link STRESS_LINE}, {@link LIMB_LINE},
3321
- * {@link SWEEP_LINE}, {@link MOTION_SEAM_LINE}, {@link CLOTH_LINE}, the reported lines, {@link SOURCE_LINE} and
3335
+ * {@link SWEEP_LINE}, {@link MOTION_SEAM_LINE}, {@link CLOTH_LINE}, {@link PHYSICS_CONTRIBUTES_LINE}, the reported lines, {@link SOURCE_LINE} and
3322
3336
  * {@link WIND_BAND_LINE}, each where the file writes it. The `requirements` block's lines are not bars and are not read here.
3323
3337
  */
3324
3338
  export function checkStatuses(fig: Omit<CheckFigures, 'spec' | 'bar_outcomes' | 'build'>): Record<string, CheckStatus> {
@@ -3326,7 +3340,7 @@ export function checkStatuses(fig: Omit<CheckFigures, 'spec' | 'bar_outcomes' |
3326
3340
  const bar = (id: 'gate' | 'loop' | 'seam', measured: boolean): CheckStatus => (!measured ? 'SKIP' : checkBarStatus(raw, id) === 'FAIL' ? 'FAIL' : 'PASS');
3327
3341
  const out: Record<string, CheckStatus> = { gate: bar('gate', true), loop: bar('loop', fig.loop_max_diff !== null), seam: bar('seam', fig.seam_mean !== null) };
3328
3342
  for (const n of JUDGEMENT_LINES) out[n] = fig[n].status;
3329
- for (const n of [FOLD_LINE, LEVEL_LINE, STRESS_LINE, LIMB_LINE, SWEEP_LINE, MOTION_SEAM_LINE, CLOTH_LINE, ...REPORTED_LINES, 'figure_openings', SOURCE_LINE, WIND_BAND_LINE, ART_JOINT_LINE, CUT_MATERIAL_LINE, SETUP_PAINTING_LINE, BOUNDARY_COLOUR_LINE, BEHIND_SEAM_LINE, COINCIDE_LINE] as const) {
3343
+ for (const n of [FOLD_LINE, LEVEL_LINE, STRESS_LINE, LIMB_LINE, SWEEP_LINE, MOTION_SEAM_LINE, CLOTH_LINE, PHYSICS_CONTRIBUTES_LINE, ...REPORTED_LINES, 'figure_openings', SOURCE_LINE, WIND_BAND_LINE, ART_JOINT_LINE, CUT_MATERIAL_LINE, SETUP_PAINTING_LINE, BOUNDARY_COLOUR_LINE, BEHIND_SEAM_LINE, COINCIDE_LINE] as const) {
3330
3344
  const l = fig[n];
3331
3345
  if (l !== undefined) out[n] = l.status;
3332
3346
  }
@@ -7426,6 +7440,19 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7426
7440
  cloth = unread === undefined ? clothLine(rows, idle.fps, idle.frames.length, idle.duration) : clothLine([], idle.fps, idle.frames.length, idle.duration, unread);
7427
7441
  }
7428
7442
 
7443
+ // 3g. every part under physics, the same compile posed with physics on and off over the idle (issue #1320): a
7444
+ // warning, never a bar; SKIP, named, with no idle, no parts or no physics constraint
7445
+ let physics: PhysicsContributionLine;
7446
+ if (idle === null) physics = physicsLine([], IDLE_FPS, 0, 'none', "rig-c's default environment", inp.noIdle ?? 'no idle');
7447
+ else if (full === null) physics = physicsLine([], IDLE_FPS, 0, 'none', "rig-c's default environment", inp.noParts ?? 'no parts.json');
7448
+ else {
7449
+ const rest = attachmentPoses(join(idle.dir, GEOMETRY_FILE), idle.written)[0] ?? new Map<string, PosedAttachment>();
7450
+ physics = measurePhysicsContribution(officialRenderer(), buildDir, inp.rig, inp.motion, full.parts.parts.map((p) => ({
7451
+ name: p.name, w: p.w, h: p.h, bound: boundBones(inp.rig, p.name), rest: rest.get(p.name) === undefined ? undefined : { vertices: (rest.get(p.name) as PosedAttachment).rest, triangles: (rest.get(p.name) as PosedAttachment).triangles },
7452
+ art: () => placedArt(p.x, p.y, readPng(join(dirname(inp.partsDir), partImageReference(p).path))),
7453
+ })), inp.stage, idle.fps);
7454
+ }
7455
+
7429
7456
  // 4. the setup pose as a one-key throwaway animation — the seam reads it against the parts, the source line against
7430
7457
  // the painting — and, beside it, the same pose with the eyes shut
7431
7458
  let seam: SeamFigures | null = null;
@@ -7722,6 +7749,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7722
7749
  ...(sweep === null ? {} : { [SWEEP_LINE]: sweep }),
7723
7750
  ...(motionSeam.pairs.length === 0 && motionSeam.roots === undefined && motionSeam.required === undefined ? {} : { [MOTION_SEAM_LINE]: motionSeam }),
7724
7751
  ...(stripped === null || idle === null ? {} : { [CLOTH_LINE]: cloth }),
7752
+ ...(physics.status === 'SKIP' ? {} : { [PHYSICS_CONTRIBUTES_LINE]: physics }),
7725
7753
  RECOMPOSITE_HOLES: inp.parts === null ? { status: 'SKIP', reason: inp.noParts ?? '' } : holesLine(inp.parts),
7726
7754
  ...(figureOpenings.status === 'SKIP' ? {} : { figure_openings: figureOpenings }),
7727
7755
  ...(sourceRead === null ? {} : { [SOURCE_LINE]: sourceRead }),
@@ -7839,6 +7867,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7839
7867
  motionSeam,
7840
7868
  figureOpenings,
7841
7869
  cloth,
7870
+ physics,
7842
7871
  boundaryColour,
7843
7872
  behindSeams,
7844
7873
  ...(sweepSteps.size === 0 ? {} : { sweepSteps }),