@rig-c/parts 1.61.0 → 1.63.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/src/build.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { alternateLayerSources, alternateLayerIslands, alternateLayerOthers } from './alternatelayers.ts';
2
+ import { setFocusProblems } from './setfocus.ts';
2
3
  /**
3
4
  * The stages as callable units, and `build`, which runs three of them in a row.
4
5
  *
@@ -343,6 +344,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
343
344
  anchor?: NonNullable<typeof cfg.assemble.alternates>[number]['anchor'];
344
345
  drawn?: Record<string, number>;
345
346
  tips?: Record<string, [number, number]>;
347
+ focus?: [number, number];
346
348
  front?: string[];
347
349
  }> = cfgAlts.map((a, i) => {
348
350
  const cli = cliByName.get(a.name);
@@ -362,6 +364,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
362
364
  anchor: a.anchor,
363
365
  drawn: a.drawn,
364
366
  tips: a.tips,
367
+ focus: a.focus,
365
368
  front: a.front,
366
369
  };
367
370
  });
@@ -465,6 +468,10 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
465
468
  });
466
469
  continue;
467
470
  }
471
+ if (alt.focus !== undefined) {
472
+ const invalidFocus = setFocusProblems(alt.focus, `${alt.at}.focus`, [altSrc.width, altSrc.height]);
473
+ if (invalidFocus.length > 0) { altProblems.push(...invalidFocus); continue; }
474
+ }
468
475
  const altRuns = readRuns(alt.full, alt.head ?? null);
469
476
  const hidesSet = new Set(alt.hides ?? []);
470
477
  const declaredSlots = alt.parts !== undefined ? alt.parts.filter((p) => !hidesSet.has(p)) : baseSlots.filter((p) => !hidesSet.has(p));
@@ -693,6 +700,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
693
700
  ...(altSkeleton === undefined ? {} : { skeleton: altSkeleton }),
694
701
  ...(alt.drawn === undefined ? {} : { drawn: { ...alt.drawn } }),
695
702
  ...(altTips === undefined ? {} : { tips_source_size: [altSrc.width, altSrc.height], tips: altTips }),
703
+ ...(alt.focus === undefined ? {} : { focus: [...alt.focus], focus_source_size: [altSrc.width, altSrc.height] }),
696
704
  ...(altDrawnLength === undefined ? {} : { drawnLength: altDrawnLength }),
697
705
  ...(altRegistration === undefined ? {} : { registration: altRegistration }),
698
706
  },
@@ -1448,6 +1456,8 @@ export function rigStage(input: RigStageInput, rigc: RigcRunner, scratch: string
1448
1456
  ? ''
1449
1457
  : `; replayed to accepted step ${rp.chosen_step} of ${rp.accepted_steps} after ${rp.replays} replay(s); selection ${readingText(rp.selection, roleReadings(run.report).bound)}; held out ${readingText(rp.held_out, roleReadings(run.report).bound)}`;
1450
1458
  log(`${head}auto ${from} -> ${r.boundaryVertices}+${r.interiorVertices} (hull+interior) bindings ${r.bindings} ${infl} ${t.reason}${tried}; worst ${worst}${unboundedClause(m.residuals, m.settings.targets.artFit)}${allocationClause(m.residuals)}${stageBClause(m.settings, m.result)}${residualClause(m.skinning_residual)}${strayClause(m.stray_cleared)}; ${moved}${replayed}`);
1459
+ } else if ('mode' in m && m.mode === 'explicit') {
1460
+ log(`${head}explicit ${infl} image sha256 ${m.image_sha256} region sha256 ${m.region_sha256}`);
1451
1461
  } else if ('mode' in m && m.mode === 'influence') {
1452
1462
  // issue #378: rig-c's segments lattice and pull, the figures its own build prints for the generator (AUTHORING §3.4.7).
1453
1463
  const i = m.influence;
@@ -1738,7 +1748,7 @@ export function sweepCheckLines(line: SweepLine, steps: ReadonlyMap<string, { le
1738
1748
  */
