rig-parts 2.60.0 → 2.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/docs/AUTHORING.md +84 -40
- package/docs/STABILITY.md +19 -1
- package/package.json +2 -2
- package/src/build.ts +11 -1
- package/src/check.ts +16 -2
- package/src/rig.ts +56 -26
- package/src/scene.ts +33 -4
- package/src/turn.ts +103 -14
- package/src/turnband.ts +418 -0
package/README.md
CHANGED
|
@@ -303,6 +303,7 @@ Command details and config saving are in the [command reference](docs/AUTHORING.
|
|
|
303
303
|
|
|
304
304
|
[docs/DEPTH.md](docs/DEPTH.md) is the feature page for a person: what a depth-driven turn gives you, the two stages that make the sheets, how to pick a painting and how to judge the result.
|
|
305
305
|
See the [depth-driven rigging reference](docs/AUTHORING.md#depth-driven-rigging) for sampled head and body turns and unit-depth precedence.
|
|
306
|
+
The mandatory Core gate checks winding at [declared combinations of generated turn inputs](docs/AUTHORING.md#combined-turn-winding).
|
|
306
307
|
|
|
307
308
|
### Per-layer depth input
|
|
308
309
|
|
package/docs/AUTHORING.md
CHANGED
|
@@ -2509,7 +2509,8 @@ By default, a region listed in `contour.regions` uses `4g²(1 − g)` for
|
|
|
2509
2509
|
`0 < g < 0.5` and uses `g` everywhere else (issue #1578). The cubic starts at
|
|
2510
2510
|
the outer edge with zero slope and meets the inner half with matching value
|
|
2511
2511
|
and slope. Set `falloff: "linear"` on a declared contour region to use `g`
|
|
2512
|
-
throughout the band
|
|
2512
|
+
throughout the band, retain its existing bytes, and opt out of the
|
|
2513
|
+
[coupled turn-band solve](#combined-turn-winding). Other explicit values are
|
|
2513
2514
|
`CONFIG_FIELD_TYPE`. Regions derived from `contour.bust` and automatic mesh
|
|
2514
2515
|
regions keep their linear weighting. Zero-width bands still use a hard edge.
|
|
2515
2516
|
|
|
@@ -2546,6 +2547,13 @@ not: there the islands `source.stray` leaves out are cleared from every reader's
|
|
|
2546
2547
|
`source.stray` below). A lattice mesh's row is
|
|
2547
2548
|
unchanged.
|
|
2548
2549
|
|
|
2550
|
+
When the [coupled turn-band solve](#combined-turn-winding) runs, the mesh
|
|
2551
|
+
row's `coupled_turn_bands` entries name the part and band region, the number
|
|
2552
|
+
of vertices adjusted, the largest change in effective share, the declared
|
|
2553
|
+
slider tuples that triggered the solve, and the outcome. The rig stage also
|
|
2554
|
+
reports a fallback in its diagnostics, which are available even when Core
|
|
2555
|
+
refuses the candidate before `mesh_report.json` is written.
|
|
2556
|
+
|
|
2549
2557
|
**Refusals** — every one names the part, the value found and the value required, and every
|
|
2550
2558
|
contour refusal in a run is listed together; nothing falls back to the lattice:
|
|
2551
2559
|
|
|
@@ -10363,6 +10371,42 @@ recorded unit sheet does not by itself promise different turn geometry.
|
|
|
10363
10371
|
See the [authoring contract](AUTHORING.md#per-layer-depth-sheets-773)
|
|
10364
10372
|
and the [getting-started guide](https://github.com/rig-c/getting-started).
|
|
10365
10373
|
|
|
10374
|
+
#### Combined turn winding
|
|
10375
|
+
|
|
10376
|
+
Parts writes the generated turn inputs to `rig.json` as
|
|
10377
|
+
`invariants.deformSliderCombinations` when it generates at least two dials.
|
|
10378
|
+
Head 2.5D roles generate yaw and pitch. Body roles generate body yaw. Each
|
|
10379
|
+
tuple names every applicable slider and gives its exact endpoint input
|
|
10380
|
+
(`-maxDeg` or `+maxDeg` for that dial), or explicit neutral `0` for the dial held
|
|
10381
|
+
at neutral.
|
|
10382
|
+
If Parts reuses an authored slider and rewrites its dial mapping, the
|
|
10383
|
+
declaration uses that slider's retained name.
|
|
10384
|
+
|
|
10385
|
+
| Generated dials | Declared poses |
|
|
10386
|
+
| --- | --- |
|
|
10387
|
+
| Head yaw and pitch | All four endpoint pairs |
|
|
10388
|
+
| Head yaw, pitch and body yaw | All eight endpoint triples, plus twelve endpoint pairs with the third dial at neutral (four for each choice of neutral dial), for twenty poses |
|
|
10389
|
+
| Fewer than two, including body-only yaw | Declaration omitted. Core reports A53 SKIP. |
|
|
10390
|
+
|
|
10391
|
+
Legacy authored sliders alone do not create declarations. Core 3.10.0's
|
|
10392
|
+
`A53_DECLARED_SLIDER_COMBINATIONS_KEEP_WINDING` poses each declared tuple
|
|
10393
|
+
together through the mandatory build gate. A reversal names the slider inputs,
|
|
10394
|
+
their mapped times and deform keys, the slot and attachment, and the reversed
|
|
10395
|
+
and total triangle counts. The gate refuses the candidate before rig emission.
|
|
10396
|
+
A39 also checks individual dials. A53 reports measured and unmeasured tuple
|
|
10397
|
+
counts for rigs that declare combinations.
|
|
10398
|
+
|
|
10399
|
+
For an eased, explicitly declared contour band shared by the head and body
|
|
10400
|
+
turn fields (#1582), Parts tries a bounded solve only when the generated fields
|
|
10401
|
+
would reverse a triangle at a declared tuple. It adjusts the effective blend
|
|
10402
|
+
shares in the turn deform keys. The authored skin weights and band geometry
|
|
10403
|
+
stay fixed. Even an edit elsewhere in the rig can tip a tuple into folding
|
|
10404
|
+
and trigger the solve, changing the emitted deform bytes at those band
|
|
10405
|
+
vertices. The contour mesh's `coupled_turn_bands` report names the triggering
|
|
10406
|
+
tuples. If the solve cannot keep the required signed area, Parts keeps the
|
|
10407
|
+
original deform fields and reports the fallback. Core's mandatory gate still
|
|
10408
|
+
decides whether the rig is written.
|
|
10409
|
+
|
|
10366
10410
|
### Per-layer depth input
|
|
10367
10411
|
|
|
10368
10412
|
`config.depth` explicitly enables scalar input. Without it, `depth_filename`
|
|
@@ -10582,8 +10626,8 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
|
|
|
10582
10626
|
<!-- check-row-table:begin -->
|
|
10583
10627
|
| Row family | Registered JSON paths | row_scope | row_kind | row_subjects (producer expression) | Producer |
|
|
10584
10628
|
| --- | --- | --- | --- | --- | --- |
|
|
10585
|
-
| `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for e.slot; otherwise [] | [check.ts:
|
|
10586
|
-
| `ANIMATIONS_DO_NOT_FOLD.folding` | `ANIMATIONS_DO_NOT_FOLD.folding` | part when the supplied mapping resolves a piece; otherwise rig | finding when entry === undefined; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:
|
|
10629
|
+
| `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for e.slot; otherwise [] | [check.ts:3745](../src/check.ts#L3745) |
|
|
10630
|
+
| `ANIMATIONS_DO_NOT_FOLD.folding` | `ANIMATIONS_DO_NOT_FOLD.folding` | part when the supplied mapping resolves a piece; otherwise rig | finding when entry === undefined; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:3705](../src/check.ts#L3705) |
|
|
10587
10631
|
| `ART_JOINT_DISTANCE.joints` | `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
|
|
10588
10632
|
| `BEHIND_PART_SEAMS.contributors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples[].contributors`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples[].contributors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:664](../src/behindseams.ts#L664) |
|
|
10589
10633
|
| `BEHIND_PART_SEAMS.hits` | `BEHIND_PART_SEAMS.pairs[].motion_opened.frames`; `BEHIND_PART_SEAMS.pairs[].standing.frames`; `BEHIND_PART_SEAMS.pairs[].motion_opened.worst`; `BEHIND_PART_SEAMS.pairs[].standing.worst` | 'pair' | finding when r.px > allowance; otherwise evidence | parts | [behindseams.ts:750](../src/behindseams.ts#L750) |
|
|
@@ -10599,53 +10643,53 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
|
|
|
10599
10643
|
| `BEHIND_PART_SEAMS.unread_corridors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.unread_corridors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:585](../src/behindseams.ts#L585) |
|
|
10600
10644
|
| `BOUNDARY_COLOUR_STEP.over` | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
|
|
10601
10645
|
| `BOUNDARY_COLOUR_STEP.unmeasured` | `BOUNDARY_COLOUR_STEP.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for r.slot; otherwise [] | [boundarycolour.ts:222](../src/boundarycolour.ts#L222) |
|
|
10602
|
-
| `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:
|
|
10646
|
+
| `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:6194](../src/check.ts#L6194) |
|
|
10603
10647
|
| `CUT_JOINT_MATERIAL.rows` | `CUT_JOINT_MATERIAL.rows` | 'part' | finding when r.status === 'FAIL'; otherwise evidence | [r.part] | [cutmaterial.ts:280](../src/cutmaterial.ts#L280) |
|
|
10604
|
-
| `FEET_STAY_LEVEL.feet` | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:
|
|
10605
|
-
| `FEET_STAY_LEVEL.feet[].worst.through` | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:
|
|
10606
|
-
| `LIMB_ONE_BONE.parts` | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:
|
|
10648
|
+
| `FEET_STAY_LEVEL.feet` | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:3947](../src/check.ts#L3947) |
|
|
10649
|
+
| `FEET_STAY_LEVEL.feet[].worst.through` | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:3922](../src/check.ts#L3922) |
|
|
10650
|
+
| `LIMB_ONE_BONE.parts` | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4240](../src/check.ts#L4240) |
|
|
10607
10651
|
| `PART_SUPPORT_REPORT.pairs` | `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) |
|
|
10608
10652
|
| `PART_SUPPORT_REPORT.raw_pairs` | `PART_SUPPORT_REPORT.raw_pairs` | 'pair' | evidence | [F.name, B.name] | [coincide.ts:110](../src/coincide.ts#L110) |
|
|
10609
10653
|
| `PART_SUPPORT_REPORT.unowned.regions` | `PART_SUPPORT_REPORT.unowned.regions` | 'rig' | finding | [] | [coincide.ts:145](../src/coincide.ts#L145) |
|
|
10610
10654
|
| `PHYSICS_CONTRIBUTES.rows` | `PHYSICS_CONTRIBUTES.rows` | 'part' | evidence; finding when !moves; otherwise evidence | [part] | [physicscontrib.ts:217](../src/physicscontrib.ts#L217), [physicscontrib.ts:220](../src/physicscontrib.ts#L220) |
|
|
10611
|
-
| `SEAM_OVER_MOTION.pairs` | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:
|
|
10612
|
-
| `SEAM_OVER_MOTION.required.pairs` | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
10613
|
-
| `SEAM_OVER_MOTION.required.pairs[].open_frames` | `SEAM_OVER_MOTION.required.pairs[].open_frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:
|
|
10614
|
-
| `SEAM_OVER_MOTION.roots.unmeasured` | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:
|
|
10615
|
-
| `SEAM_OVER_MOTION.rows` | `SEAM_OVER_MOTION.rows` | 'pair'; unique ? 'pair' : 'rig' | finding when motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length); otherwise evidence; finding when motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length); otherwise evidence | [want.a, want.b]; unique ? [pair.a, pair.b] : [] | [check.ts:
|
|
10616
|
-
| `SEAM_OVER_MOTION.rows[].cells` | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
10617
|
-
| `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
10655
|
+
| `SEAM_OVER_MOTION.pairs` | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5591](../src/check.ts#L5591) |
|
|
10656
|
+
| `SEAM_OVER_MOTION.required.pairs` | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:4910](../src/check.ts#L4910) |
|
|
10657
|
+
| `SEAM_OVER_MOTION.required.pairs[].open_frames` | `SEAM_OVER_MOTION.required.pairs[].open_frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:4902](../src/check.ts#L4902) |
|
|
10658
|
+
| `SEAM_OVER_MOTION.roots.unmeasured` | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5568](../src/check.ts#L5568) |
|
|
10659
|
+
| `SEAM_OVER_MOTION.rows` | `SEAM_OVER_MOTION.rows` | 'pair'; unique ? 'pair' : 'rig' | finding when motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length); otherwise evidence; finding when motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length); otherwise evidence | [want.a, want.b]; unique ? [pair.a, pair.b] : [] | [check.ts:5525](../src/check.ts#L5525), [check.ts:5597](../src/check.ts#L5597) |
|
|
10660
|
+
| `SEAM_OVER_MOTION.rows[].cells` | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5538](../src/check.ts#L5538) |
|
|
10661
|
+
| `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5528](../src/check.ts#L5528) |
|
|
10618
10662
|
| `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | 'rig' | evidence | [] | [motionseampose.ts:53](../src/motionseampose.ts#L53) |
|
|
10619
|
-
| `SEAM_OVER_MOTION.worlds.*.rows` | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:
|
|
10620
|
-
| `SEAM_OVER_RANGE.joints` | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:
|
|
10621
|
-
| `SEAM_OVER_RANGE.joints[].poses` | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:
|
|
10663
|
+
| `SEAM_OVER_MOTION.worlds.*.rows` | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5522](../src/check.ts#L5522) |
|
|
10664
|
+
| `SEAM_OVER_RANGE.joints` | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4564](../src/check.ts#L4564), [check.ts:4610](../src/check.ts#L4610) |
|
|
10665
|
+
| `SEAM_OVER_RANGE.joints[].poses` | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4608](../src/check.ts#L4608) |
|
|
10622
10666
|
| `SETUP_MATCHES_PAINTING.regions` | `SETUP_MATCHES_PAINTING.regions` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [setuppainting.ts:175](../src/setuppainting.ts#L175) |
|
|
10623
10667
|
| `SETUP_MATCHES_PAINTING.regions[].slots` | `SETUP_MATCHES_PAINTING.regions[].slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for slot; otherwise [] | [setuppainting.ts:176](../src/setuppainting.ts#L176) |
|
|
10624
10668
|
| `SOURCE_EXPOSURE.rows` | `SOURCE_EXPOSURE.rows` | 'part' | finding when declared !== undefined && r.px > declared.max_px; otherwise evidence | [r.part] | [sourceexposure.ts:292](../src/sourceexposure.ts#L292) |
|
|
10625
10669
|
| `SOURCE_EXPOSURE.unmeasured` | `SOURCE_EXPOSURE.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | finding when declared !== undefined; otherwise evidence | resolved piece for u.slot; otherwise [] | [sourceexposure.ts:293](../src/sourceexposure.ts#L293) |
|
|
10626
|
-
| `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:
|
|
10627
|
-
| `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:
|
|
10628
|
-
| `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:
|
|
10629
|
-
| `STRESS_OFF_CHAIN.per_part` | `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:
|
|
10630
|
-
| `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:
|
|
10631
|
-
| `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:
|
|
10632
|
-
| `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:
|
|
10633
|
-
| `TIP_OVER_ROOT.parts` | `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:
|
|
10634
|
-
| `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
10635
|
-
| `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:
|
|
10636
|
-
| `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:
|
|
10637
|
-
| `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:
|
|
10638
|
-
| `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:
|
|
10639
|
-
| `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:
|
|
10640
|
-
| `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:
|
|
10641
|
-
| `seam_cells.frames` | `frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:
|
|
10642
|
-
| `seam_cells.frames[].cells` | `frames[].cells` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for cell.setupTop ?? ''; otherwise [] | [check.ts:
|
|
10643
|
-
| `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:
|
|
10644
|
-
| `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:
|
|
10645
|
-
| `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:
|
|
10646
|
-
| `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:
|
|
10647
|
-
| `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:
|
|
10648
|
-
| `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:
|
|
10670
|
+
| `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:9366](../src/check.ts#L9366) |
|
|
10671
|
+
| `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:9352](../src/check.ts#L9352), [check.ts:9357](../src/check.ts#L9357) |
|
|
10672
|
+
| `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:4168](../src/check.ts#L4168) |
|
|
10673
|
+
| `STRESS_OFF_CHAIN.per_part` | `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:4156](../src/check.ts#L4156) |
|
|
10674
|
+
| `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:4156](../src/check.ts#L4156) |
|
|
10675
|
+
| `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:4124](../src/check.ts#L4124), [check.ts:4142](../src/check.ts#L4142) |
|
|
10676
|
+
| `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:10016](../src/check.ts#L10016), [check.ts:10026](../src/check.ts#L10026) |
|
|
10677
|
+
| `TIP_OVER_ROOT.parts` | `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:8741](../src/check.ts#L8741), [check.ts:8746](../src/check.ts#L8746), [check.ts:8767](../src/check.ts#L8767), [check.ts:8778](../src/check.ts#L8778) |
|
|
10678
|
+
| `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6698](../src/check.ts#L6698) |
|
|
10679
|
+
| `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6709](../src/check.ts#L6709) |
|
|
10680
|
+
| `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:6015](../src/check.ts#L6015) |
|
|
10681
|
+
| `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7779](../src/check.ts#L7779) |
|
|
10682
|
+
| `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:8109](../src/check.ts#L8109) |
|
|
10683
|
+
| `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:8109](../src/check.ts#L8109) |
|
|
10684
|
+
| `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:8109](../src/check.ts#L8109) |
|
|
10685
|
+
| `seam_cells.frames` | `frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:4899](../src/check.ts#L4899) |
|
|
10686
|
+
| `seam_cells.frames[].cells` | `frames[].cells` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for cell.setupTop ?? ''; otherwise [] | [check.ts:4859](../src/check.ts#L4859) |
|
|
10687
|
+
| `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:2585](../src/check.ts#L2585) |
|
|
10688
|
+
| `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:2063](../src/check.ts#L2063) |
|
|
10689
|
+
| `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2148](../src/check.ts#L2148) |
|
|
10690
|
+
| `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7632](../src/check.ts#L7632) |
|
|
10691
|
+
| `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2519](../src/check.ts#L2519) |
|
|
10692
|
+
| `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2520](../src/check.ts#L2520) |
|
|
10649
10693
|
|
|
10650
10694
|
| Open serialized type path | Reason for schema exclusion |
|
|
10651
10695
|
| --- | --- |
|
package/docs/STABILITY.md
CHANGED
|
@@ -1606,7 +1606,7 @@ in the package.
|
|
|
1606
1606
|
|
|
1607
1607
|
## rig-c
|
|
1608
1608
|
|
|
1609
|
-
`dependencies` takes `@rig-c/core` `3.
|
|
1609
|
+
`dependencies` takes `@rig-c/core` `3.10.0` exactly. Bun 1.4 or later
|
|
1610
1610
|
is the declared floor (`engines.bun` `>=1.4.0`; older 1.4 releases are not tested in
|
|
1611
1611
|
CI, which runs `latest`, and compatibility with an older 1.4 release is handled when
|
|
1612
1612
|
reported as an issue). What this package relies on in rig-c, every import
|
|
@@ -1636,6 +1636,24 @@ install smoke is where that shows first. No Spine runtime is a dependency: an
|
|
|
1636
1636
|
install is gated by rigc's own validator, and `@esotericsoftware/spine-core` is a
|
|
1637
1637
|
development dependency of this repository only.
|
|
1638
1638
|
|
|
1639
|
+
### Generated turn winding
|
|
1640
|
+
|
|
1641
|
+
Core 3.10.0 adds `A53_DECLARED_SLIDER_COMBINATIONS_KEEP_WINDING` to both
|
|
1642
|
+
validators. Parts emits `invariants.deformSliderCombinations` from generated
|
|
1643
|
+
turn mappings, using each slider's actual name, including any retained name
|
|
1644
|
+
when Parts rewrites a reused slider's mapping. Head 2.5D roles generate yaw
|
|
1645
|
+
and pitch and declare all four endpoint pairs. With body yaw also generated,
|
|
1646
|
+
the declaration contains all eight endpoint triples and twelve endpoint pairs
|
|
1647
|
+
with the third dial at explicit neutral `0`, for twenty tuples. Every tuple
|
|
1648
|
+
includes all applicable names and values. With fewer than two generated dials,
|
|
1649
|
+
including body yaw alone, Parts omits the invariant and A53 reports SKIP.
|
|
1650
|
+
Legacy authored sliders alone do not create this invariant.
|
|
1651
|
+
|
|
1652
|
+
The mandatory Core gate can refuse a previously accepted rig before emission.
|
|
1653
|
+
Core's assertion total increases by one, and a rig with no combination
|
|
1654
|
+
declaration gains one skipped assertion. The existing A39 checks still cover
|
|
1655
|
+
individual dials.
|
|
1656
|
+
|
|
1639
1657
|
## What is not stable
|
|
1640
1658
|
|
|
1641
1659
|
- **The evidence documents** under `docs/evidence/`: their layout, columns and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-parts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.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": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"ag-psd": "^31.0.2",
|
|
78
|
-
"@rig-c/core": "3.
|
|
78
|
+
"@rig-c/core": "3.10.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@esotericsoftware/spine-core": "4.3.13",
|
package/src/build.ts
CHANGED
|
@@ -121,7 +121,7 @@ import { type OtherLimbs, splitLines, capOwnershipLines, type SplitCount } from
|
|
|
121
121
|
import type { BoneEntry } from './config.ts';
|
|
122
122
|
import { OPAQUE_ALPHA_ABOVE } from './layers.ts';
|
|
123
123
|
import { pinholesRequired, readRequirements, type RequirementLine, summaryText } from './requirements.ts';
|
|
124
|
-
import { type AutoMeshReport, buildRig, DEFAULT_IDLE_KEYS, type FaceAxis, type IdleKeys, type MeshReport, type RigCommand, rigJsonText, type RigOutput, type RigSpec, SETS_FILE, type StrayCleared, type TurnRow } from './rig.ts';
|
|
124
|
+
import { type AutoMeshReport, buildRig, DEFAULT_IDLE_KEYS, type FaceAxis, type IdleKeys, type MeshReport, rebindRigMotion, type RigCommand, rigJsonText, type RigOutput, type RigSpec, SETS_FILE, type StrayCleared, type TurnRow } from './rig.ts';
|
|
125
125
|
import { KEYPOINT_NAMES, type KeypointName, type PosePoints } from './skeleton.ts';
|
|
126
126
|
import { AUTHOR_NO_ROLE, isAuthorTag } from './tags.ts';
|
|
127
127
|
import { BODY_TURN_ANIM, TURN_BONE } from './turn.ts';
|
|
@@ -2016,6 +2016,11 @@ export function rigStage(input: RigStageInput, rigc: RigcRunner, scratch: string
|
|
|
2016
2016
|
const swapped = JSON.parse(rigJsonText(first.rig)) as RigSpec;
|
|
2017
2017
|
for (const k of chosen) swapped.skins.default[k.part] = { ...swapped.skins.default[k.part], [k.part]: k.candidate.attachment };
|
|
2018
2018
|
rig = { ...first, rig: swapped, meshReport: first.meshReport.map((m) => chosen.find((k) => k.part === m.part)?.candidate.row ?? m) };
|
|
2019
|
+
// The staged contour rows survive an automatic-mesh replacement. Rebind
|
|
2020
|
+
// only when the first gate actually received adjusted shared-band keys.
|
|
2021
|
+
if (first.meshReport.some(row => row.coupled_turn_bands?.some(band => band.outcome === 'adjusted'))) {
|
|
2022
|
+
rebindRigMotion(rig);
|
|
2023
|
+
}
|
|
2019
2024
|
texts = textsOf(rig);
|
|
2020
2025
|
let model: string | null = null;
|
|
2021
2026
|
finalGate = gateThroughRigc(pngs, texts, rigc, scratch, mode, (dir) => (model = modelAt(dir)));
|
|
@@ -2076,6 +2081,11 @@ export function rigStage(input: RigStageInput, rigc: RigcRunner, scratch: string
|
|
|
2076
2081
|
const stray = m.stray_cleared === undefined ? '' : ` stray ${m.stray} left out ${m.stray_cleared.islands} island(s), ${m.stray_cleared.pixels} of ${m.stray_cleared.art_pixels} art px`;
|
|
2077
2082
|
log(`${head}grid=${m.grid} ${infl} loop passes ${rig.loopPasses[m.part]}${stray}`);
|
|
2078
2083
|
}
|
|
2084
|
+
for (const band of m.coupled_turn_bands ?? []) {
|
|
2085
|
+
const target = `${band.slot ?? m.part}/${band.attachment ?? m.part}`;
|
|
2086
|
+
log(` RIG_TURN_COUPLED_BAND: "${target}" region "${band.region}" ${band.outcome}, ${band.vertices_adjusted} adjusted vertices, largest share change ${band.largest_share_change}`);
|
|
2087
|
+
for (const tuple of band.triggering_tuples) log(` mesh triggering tuple: ${tuple.map(({ slider, value }) => `${slider}=${value}`).join(', ')}`);
|
|
2088
|
+
}
|
|
2079
2089
|
}
|
|
2080
2090
|
const regions = rig.rig.slots.length - rig.meshReport.length;
|
|
2081
2091
|
const tracks = rig.motion.animations.idle.tracks;
|
package/src/check.ts
CHANGED
|
@@ -1207,15 +1207,29 @@ export interface LoopPhysics {
|
|
|
1207
1207
|
/**
|
|
1208
1208
|
* A throwaway copy of `rig` whose accompanying `motion` replaces `animations`
|
|
1209
1209
|
* with a synthetic set (`still`, `blink_shut`, `stress ...`, `sweep ...`) omits
|
|
1210
|
-
* any `slider` constraint whose target animation is not in that set
|
|
1210
|
+
* any `slider` constraint whose target animation is not in that set and the
|
|
1211
|
+
* tuples that refer to those removed sliders.
|
|
1211
1212
|
*/
|
|
1212
1213
|
function withoutSliders(rig: Record<string, unknown>, animations: Record<string, unknown>): Record<string, unknown> {
|
|
1213
1214
|
if (!Array.isArray(rig.constraints)) return rig;
|
|
1214
|
-
const
|
|
1215
|
+
const removed = new Set<string>();
|
|
1216
|
+
const kept = rig.constraints.filter((c) => {
|
|
1217
|
+
if (!isRecord(c) || c.type !== 'slider' || typeof c.animation !== 'string' || c.animation in animations) return true;
|
|
1218
|
+
if (typeof c.name === 'string') removed.add(c.name);
|
|
1219
|
+
return false;
|
|
1220
|
+
});
|
|
1215
1221
|
if (kept.length === rig.constraints.length) return rig;
|
|
1216
1222
|
const out: Record<string, unknown> = { ...rig };
|
|
1217
1223
|
if (kept.length > 0) out.constraints = kept;
|
|
1218
1224
|
else delete out.constraints;
|
|
1225
|
+
if (isRecord(rig.invariants) && Array.isArray(rig.invariants.deformSliderCombinations)) {
|
|
1226
|
+
const { deformSliderCombinations, ...invariants } = rig.invariants;
|
|
1227
|
+
const retained = deformSliderCombinations.filter(tuple => !isRecord(tuple) || !Array.isArray(tuple.inputs) ||
|
|
1228
|
+
!tuple.inputs.some(input => isRecord(input) && typeof input.slider === 'string' && removed.has(input.slider)));
|
|
1229
|
+
if (retained.length > 0) out.invariants = { ...invariants, deformSliderCombinations: retained };
|
|
1230
|
+
else if (Object.keys(invariants).length > 0) out.invariants = invariants;
|
|
1231
|
+
else delete out.invariants;
|
|
1232
|
+
}
|
|
1219
1233
|
return out;
|
|
1220
1234
|
}
|
|
1221
1235
|
|
package/src/rig.ts
CHANGED
|
@@ -143,7 +143,7 @@ import { type BoneTransform, computeExactFrameTransforms, computeWorldTransforms
|
|
|
143
143
|
import { foldName, type Problem, refuseIfAny, PartsError } from './errors.ts';
|
|
144
144
|
import { recordedFocusProblems } from './setfocus.ts';
|
|
145
145
|
import { eyeLineDegrees } from './headframe.ts';
|
|
146
|
-
import type { RigBoneInherit, RigStop } from '@rig-c/core/rig';
|
|
146
|
+
import type { RigBoneInherit, RigInvariants, RigStop } from '@rig-c/core/rig';
|
|
147
147
|
import { f32 } from '@rig-c/core/compile';
|
|
148
148
|
import type { MeshCounts, MeshQualityReport, MeshReductionInput, MotionAmplitude, ReducedMesh, Termination } from '@rig-c/core/mesh';
|
|
149
149
|
import { bindWeightedVertices, buildGridMesh, buildSegmentsLattice, type EntrySegment, influenceShares, segmentDistance as rigcSegmentDistance, type SegmentsLattice, type SegmentsLatticeReport } from '@rig-c/core/mesh';
|
|
@@ -190,6 +190,7 @@ import { pyRound } from './round.ts';
|
|
|
190
190
|
import { boneHeat, type HeatDust, heatInfluences, HEAT_LIMITS, heatRow, type HeatRow, latticeSilhouette, tracedSilhouette } from './heat.ts';
|
|
191
191
|
import type { PosePoints } from './skeleton.ts';
|
|
192
192
|
import { applyFaceSurfaceDeform, BODY_REAR_SHIFT_BONE, BODY_YAW_DIAL_BONE, BODYSHIFT_BONE, buildDepth25DTurn, type Depth25DTurnOptions, FACE_RATED_BAND, FACESHIFT_BONE, PITCH_DIAL_BONE, REAR_SHIFT_BONE, resolveTurnGrid, TURN_BONE, TURN_CARRIER_TAG, TURN_GRID_MAX_TRIANGLES_PER_SLOT, TURN_GRID_MAX_TRIANGLES_TOTAL, TURN_PLACES, TURN_RIDER_APART, TURN_RIDER_TAGS, turnRiderDepth, type TurnRole, type TurnSpec, turnConstraintName, turnFractions, turnNearest, turnSurfaceBone, turnTwin, turnUnitBone, YAW_DIAL_BONE } from './turn.ts';
|
|
193
|
+
import type { CoupledTurnBandReport } from './turnband.ts';
|
|
193
194
|
import { DISTANCE_EXPONENT, type FloorForm, type Influence, influences, type InfluenceLimits, type MeshInfluences, meshLimits, type Segment } from './weights.ts';
|
|
194
195
|
import { turnContourBands } from './turnoverlap.ts';
|
|
195
196
|
|
|
@@ -562,6 +563,7 @@ export interface RigSpec {
|
|
|
562
563
|
idleDrivesMeshes?: { why: string };
|
|
563
564
|
detached?: DetachedRule[];
|
|
564
565
|
deformMayFold?: Array<{ slot: string; why: string }>;
|
|
566
|
+
deformSliderCombinations?: RigInvariants['deformSliderCombinations'];
|
|
565
567
|
axes?: RigAxis[];
|
|
566
568
|
meshSlots?: number;
|
|
567
569
|
meshTriangles?: number;
|
|
@@ -849,7 +851,9 @@ export function meshBoundBones(att: Pick<MeshAttachment, 'weights'>): string[] {
|
|
|
849
851
|
}
|
|
850
852
|
|
|
851
853
|
/** One row of `mesh_report.json`: a lattice mesh's row is as it always was; a contour mesh's says so. */
|
|
852
|
-
export type MeshReport = LatticeMeshReport | ContourMeshReport | AutoMeshReport | InfluenceMeshReport | ExplicitMeshReport
|
|
854
|
+
export type MeshReport = (LatticeMeshReport | ContourMeshReport | AutoMeshReport | InfluenceMeshReport | ExplicitMeshReport) & {
|
|
855
|
+
coupled_turn_bands?: CoupledTurnBandReport[];
|
|
856
|
+
};
|
|
853
857
|
|
|
854
858
|
/**
|
|
855
859
|
* An influence mesh's row (issue #378): the lattice's counts and coverage as every row has them, the block as declared,
|
|
@@ -1232,6 +1236,13 @@ export interface RigOutput {
|
|
|
1232
1236
|
sets?: AttachmentSetsFile;
|
|
1233
1237
|
}
|
|
1234
1238
|
|
|
1239
|
+
const RIG_MOTION_REBIND = new WeakMap<MotionSpec, (output: RigOutput) => void>();
|
|
1240
|
+
|
|
1241
|
+
/** Rebind the generated turn and the animation merge hook to a settled replay's rig. */
|
|
1242
|
+
export function rebindRigMotion(output: RigOutput): void {
|
|
1243
|
+
RIG_MOTION_REBIND.get(output.motion)?.(output);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1235
1246
|
/**
|
|
1236
1247
|
* Issue #465: pose a rig's bones so each bone named in `drawn` reaches that
|
|
1237
1248
|
* world rotation (in Spine degrees, CCW, y up), adjusting its local `rotation`
|
|
@@ -2011,6 +2022,7 @@ export function buildWaistPairSource(
|
|
|
2011
2022
|
const skin: RigSpec['skins']['default'] = {};
|
|
2012
2023
|
const meshReport: MeshReport[] = [];
|
|
2013
2024
|
const contourRegionSummaries = new Map<string, NonNullable<NonNullable<Depth25DTurnOptions['surfaceMeshes']>[number]['contourRegions']>>();
|
|
2025
|
+
const contourBandVertices = new Map<string, Array<number | undefined>>();
|
|
2014
2026
|
const outImages: Array<[string, Raster]> = [];
|
|
2015
2027
|
const depthReferences: NonNullable<RigOutput['depthReferences']> = [];
|
|
2016
2028
|
const emitDepth = (part: string, reference: PartDepthReference, scalar: Raster): void => {
|
|
@@ -2143,6 +2155,7 @@ export function buildWaistPairSource(
|
|
|
2143
2155
|
const reached = regions.map(() => 0);
|
|
2144
2156
|
const whole = regions.map(() => 0);
|
|
2145
2157
|
const weighted = regions.map(() => 0);
|
|
2158
|
+
const bandVertices: Array<number | undefined> = [];
|
|
2146
2159
|
let infl = 0;
|
|
2147
2160
|
let maxInfl = 0;
|
|
2148
2161
|
let overlapped = false;
|
|
@@ -2192,6 +2205,7 @@ export function buildWaistPairSource(
|
|
|
2192
2205
|
const shares = writtenShares(li, limits.floor);
|
|
2193
2206
|
if (li.region >= 0 && shares.some((s) => s.bone === regions[li.region].bone && s.weight > 0)) {
|
|
2194
2207
|
weighted[li.region]++;
|
|
2208
|
+
if (li.region < explicitRegions && regions[li.region].falloff !== 'linear') bandVertices[vi] = li.region;
|
|
2195
2209
|
}
|
|
2196
2210
|
const ent: WeightEntry[] = shares.map(({ bone, weight }) => {
|
|
2197
2211
|
const [x, y] = toBoneLocal(world.get(bone) as BoneTransform, spineX(wx), spineY(wy));
|
|
@@ -2211,6 +2225,9 @@ export function buildWaistPairSource(
|
|
|
2211
2225
|
const bones = new Set(segs.map((s) => s.bone));
|
|
2212
2226
|
for (const rg of regions) bones.add(rg.bone);
|
|
2213
2227
|
if (explicitRegions > 0) {
|
|
2228
|
+
// Keep an empty map entry for all-linear contours so the solver uses
|
|
2229
|
+
// the authored opt-out instead of inferring regions from bone names.
|
|
2230
|
+
contourBandVertices.set(p.name, bandVertices);
|
|
2214
2231
|
contourRegionSummaries.set(
|
|
2215
2232
|
p.name,
|
|
2216
2233
|
regions.slice(0, explicitRegions).map((rg, index) => ({
|
|
@@ -3850,9 +3867,14 @@ export function buildWaistPairSource(
|
|
|
3850
3867
|
detail: `setup eye-line roll ${pyRound(line.degrees, 6)} degrees (Spine, counter-clockwise), absolute ${pyRound(Math.abs(line.degrees), 6)} exceeds limit ${pyRound(HEAD_TURN_ROLL_LIMIT, 6)} degrees; read through authored ${EYE_BONES.join(' and ')} origins on ${line.parts.map(n => `"${n}"`).join(' and ')} (an eye-origin proxy, not painting detection); the declared head turn uses upright yaw/pitch axes on an already rolled head; inspect the neck at both turn extremes; warning only, no pose or output changed`,
|
|
3851
3868
|
});
|
|
3852
3869
|
}
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3870
|
+
const hasDepthTurn = cfg.turn?.roles !== undefined || cfg.turn?.body !== undefined;
|
|
3871
|
+
const generateTurn = (target: RigSpec, targetMotion: MotionSpec, report: MeshReport[], warnings?: Problem[]): void => {
|
|
3872
|
+
if (!hasDepthTurn || cfg.turn === undefined) return;
|
|
3873
|
+
const coupledTurnBands = new Map<string, CoupledTurnBandReport[]>();
|
|
3874
|
+
const emitted = new Map(outImages);
|
|
3875
|
+
buildDepth25DTurn(target, targetMotion, {
|
|
3876
|
+
warnings,
|
|
3877
|
+
coupledTurnBands,
|
|
3856
3878
|
turn: cfg.turn,
|
|
3857
3879
|
parts: parts.parts,
|
|
3858
3880
|
images,
|
|
@@ -3861,31 +3883,25 @@ export function buildWaistPairSource(
|
|
|
3861
3883
|
stills,
|
|
3862
3884
|
boneLandmarks,
|
|
3863
3885
|
hasAlternateFaceSet,
|
|
3864
|
-
surfaceMeshes: turnSurfaceMeshes(cfg,
|
|
3865
|
-
neighbourMeshes: turnNeighbourMeshes(cfg,
|
|
3866
|
-
coverageMeshes: cfg.turn.body === undefined ? undefined : turnNeighbourMeshes(cfg,
|
|
3886
|
+
surfaceMeshes: turnSurfaceMeshes(cfg, target, parts.rig_size, contourRegionSummaries, contourBandVertices),
|
|
3887
|
+
neighbourMeshes: turnNeighbourMeshes(cfg, target, parts, emitted),
|
|
3888
|
+
coverageMeshes: warnings === undefined || cfg.turn.body === undefined ? undefined : turnNeighbourMeshes(cfg, target, parts, emitted, true),
|
|
3867
3889
|
});
|
|
3868
|
-
|
|
3869
|
-
|
|
3890
|
+
for (const [i, row] of report.entries()) {
|
|
3891
|
+
const bands = coupledTurnBands.get(row.part);
|
|
3892
|
+
if (bands === undefined && row.coupled_turn_bands === undefined) continue;
|
|
3893
|
+
const { coupled_turn_bands: _previous, ...rest } = row;
|
|
3894
|
+
report[i] = bands === undefined ? rest : { ...rest, coupled_turn_bands: bands };
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
const bindMotion = (target: RigSpec, targetMotion: MotionSpec, report: MeshReport[]): void => bindFaceSurfaceDeform(targetMotion, (merged) => {
|
|
3870
3898
|
if (cfg.waist !== undefined) refuseSharedWaistMotion(merged, cfg.waist.top, cfg.waist.bone);
|
|
3871
3899
|
remapWaistDeforms(merged, waistTargets, waistRegionTargets, waistBindingsBeforeRebind);
|
|
3872
|
-
expandSetAttachmentKeys(
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
turn: cfg.turn,
|
|
3876
|
-
parts: parts.parts,
|
|
3877
|
-
images,
|
|
3878
|
-
contourBands: turnContourBands(cfg.meshes),
|
|
3879
|
-
regions: cfg.regions,
|
|
3880
|
-
stills,
|
|
3881
|
-
boneLandmarks,
|
|
3882
|
-
hasAlternateFaceSet,
|
|
3883
|
-
surfaceMeshes: turnSurfaceMeshes(cfg, rig, parts.rig_size, contourRegionSummaries),
|
|
3884
|
-
neighbourMeshes: turnNeighbourMeshes(cfg, rig, parts, new Map(outImages)),
|
|
3885
|
-
});
|
|
3886
|
-
}
|
|
3900
|
+
expandSetAttachmentKeys(target, sets, merged);
|
|
3901
|
+
// Generated 2.5D axes keep their precedence over same-named imports.
|
|
3902
|
+
generateTurn(target, merged, report);
|
|
3887
3903
|
if (cfg.turn?.roles === undefined && (cfg.turn === undefined || cfg.turn.body === undefined || cfg.turn.depths !== undefined)) {
|
|
3888
|
-
applyFaceSurfaceDeform(
|
|
3904
|
+
applyFaceSurfaceDeform(target, merged, {
|
|
3889
3905
|
imageWidth: faceImg?.width,
|
|
3890
3906
|
imageHeight: faceImg?.height,
|
|
3891
3907
|
opaqueWidth: facePart?.w,
|
|
@@ -3905,6 +3921,17 @@ export function buildWaistPairSource(
|
|
|
3905
3921
|
}
|
|
3906
3922
|
}
|
|
3907
3923
|
});
|
|
3924
|
+
generateTurn(rig, motion, meshReport, turnWarnings);
|
|
3925
|
+
bindMotion(rig, motion, meshReport);
|
|
3926
|
+
if (hasDepthTurn) {
|
|
3927
|
+
RIG_MOTION_REBIND.set(motion, (output) => {
|
|
3928
|
+
const { rig: target, motion: source, meshReport: report } = output;
|
|
3929
|
+
const reboundMotion = { ...source, groups: { ...source.groups }, animations: { ...source.animations } };
|
|
3930
|
+
generateTurn(target, reboundMotion, report);
|
|
3931
|
+
bindMotion(target, reboundMotion, report);
|
|
3932
|
+
output.motion = reboundMotion;
|
|
3933
|
+
});
|
|
3934
|
+
}
|
|
3908
3935
|
return {
|
|
3909
3936
|
rig,
|
|
3910
3937
|
motion,
|
|
@@ -4387,6 +4414,7 @@ function turnSurfaceMeshes(
|
|
|
4387
4414
|
rig: RigSpec,
|
|
4388
4415
|
canvas: readonly [number, number],
|
|
4389
4416
|
contourRegions?: ReadonlyMap<string, NonNullable<NonNullable<Depth25DTurnOptions['surfaceMeshes']>[number]['contourRegions']>>,
|
|
4417
|
+
contourBandVertices?: ReadonlyMap<string, ReadonlyArray<number | undefined>>,
|
|
4390
4418
|
) {
|
|
4391
4419
|
const meshes = [];
|
|
4392
4420
|
for (const part of Object.keys(cfg.meshes)) {
|
|
@@ -4402,6 +4430,7 @@ function turnSurfaceMeshes(
|
|
|
4402
4430
|
throw new PartsError([{ code: 'RIG_TURN_SURFACE_MESH_ATTACHMENT', object: `surface mesh "${slot.name}/${attachment}"`, detail: `requires the base drawing "${part}"; alternate drawings need their own registered depth sampling frame` }]);
|
|
4403
4431
|
}
|
|
4404
4432
|
const regionsForPart = firstForPart ? contourRegions?.get(part) : undefined;
|
|
4433
|
+
const bandVertices = part === slot.name && part === attachment ? contourBandVertices?.get(part) : undefined;
|
|
4405
4434
|
firstForPart = false;
|
|
4406
4435
|
meshes.push({
|
|
4407
4436
|
part,
|
|
@@ -4411,6 +4440,7 @@ function turnSurfaceMeshes(
|
|
|
4411
4440
|
triangles: att.triangles,
|
|
4412
4441
|
canvas,
|
|
4413
4442
|
...(regionsForPart === undefined ? {} : { contourRegions: regionsForPart }),
|
|
4443
|
+
...(bandVertices === undefined ? {} : { contourBandVertices: bandVertices }),
|
|
4414
4444
|
});
|
|
4415
4445
|
}
|
|
4416
4446
|
}
|