spine-parts 2.17.0 → 2.18.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/AUTHORING.md +39 -39
- package/package.json +1 -1
- package/src/boundarycolour.ts +2 -1
- package/src/check.ts +42 -2
package/docs/AUTHORING.md
CHANGED
|
@@ -5592,7 +5592,7 @@ documents do not ship). Each is an input this package built; none is an author's
|
|
|
5592
5592
|
| <a id="CHECK_SETUP_PAINTING_SOURCE"></a>`CHECK_SETUP_PAINTING_SOURCE` | a declaration without a source painting | supply `--source`; the assembled composite is not an independent reference |
|
|
5593
5593
|
| <a id="CHECK_SETUP_PAINTING_MEASURED"></a>`CHECK_SETUP_PAINTING_MEASURED` | missing native setup/ownership or unsupported clipping | supply observable textured setup geometry; an unavailable instrument never passes |
|
|
5594
5594
|
| <a id="CHECK_BOUNDARY_COLOUR_STEP"></a>`CHECK_BOUNDARY_COLOUR_STEP` | the requirements file declares `boundary_colour.max_step_excess` and a part boundary's colour step in the rig's render exceeds the same boundary's step in the rig's own pieces by more than it; the part pair, the frame (`setup` or `idle frame <n> (t <s> s)`), the stage pixel, the excess, the declared allowance and both steps are quoted. Unlike [`CHECK_SETUP_MATCHES_PAINTING`](#CHECK_SETUP_MATCHES_PAINTING), which compares the painting per declared region at the setup pose, this compares against the rig's own flat pieces (`parts.json` placement at setup, each piece's rest colour through its art UVs on every idle frame), so a part drawn over its neighbour's line art is not a failure | the pair's rig image or mesh: `rig/images/<part>.png` (a texture stretched into its padded UVs, or a notch cut out of it), or that part's mesh in `config.json` `meshes` when the mesh cuts a corner off the art; see [Boundary colour step](#boundary-colour-step-issue-942) |
|
|
5595
|
-
| <a id="CHECK_BOUNDARY_COLOUR_UNMEASURED"></a>`CHECK_BOUNDARY_COLOUR_UNMEASURED` | `boundary_colour` is declared and the step cannot be taken: no `parts.json
|
|
5595
|
+
| <a id="CHECK_BOUNDARY_COLOUR_UNMEASURED"></a>`CHECK_BOUNDARY_COLOUR_UNMEASURED` | `boundary_colour` is declared and the step cannot be taken: no `parts.json`, no `idle`, or a default-skin region or mesh image without a sequence, with a parts record, whose rig image is not its parts PNG with one even pad on every side (refused before anything is built); otherwise a drawn slot has no `parts.json` piece, is clipped, or its rig image is not its parts PNG with one even pad on every side (the slot and frame are named). Never a pass | make every drawn slot a `parts.json` piece, or drop `boundary_colour` from the requirements file (the bar then reports SKIP) |
|
|
5596
5596
|
| <a id="SETUP_PAINTING_REQUIRED_LIMIT"></a>`SETUP_PAINTING_REQUIRED_LIMIT` | `setup_painting.required` is `true` and a limit the check needs is absent: `rgb_tolerance`, `regions`, or a region's `max_pixels` (the object names the region). Refused when the requirements file is read, before anything is built (issue #943) | author the named limit; none is derived from the art. Without `required` the same region reports SKIP |
|
|
5597
5597
|
| <a id="CHECK_SOURCE_GRID"></a>`CHECK_SOURCE_GRID` | the setup-pose still and its black-tinted twin (the coverage `SETUP_POSE_VS_SOURCE` reads) did not come back on one grid over one opaque background | a rigc problem; report it |
|
|
5598
5598
|
| <a id="CHECK_RIGC_VERSION"></a>`CHECK_RIGC_VERSION` | `rigc --version` is below 1.4.0, or prints no version: its `render` has no `--geometry`, which `TEXTURE_STRETCH` reads. Refused before anything is built | `bun install` (this package depends on rig-c ^2.20.4), or put a newer `rigc` first on `PATH` |
|
|
@@ -8012,50 +8012,50 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
|
|
|
8012
8012
|
<!-- check-row-table:begin -->
|
|
8013
8013
|
| Row family | row_scope | row_kind | row_subjects (producer expression) | Producer |
|
|
8014
8014
|
| --- | --- | --- | --- | --- |
|
|
8015
|
-
| `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | 'part' | finding | [e.slot] | [check.ts:
|
|
8016
|
-
| `ANIMATIONS_DO_NOT_FOLD.folding` | 'part' | finding when entry === undefined; otherwise evidence | [slot] | [check.ts:
|
|
8015
|
+
| `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | 'part' | finding | [e.slot] | [check.ts:3516](../src/check.ts#L3516) |
|
|
8016
|
+
| `ANIMATIONS_DO_NOT_FOLD.folding` | 'part' | finding when entry === undefined; otherwise evidence | [slot] | [check.ts:3478](../src/check.ts#L3478) |
|
|
8017
8017
|
| `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
|
|
8018
|
-
| `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:
|
|
8019
|
-
| `BOUNDARY_COLOUR_STEP.unmeasured` | 'part' | evidence | [r.slot] | [boundarycolour.ts:
|
|
8020
|
-
| `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:
|
|
8018
|
+
| `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:220](../src/boundarycolour.ts#L220) |
|
|
8019
|
+
| `BOUNDARY_COLOUR_STEP.unmeasured` | 'part' | evidence | [r.slot] | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
|
|
8020
|
+
| `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:5801](../src/check.ts#L5801) |
|
|
8021
8021
|
| `CUT_JOINT_MATERIAL.rows` | 'part' | finding when r.status === 'FAIL'; otherwise evidence | [r.part] | [cutmaterial.ts:280](../src/cutmaterial.ts#L280) |
|
|
8022
|
-
| `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:
|
|
8023
|
-
| `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:
|
|
8024
|
-
| `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:
|
|
8022
|
+
| `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:3717](../src/check.ts#L3717) |
|
|
8023
|
+
| `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:3692](../src/check.ts#L3692) |
|
|
8024
|
+
| `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4009](../src/check.ts#L4009) |
|
|
8025
8025
|
| `PART_SUPPORT_REPORT.pairs` | 'pair' | evidence; finding when length > 0; otherwise evidence | [F.name, B.name] | [coincide.ts:114](../src/coincide.ts#L114), [coincide.ts:130](../src/coincide.ts#L130) |
|
|
8026
8026
|
| `PART_SUPPORT_REPORT.raw_pairs` | 'pair' | evidence | [F.name, B.name] | [coincide.ts:110](../src/coincide.ts#L110) |
|
|
8027
8027
|
| `PART_SUPPORT_REPORT.unowned.regions` | 'rig' | finding | [] | [coincide.ts:145](../src/coincide.ts#L145) |
|
|
8028
|
-
| `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:
|
|
8029
|
-
| `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
8030
|
-
| `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:
|
|
8031
|
-
| `SEAM_OVER_MOTION.rows` | 'pair' | finding when p.status === 'read' && opens.length > 0; otherwise evidence; finding when r.status === 'read' && r.opens.length > 0; otherwise evidence | [want.a, want.b]; pairs.filter(p => p.pair === r.pair).flatMap(p => [p.a, p.b]) | [check.ts:
|
|
8032
|
-
| `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
8033
|
-
| `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
8028
|
+
| `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5202](../src/check.ts#L5202) |
|
|
8029
|
+
| `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:4610](../src/check.ts#L4610) |
|
|
8030
|
+
| `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5179](../src/check.ts#L5179) |
|
|
8031
|
+
| `SEAM_OVER_MOTION.rows` | 'pair' | finding when p.status === 'read' && opens.length > 0; otherwise evidence; finding when r.status === 'read' && r.opens.length > 0; otherwise evidence | [want.a, want.b]; pairs.filter(p => p.pair === r.pair).flatMap(p => [p.a, p.b]) | [check.ts:5141](../src/check.ts#L5141), [check.ts:5205](../src/check.ts#L5205) |
|
|
8032
|
+
| `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5154](../src/check.ts#L5154) |
|
|
8033
|
+
| `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5144](../src/check.ts#L5144) |
|
|
8034
8034
|
| `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | 'rig' | evidence | [] | [motionseampose.ts:53](../src/motionseampose.ts#L53) |
|
|
8035
|
-
| `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
8036
|
-
| `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:
|
|
8037
|
-
| `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:
|
|
8035
|
+
| `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5138](../src/check.ts#L5138) |
|
|
8036
|
+
| `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4333](../src/check.ts#L4333), [check.ts:4379](../src/check.ts#L4379) |
|
|
8037
|
+
| `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4377](../src/check.ts#L4377) |
|
|
8038
8038
|
| `SETUP_MATCHES_PAINTING.regions` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [setuppainting.ts:174](../src/setuppainting.ts#L174) |
|
|
8039
8039
|
| `SETUP_MATCHES_PAINTING.regions[].slots` | slot === '(uncovered)' ? 'rig' : 'part' | evidence | slot === '(uncovered)' ? [] : [slot] | [setuppainting.ts:175](../src/setuppainting.ts#L175) |
|
|
8040
|
-
| `STILL_REGIONS_DARK.*.crossing` | 'part' | finding | [sl.name] | [check.ts:
|
|
8041
|
-
| `STILL_REGIONS_DARK.*.still_slots` | 'part' | evidence; finding when r.max > tolerance; otherwise evidence | [slot] | [check.ts:
|
|
8042
|
-
| `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:
|
|
8043
|
-
| `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:
|
|
8044
|
-
| `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:
|
|
8045
|
-
| `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:
|
|
8046
|
-
| `TEXTURE_STRETCH.per_mesh` | 'part' | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | [m.slot] | [check.ts:
|
|
8047
|
-
| `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:
|
|
8048
|
-
| `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
8049
|
-
| `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
8050
|
-
| `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:
|
|
8051
|
-
| `loop_physics` | 'rig' | evidence | [] | [check.ts:
|
|
8052
|
-
| `requirements.lines.* (bone)` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:
|
|
8053
|
-
| `requirements.lines.* (seam)` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:
|
|
8054
|
-
| `requirements.lines.* (stretch)` | 'part' | finding when line.status === 'FAIL'; otherwise evidence | [r.slot] | [check.ts:
|
|
8055
|
-
| `seam_pairs` | pair[0] === SEAM_NO_ART ? 'rig' : pair[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | pair.filter(p => p !== SEAM_NO_ART) | [check.ts:
|
|
8056
|
-
| `seam_scope.changes` | 'rig' | evidence | [] | [check.ts:
|
|
8057
|
-
| `seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:
|
|
8058
|
-
| `seam_scope.pairs` | row.parts[0] === SEAM_NO_ART ? 'rig' : row.parts[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | row.parts.filter(p => p !== SEAM_NO_ART) | [check.ts:
|
|
8059
|
-
| `seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:
|
|
8060
|
-
| `seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:
|
|
8040
|
+
| `STILL_REGIONS_DARK.*.crossing` | 'part' | finding | [sl.name] | [check.ts:8744](../src/check.ts#L8744) |
|
|
8041
|
+
| `STILL_REGIONS_DARK.*.still_slots` | 'part' | evidence; finding when r.max > tolerance; otherwise evidence | [slot] | [check.ts:8730](../src/check.ts#L8730), [check.ts:8735](../src/check.ts#L8735) |
|
|
8042
|
+
| `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:3937](../src/check.ts#L3937) |
|
|
8043
|
+
| `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:3925](../src/check.ts#L3925) |
|
|
8044
|
+
| `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:3925](../src/check.ts#L3925) |
|
|
8045
|
+
| `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:3893](../src/check.ts#L3893), [check.ts:3911](../src/check.ts#L3911) |
|
|
8046
|
+
| `TEXTURE_STRETCH.per_mesh` | 'part' | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | [m.slot] | [check.ts:9378](../src/check.ts#L9378), [check.ts:9388](../src/check.ts#L9388) |
|
|
8047
|
+
| `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8160](../src/check.ts#L8160), [check.ts:8165](../src/check.ts#L8165), [check.ts:8186](../src/check.ts#L8186), [check.ts:8197](../src/check.ts#L8197) |
|
|
8048
|
+
| `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6305](../src/check.ts#L6305) |
|
|
8049
|
+
| `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6316](../src/check.ts#L6316) |
|
|
8050
|
+
| `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:5622](../src/check.ts#L5622) |
|
|
8051
|
+
| `loop_physics` | 'rig' | evidence | [] | [check.ts:7283](../src/check.ts#L7283) |
|
|
8052
|
+
| `requirements.lines.* (bone)` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:7579](../src/check.ts#L7579) |
|
|
8053
|
+
| `requirements.lines.* (seam)` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:7579](../src/check.ts#L7579) |
|
|
8054
|
+
| `requirements.lines.* (stretch)` | 'part' | finding when line.status === 'FAIL'; otherwise evidence | [r.slot] | [check.ts:7579](../src/check.ts#L7579) |
|
|
8055
|
+
| `seam_pairs` | pair[0] === SEAM_NO_ART ? 'rig' : pair[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | pair.filter(p => p !== SEAM_NO_ART) | [check.ts:2479](../src/check.ts#L2479) |
|
|
8056
|
+
| `seam_scope.changes` | 'rig' | evidence | [] | [check.ts:1958](../src/check.ts#L1958) |
|
|
8057
|
+
| `seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2043](../src/check.ts#L2043) |
|
|
8058
|
+
| `seam_scope.pairs` | row.parts[0] === SEAM_NO_ART ? 'rig' : row.parts[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | row.parts.filter(p => p !== SEAM_NO_ART) | [check.ts:7193](../src/check.ts#L7193) |
|
|
8059
|
+
| `seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2414](../src/check.ts#L2414) |
|
|
8060
|
+
| `seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2415](../src/check.ts#L2415) |
|
|
8061
8061
|
<!-- check-row-table:end -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-parts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/boundarycolour.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { readPng } from './raster/png.ts';
|
|
|
33
33
|
export const BOUNDARY_COLOUR_LINE = 'BOUNDARY_COLOUR_STEP';
|
|
34
34
|
export const BOUNDARY_COLOUR_CODE = 'CHECK_BOUNDARY_COLOUR_STEP';
|
|
35
35
|
export const BOUNDARY_COLOUR_UNMEASURED_CODE = 'CHECK_BOUNDARY_COLOUR_UNMEASURED';
|
|
36
|
+
export const BOUNDARY_COLOUR_UNMEASURED_SUFFIX = "; the step against the rig's own pieces cannot be taken, and an untaken reading is never a pass — make the slot draw a parts.json piece, or drop boundary_colour from the requirements file and the bar reports SKIP";
|
|
36
37
|
export const UNDECLARED_BOUNDARY_COLOUR_REASON = 'not measured, not a pass: no requirements file declares boundary_colour; declare {"boundary_colour": {"max_step_excess": <0-255>}} in the --requirements file (config.requirements under build) to hold every part boundary of the setup and every idle frame to the rig\'s own pieces';
|
|
37
38
|
|
|
38
39
|
/** The one declaration: the largest step excess (0-255) the rig allows over its own pieces. No default exists. */
|
|
@@ -206,7 +207,7 @@ export function measureBoundaryColour(api: Api, input: BoundaryColourInput, decl
|
|
|
206
207
|
readFrame(setup, 'setup', true);
|
|
207
208
|
for (const frame of idle) readFrame(frame, `idle frame ${frame.index} (t ${+frame.time.toFixed(4)} s)`, false);
|
|
208
209
|
const over = [...pairsWorst.entries()].sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0)).map(([, v]) => v).filter((v) => v.excess > declared.max_step_excess);
|
|
209
|
-
for (const u of unmeasured) problems.push({ code: BOUNDARY_COLOUR_UNMEASURED_CODE, object: `slot "${u.slot}" (${u.frame})`, detail: `${u.reason}
|
|
210
|
+
for (const u of unmeasured) problems.push({ code: BOUNDARY_COLOUR_UNMEASURED_CODE, object: `slot "${u.slot}" (${u.frame})`, detail: `${u.reason}${BOUNDARY_COLOUR_UNMEASURED_SUFFIX}` });
|
|
210
211
|
for (const o of over) problems.push({ code: BOUNDARY_COLOUR_CODE, object: `part pair "${o.parts[0]}|${o.parts[1]}"`, detail: `${o.frame}, stage pixel (${o.at[0]}, ${o.at[1]}): step excess ${o.excess} > declared max_step_excess ${declared.max_step_excess} (rendered step ${o.rendered_step}, the rig's own pieces ${o.reference_step}); a texture stretched into its padded UVs or a notch cut out of a piece shows here — fix the rig image or mesh of that pair (AUTHORING, failure map)` });
|
|
211
212
|
return {
|
|
212
213
|
status: over.length === 0 && unmeasured.length === 0 ? 'PASS' : 'FAIL',
|
package/src/check.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { SETUP_PAINTING_LINE, UNDECLARED_SETUP_PAINTING_REASON, setupPaintingBou
|
|
|
7
7
|
import { readMaterialSources } from './cutmaterialio.ts';
|
|
8
8
|
import { CUT_MATERIAL_LINE, checkJointMaterial, type MaterialLine } from './cutmaterial.ts';
|
|
9
9
|
import { ART_JOINT_LINE, artJointLine, type ArtJointLine } from './artjoints.ts';
|
|
10
|
-
import { BOUNDARY_COLOUR_LINE, BOUNDARY_COLOUR_UNMEASURED_CODE, measureBoundaryColour, type BoundaryColourMeasured } from './boundarycolour.ts';
|
|
10
|
+
import { BOUNDARY_COLOUR_LINE, BOUNDARY_COLOUR_UNMEASURED_CODE, BOUNDARY_COLOUR_UNMEASURED_SUFFIX, measureBoundaryColour, type BoundaryColourMeasured } from './boundarycolour.ts';
|
|
11
11
|
import { baseAnchorMoves, type AnchorRegion } from './baseanchor.ts';
|
|
12
12
|
/**
|
|
13
13
|
* The check stage: build a rig through rig-c, gate it under both
|
|
@@ -1858,6 +1858,43 @@ export function seamDrawingSignature(input: {
|
|
|
1858
1858
|
return JSON.stringify(seamSourceValue({ slot: input.slot, attachment: input.attachment, source, image: input.image, vertices: input.vertices, color: input.color }));
|
|
1859
1859
|
}
|
|
1860
1860
|
|
|
1861
|
+
/** File-only rig-image padding checks after the parts loader has validated each PNG against its record. */
|
|
1862
|
+
export function boundaryColourSizeProblems(inp: CheckInputs): Problem[] {
|
|
1863
|
+
if (inp.parts === null) return [];
|
|
1864
|
+
const records = new Set(inp.parts.parts.map(p => p.name));
|
|
1865
|
+
const imagesDir = typeof inp.rig.images === 'string' ? resolve(inp.rigDir, inp.rig.images) : join(inp.rigDir, 'images');
|
|
1866
|
+
const problems: Problem[] = [];
|
|
1867
|
+
const seen = new Set<string>();
|
|
1868
|
+
const skins = isRecord(inp.rig.skins) ? inp.rig.skins : null;
|
|
1869
|
+
const skin = skins !== null && isRecord(skins.default) ? skins.default : null;
|
|
1870
|
+
if (skin === null) return problems;
|
|
1871
|
+
for (const [slot, drawings] of Object.entries(skin)) {
|
|
1872
|
+
if (!isRecord(drawings)) continue;
|
|
1873
|
+
for (const source of Object.values(drawings)) {
|
|
1874
|
+
if (!seamImageSource(source) || seen.has(source.image)) continue;
|
|
1875
|
+
const image = source.image;
|
|
1876
|
+
seen.add(image);
|
|
1877
|
+
const name = image.replace(/\.png$/, '');
|
|
1878
|
+
const partPng = join(inp.partsDir, `${name}.png`), rigPng = join(imagesDir, image);
|
|
1879
|
+
if (!records.has(name) || !existsSync(partPng) || !existsSync(rigPng)) continue;
|
|
1880
|
+
let src: Raster, rigImg: Raster;
|
|
1881
|
+
try { src = readPng(partPng); rigImg = readPng(rigPng); }
|
|
1882
|
+
catch { continue; }
|
|
1883
|
+
const dx = rigImg.width - src.width, dy = rigImg.height - src.height;
|
|
1884
|
+
const reason = dx !== dy || dx < 0 || dx % 2 !== 0
|
|
1885
|
+
? `the rig image "${image}" is ${rigImg.width}x${rigImg.height}, not parts/${name}.png's ${src.width}x${src.height} with one even pad on every side`
|
|
1886
|
+
: null;
|
|
1887
|
+
if (reason !== null) problems.push({ code: BOUNDARY_COLOUR_UNMEASURED_CODE, object: `slot "${slot}" (image "${image}")`, detail: `${reason}${BOUNDARY_COLOUR_UNMEASURED_SUFFIX}` });
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
return problems;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
/** The image mapping supported by seam and boundary-colour source readers. */
|
|
1894
|
+
function seamImageSource(source: unknown): source is Record<string, unknown> & { image: string } {
|
|
1895
|
+
return isRecord(source) && ['region', 'mesh'].includes(typeof source.type === 'string' ? source.type : 'region') && typeof source.image === 'string' && source.image.length > 0 && source.sequence === undefined;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1861
1898
|
/** Resolve only the actually selected default-skin identity, not a filename suffix. */
|
|
1862
1899
|
export function seamSourceAttachment(rig: Record<string, unknown>, slot: string, attachment: string): Record<string, unknown> {
|
|
1863
1900
|
const skins = isRecord(rig.skins) ? rig.skins : null;
|
|
@@ -1867,7 +1904,7 @@ export function seamSourceAttachment(rig: Record<string, unknown>, slot: string,
|
|
|
1867
1904
|
const matches = Object.entries(drawings).filter(([key, value]) => isRecord(value) && (typeof value.name === 'string' ? value.name : key) === attachment);
|
|
1868
1905
|
if (matches.length !== 1) throw new SeamSupportError({ code: matches.length === 0 ? 'SOURCE_ATTACHMENT_MISSING' : 'SOURCE_ATTACHMENT_AMBIGUOUS', slot, attachment });
|
|
1869
1906
|
const source = matches[0][1];
|
|
1870
|
-
if (!
|
|
1907
|
+
if (!seamImageSource(source)) {
|
|
1871
1908
|
throw new SeamSupportError({ code: 'SOURCE_MAPPING_UNSUPPORTED', slot, attachment, feature: 'sequence-or-non-image-attachment' });
|
|
1872
1909
|
}
|
|
1873
1910
|
return source;
|
|
@@ -6459,6 +6496,9 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
|
|
|
6459
6496
|
...(ready.parts === null ? [{ code: BOUNDARY_COLOUR_UNMEASURED_CODE, object: 'requirements.boundary_colour', detail: `requires parts.json and its parts/ PNGs, the rig's own pieces the step is measured against: ${ready.noParts ?? 'none was read'}; an untaken reading is never a pass` }] : []),
|
|
6460
6497
|
...(ready.idleDuration === null ? [{ code: BOUNDARY_COLOUR_UNMEASURED_CODE, object: 'requirements.boundary_colour', detail: `requires an idle animation, whose every frame is measured: ${ready.noIdle ?? 'none was read'}; an untaken reading is never a pass` }] : []),
|
|
6461
6498
|
]));
|
|
6499
|
+
if (file.boundary_colour !== undefined && ready.parts !== null && ready.idleDuration !== null) {
|
|
6500
|
+
take(() => refuseIfAny(boundaryColourSizeProblems(ready)));
|
|
6501
|
+
}
|
|
6462
6502
|
take(() => refuseIfAny(exceptionProblems(file, ready.parts, ready.noParts)));
|
|
6463
6503
|
// A seam's pairs are read off parts.json's art (issue #111); both resolvers' problems are named in one refusal.
|
|
6464
6504
|
if (file.requirements.some((r) => r.kind === 'seam')) {
|