1739
1749
  export function motionSeamLines(line: MotionSeamLine, plant: MotionSeamPlant = {}): string[] {
1740
1750
  const unmeasured = (line.roots?.unmeasured ?? []).map(root => `root pair for ${root.limb} (${root.part}, bone "${root.bone}", parent "${root.parent}", candidates ${root.candidates.join('/')}): SKIP — ${root.reason}`);
1741
- const rootStatus = line.roots === undefined ? '' : '; body-root gap-only gate ' + line.roots.status + ' (' + line.roots.pairs.length + ' pair(s)); ghost ownership unavailable' + (line.roots.reason === undefined ? '' : ' — ' + line.roots.reason);
1751
+ const rootStatus = line.roots === undefined ? '' : '; body-root gap-open+under-ghost gate ' + line.roots.status + ' (' + line.roots.pairs.length + ' pair(s)); ghost ownership from resolved draw order' + (line.roots.reason === undefined ? '' : ' — ' + line.roots.reason);
1742
1752
  if (line.worlds === undefined && line.status === 'SKIP' && line.rows.length === 0 && line.pairs.every((p) => p.unread === undefined)) return [`${MOTION_SEAM_LINE}: SKIP — ${String(line.reason)}${unmeasured.length === 0 ? '' : rootStatus}`, ...unmeasured];
1743
1753
  const read = `${line.pairs.length} declared pair(s) in ${line.animations.length} animation(s) (${line.animations.join(', ')}), read by rigc render --seam at ${line.fps} fps on the build as played`;
1744
1754
  const head =
@@ -1751,12 +1761,10 @@ export function motionSeamLines(line: MotionSeamLine, plant: MotionSeamPlant = {
1751
1761
  ...line.pairs.filter((p) => p.unread !== undefined).map((p) => `seam "${p.pair}" (${p.declared.join('; ')}): not read — ${String(p.unread)}`),
1752
1762
  ...line.rows.filter((r) => r.status === 'skip').map((r) => `seam "${r.pair}" in "${r.animation}": SKIP — rigc read no band on any of the ${r.drawn} frame(s) both slots draw, so there is no seam to read`),
1753
1763
  ...(plant.silent === true ? [] : line.rows.filter((r) => r.opens.length > 0).map(r => line.pairs.some(p => p.pair === r.pair && p.root !== undefined)
1754
- ? `FAIL seam "${r.pair}" opens on ${r.opens.length} frame(s) ${frameRuns(r.opens)} max ${r.max_px} px in "${r.animation}" — body-root GAP over the one-cell floor (gap-only)`
1764
+ ? `FAIL seam "${r.pair}" opens on ${r.opens.length} frame(s) ${frameRuns(r.opens)} max ${r.max_px} px in "${r.animation}" — body-root gapOpen + UNDER-owned ghost over the one-cell floor`
1755
1765
  : motionSeamWarnText(r))),
1756
- ...line.rows.flatMap(r => (r.coverage ?? []).map(h =>
1757
- `INFO seam "${r.pair}" in "${r.animation}" frame ${h.index}: root GAP raw ${h.px}; whole-box ${h.status} — ${h.reason}${h.status === 'exempt' ? '; not gated' : '; entire original GAP count retained'}${h.evidence === undefined ? '' : '; evidence: ' + h.evidence}; exact GAP partition deferred to rig-c/core#1556`)),
1758
- ...line.rows.filter(r => r.ghost_info !== undefined && r.ghost_info.frames > 0).map(r =>
1759
- `INFO seam "${r.pair}" in "${r.animation}": ghost ${r.ghost_info?.max_px} cells on ${r.ghost_info?.frames} frame(s); owner unavailable in this rigc-seam/1 reading; see rig-c/core#1555; not gated (gap-only)`),
1766
+ ...line.rows.flatMap(r => (r.cells ?? []).map(h =>
1767
+ `INFO seam "${r.pair}" in "${r.animation}" frame ${h.index}: gapOpen ${h.gapOpen}, gapCovered ${h.gapCovered}, ghost ${h.ghostA + h.ghostB}; UNDER ${h.under ?? 'none'} ghost ${h.underGhost}, OVER ghost ${h.overGhost}; counted ${h.counted}`)),
1760
1768
  ...line.rows.filter((r) => r.opens.length === 0 && r.under_floor.length > 0).map((r) => `seam "${r.pair}" in "${r.animation}": under the floor — rigc names ${r.under_floor.length} frame(s) open ${frameRuns(r.under_floor)}, each opening one cell thick`),
1761
1769
  ...(line.worlds === undefined ? [] : (['default', 'still'] as const).flatMap(name => {
1762
1770
  const w = line.worlds?.[name];