@rig-c/parts 2.46.0 → 2.47.1

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/assemble.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { projectAssemblyConfig, type AssemblyLimb, type AssemblySource, type AssemblyView } from './assembly-reading.ts';
1
2
  import { sourceCoverRun, type SourceCoverReading } from './sourcecover.ts';
2
3
  import { replaceEditedParts, type EditedPartContext, type EditedPartFrontColourReading, type VerifiedEditedPart } from './editedparts.ts';
3
4
  import { paintingReceivers, rawPaintingOwner, type PaintingOwner } from './paintingowner.ts';
@@ -119,7 +120,7 @@ import { COPIED_ALPHA_ABOVE, OCCLUDER_EMPTY, occluderDrawCycleProblems, type Occ
119
120
  * Pure: no clock, no randomness, no file access. The CLI reads and writes.
120
121
  */
121
122
  import { sourceLimbTarget, nearestTargetPart } from './limbownership.ts';
122
- import { type ArmSplit, type BoneEntry, type CharacterConfig, type ConfigConstraint, type ControlSkeleton, controlSkeletonOf, type CropEdge, type Cut, type EarlyConfig, type Extend, type Limb, type MeshSpec, type Patch, type PlanEntry, type RegionSpec, type Run, type SeeThrough, turnMovingPartPair, type TurnSpec } from './config.ts';
123
+ import { type ArmSplit, type BoneEntry, type ControlSkeleton, controlSkeletonOf, type CropEdge, type Cut, type EarlyConfig, type Extend, type MeshSpec, type Patch, type PlanEntry, type RegionSpec, type Run, type SeeThrough, turnMovingPartPair, type TurnSpec } from './config.ts';
123
124
  import { foldName, PartsError, type Problem, refuseIfAny } from './errors.ts';
124
125
  import { CORE_ALPHA, figuresPhrase, implausibleRules, type Layer, type LayerFigures, layerFigures, type LayerSet, NEAR_WHITE_MIN, OPAQUE_ALPHA_ABOVE, ruleSummary } from './layers.ts';
125
126
  import { padToSquare, squarePad } from './inputs.ts';
@@ -237,7 +238,7 @@ export interface Geometry {
237
238
  /** `assemble.head_face_underfill` (issue #492): composite `full:face` under `head:face` on the head canvas to fill transparent bare-skin holes. */
238
239
  headFaceUnderfill?: boolean;
239
240
  /** `assemble.yield_refused`, default false; transfer of refused cores/rims, finishing nearby accepted projection RGB. */
240
- yieldRefused?: boolean;
241
+ yieldRefused?: boolean | readonly string[];
241
242
  /** Plan parts whose own samples survive source re-take beneath soft front cover. */
242
243
  keepUnderOccluders?: readonly string[];
243
244
  /** `assemble.occluders` as declared (issue #1247; `AssembleInput.occluders` carries the decoded images): declared occluder entries whose `over` parts sit after their `under` parts in a proposed plan. */
@@ -335,7 +336,7 @@ export interface AssembleInput {
335
336
  turn?: TurnSpec;
336
337
  regions?: Record<string, RegionSpec>;
337
338
  meshes?: Record<string, MeshSpec>;
338
- motion?: CharacterConfig['motion'];
339
+ motion?: AssemblyView['motion'];
339
340
  depth?: DepthConfig;
340
341
  /** Config-relative user sheet paths; caller supplies its actual base. */
341
342
  depthBase?: string;
@@ -371,7 +372,7 @@ export interface AssembleInput {
371
372
  /** `config.scene` (issue #242): the painting is a scene, so the recomposite is read inside the figure ({@link sceneFigure}). Absent or false: nothing changes. */
372
373
  scene?: boolean;
373
374
  /** `config.limbs` (issue #349): the parts cut at their joints ({@link LimbCount}). Absent or empty: nothing changes. */
374
- limbs?: Record<string, Limb>;
375
+ limbs?: Record<string, AssemblyLimb>;
375
376
  /** Alternate sources with different layers retain the original joint cut bounds. */
376
377
  limbSourceGroups?: ReadonlyMap<string, string>;
377
378
  /** `config.bones`, read for the limbs' joints; required with `limbs`. */
@@ -389,7 +390,7 @@ export interface AssembleInput {
389
390
  /** `assemble.head_face_underfill` (issue #492): composite `full:face` under `head:face` on the head canvas to fill transparent bare-skin holes. */
390
391
  headFaceUnderfill?: boolean;
391
392
  /** `assemble.yield_refused`, default false; transfer of refused cores/rims, finishing nearby accepted projection RGB. */
392
- yieldRefused?: boolean;
393
+ yieldRefused?: boolean | readonly string[];
393
394
  /** Report-only last-writer sidecar, default off. */
394
395
  stageMap?: boolean;
395
396
  /** Plan parts whose own samples survive source re-take beneath soft front cover. */
@@ -455,7 +456,7 @@ export interface OtherLimbs {
455
456
  /** Issue #638's test-only pre-fix mutant; absent uses only segments taking the source. No CLI/config field. */
456
457
  line?: 'whole-limb';
457
458
  /** The config's limbs, by name, that the set does not carry and that take one of `limbIslands`. */
458
- limbs: Readonly<Record<string, Limb>>;
459
+ limbs: Readonly<Record<string, AssemblyLimb>>;
459
460
  /**
460
461
  * Per limb, its segment bones the set does not place: neither its skeleton names it (`SKELETON_LIMB_BONES`) nor
461
462
  * its `drawn`, nor an ancestor of it. Empty: the limb stands where the set's own bones (`bones`) put it.
@@ -553,8 +554,8 @@ export interface IslandCount {
553
554
  * limb that takes a part shares its pixels by the nearest polyline, so each limb gets its own side; a set that carries
554
555
  * fewer of them puts every pixel of the part on the limbs it carries, both legs of a two-leg layer on one leg.
555
556
  */
556
- export function setIslandSources(limbs: Readonly<Record<string, Limb>>, setLimbs: Readonly<Record<string, Limb>>): string[] {
557
- const takes = (all: Readonly<Record<string, Limb>>, src: string): number => Object.values(all).filter((l) => l.segments.some((sg) => sg.from === src)).length;
557
+ export function setIslandSources(limbs: Readonly<Record<string, AssemblyLimb>>, setLimbs: Readonly<Record<string, AssemblyLimb>>): string[] {
558
+ const takes = (all: Readonly<Record<string, AssemblyLimb>>, src: string): number => Object.values(all).filter((l) => l.segments.some((sg) => sg.from === src)).length;
558
559
  const froms = [...new Set(Object.values(setLimbs).flatMap((l) => l.segments.map((sg) => sg.from)))];
559
560
  return froms.filter((src) => takes(limbs, src) > takes(setLimbs, src));
560
561
  }
@@ -679,7 +680,7 @@ function squaredDistanceTo(cc: Components, W: number, label: number, at: readonl
679
680
  * transparent (a `cap_shape: "ball"` lower half from the cap image) is on no island and kept.
680
681
  */
681
682
  /** Layer variants share the original source's segment line for ownership, without changing its pixel source. */
682
- function logicalSourceLimb(limb: Limb, source: string, groups: ReadonlyMap<string, string>): Limb {
683
+ function logicalSourceLimb(limb: AssemblyLimb, source: string, groups: ReadonlyMap<string, string>): AssemblyLimb {
683
684
  if (!groups.has(source)) return limb;
684
685
  const original = groups.get(source);
685
686
  return { ...limb, segments: limb.segments.map(s => (groups.get(s.from) ?? s.from) === original ? { ...s, from: source } : s) };
@@ -687,7 +688,7 @@ function logicalSourceLimb(limb: Limb, source: string, groups: ReadonlyMap<strin
687
688
 
688
689
  function keepJointIslands(
689
690
  sources: readonly string[],
690
- limbs: Readonly<Record<string, Limb>>,
691
+ limbs: Readonly<Record<string, AssemblyLimb>>,
691
692
  bones: readonly BoneEntry[],
692
693
  parts: readonly LimbPart[],
693
694
  pieces: readonly Built[],
@@ -918,7 +919,7 @@ function skeletonsTooClose(own: readonly LinePt[], other: readonly LinePt[], hal
918
919
  function splitOneIsland(
919
920
  src: string,
920
921
  source: Built,
921
- limbs: Readonly<Record<string, Limb>>,
922
+ limbs: Readonly<Record<string, AssemblyLimb>>,
922
923
  places: ReadonlyMap<string, BonePlace>,
923
924
  parts: readonly LimbPart[],
924
925
  pieces: readonly Built[],
@@ -965,10 +966,10 @@ function splitOneIsland(
965
966
  if (refused || posed.length === 0) return;
966
967
  // Issue #638: a separate footwear layer belongs to the ankle-to-toe segments, not to a nearby thigh or shin.
967
968
  // The same source selection applies to every segment, without reading a part name or a layer tag.
968
- const taking = (l: string, all: Readonly<Record<string, Limb>>): Limb => others.line === 'whole-limb'
969
+ const taking = (l: string, all: Readonly<Record<string, AssemblyLimb>>): AssemblyLimb => others.line === 'whole-limb'
969
970
  ? all[l]
970
971
  : { ...all[l], segments: logicalSourceLimb(all[l], src, sourceGroups).segments.filter((sg) => sg.from === src) };
971
- const polyOf = (l: string, all: Readonly<Record<string, Limb>>): Array<[number, number]> =>
972
+ const polyOf = (l: string, all: Readonly<Record<string, AssemblyLimb>>): Array<[number, number]> =>
972
973
  others.line === 'whole-limb' ? limbPolyline(all[l], places) : sourceLimbTarget(logicalSourceLimb(all[l], src, sourceGroups), src, places).line;
973
974
  for (const [l, all] of [...ownNames.map((l) => [l, limbs] as const), ...posed.map((l) => [l, others.limbs] as const)]) {
974
975
  const selected = taking(l, all);
@@ -1072,7 +1073,7 @@ function splitOneIsland(
1072
1073
  * a source verdict. Cap origin is provenance, never proof of ownership.
1073
1074
  */
1074
1075
  function assignCapOwnership(
1075
- sources: readonly string[], limbs: Readonly<Record<string, Limb>>, bones: readonly BoneEntry[],
1076
+ sources: readonly string[], limbs: Readonly<Record<string, AssemblyLimb>>, bones: readonly BoneEntry[],
1076
1077
  parts: readonly LimbPart[], pieces: readonly Built[], sourceOf: (name: string) => Built | null,
1077
1078
  capFrom: ReadonlyArray<CapFrom | null>, W: number, H: number, others?: OtherLimbs, tips?: Record<string, [number, number]>,
1078
1079
  sourceGroups: ReadonlyMap<string, string> = new Map(),
@@ -4346,7 +4347,7 @@ function shiftedAt(line: JointLine, offset: number): [number, number] {
4346
4347
  function limbBands(
4347
4348
  cuts: readonly Cut[],
4348
4349
  pieces: ReadonlyArray<Built | null>,
4349
- limbs: Readonly<Record<string, Limb>>,
4350
+ limbs: Readonly<Record<string, AssemblyLimb>>,
4350
4351
  bones: readonly BoneEntry[],
4351
4352
  W: number,
4352
4353
  H: number,
@@ -4441,7 +4442,7 @@ function limbBands(
4441
4442
  * box's size, or transparent over every cap pixel).
4442
4443
  */
4443
4444
  function cutLimbs(
4444
- limbs: Readonly<Record<string, Limb>>,
4445
+ limbs: Readonly<Record<string, AssemblyLimb>>,
4445
4446
  bones: readonly BoneEntry[],
4446
4447
  caps: ReadonlyMap<string, Raster>,
4447
4448
  W: number,
@@ -4533,7 +4534,7 @@ function cutLimbs(
4533
4534
  const underNames = on.filter((l) => l !== coverLimb);
4534
4535
  const underIndices = underNames.map((l) => names.indexOf(l));
4535
4536
  const underPolys = underNames.map((l) => polylines.get(l) as Array<[number, number]>);
4536
- assignCrossedLimbs(coverIdx, polylines.get(coverLimb) as Array<[number, number]>, limbs[coverLimb].split as NonNullable<Limb['split']>, underIndices, underPolys, b.r, OPAQUE_ALPHA_ABOVE, own);
4537
+ assignCrossedLimbs(coverIdx, polylines.get(coverLimb) as Array<[number, number]>, limbs[coverLimb].split as NonNullable<AssemblyLimb['split']>, underIndices, underPolys, b.r, OPAQUE_ALPHA_ABOVE, own);
4537
4538
  }
4538
4539
  owners.set(src, own);
4539
4540
  jobs.push({ src, b, on, own, before });
@@ -5230,7 +5231,7 @@ export function checkSingleRun(full: LayerSet, plan: readonly PlanEntry[] | null
5230
5231
 
5231
5232
  /** All output pieces that consume a taken source, including cut-to-limb paths.
5232
5233
  * Painting patches have no source-part edge in the supported Patch schema. */
5233
- export function regionTakeTargets(names: readonly string[], cuts: readonly Cut[], limbs: Readonly<Record<string, Limb>> = {}): ReadonlySet<string> {
5234
+ export function regionTakeTargets(names: readonly string[], cuts: readonly Cut[], limbs: Readonly<Record<string, AssemblyLimb>> = {}): ReadonlySet<string> {
5234
5235
  const targets = new Set(names);
5235
5236
  const edges = cuts.map(c => ({ from: c.from, into: c.into }));
5236
5237
  for (const limb of Object.values(limbs)) for (const [index, segment] of limb.segments.entries()) {
@@ -6163,9 +6164,11 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6163
6164
  const stackNames = stack.map((q) => q.record.name);
6164
6165
  const drift: DriftBodies[] = [];
6165
6166
  const yields = new Map<string, { mask: Mask; reading: DriftYieldReading }>();
6167
+ const yieldSelection = typeof input.yieldRefused === 'object' ? new Set(input.yieldRefused) : null;
6166
6168
  order.forEach((d, orderIdx) => {
6167
6169
  if ('patch' in d) return;
6168
6170
  const { name, b } = pieceAt(d);
6171
+ const yieldPart = input.yieldRefused === true || yieldSelection?.has(name) === true;
6169
6172
  if (b.st.refusedMask === null) return;
6170
6173
  const refused = newMask(W, H);
6171
6174
  for (let p = 0; p < W * H; p++) if (b.st.refusedMask.data[p] === 1 && (b.region === null || b.region.data[p] === 1)) refused.data[p] = 1;
@@ -6176,7 +6179,7 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6176
6179
  if (under[p * 4 + 3] < CORE_ALPHA) continue;
6177
6180
  // The opt-in resolves the actual exposed opaque holder before comparing its colour.
6178
6181
  // Keep the legacy matching-holder diagnostic unchanged when the setting is off.
6179
- if (input.yieldRefused === true) { behindAt[p] = j; continue; }
6182
+ if (yieldPart) { behindAt[p] = j; continue; }
6180
6183
  const dMax = Math.max(
6181
6184
  Math.abs(under[p * 4] - srcr.data[p * 4]),
6182
6185
  Math.abs(under[p * 4 + 1] - srcr.data[p * 4 + 1]),
@@ -6185,7 +6188,7 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6185
6188
  if (dMax <= DRIFT_LIMIT) behindAt[p] = j;
6186
6189
  }
6187
6190
  }
6188
- if (input.yieldRefused === true) {
6191
+ if (yieldPart) {
6189
6192
  for (let p = 0; p < W * H; p++) {
6190
6193
  if (behindAt[p] < 0) continue;
6191
6194
  const under = stack[behindAt[p]].image.data;
@@ -6200,7 +6203,7 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6200
6203
  // The refusal belongs to b.key. A copied/ring replacement cannot inherit that source's refusal.
6201
6204
  // "Front" is relative to behindAt, not the fixed global top holder: another run may cover this source.
6202
6205
  let yielded = 0;
6203
- if (input.yieldRefused === true) {
6206
+ if (yieldPart) {
6204
6207
  const mask = newMask(W, H);
6205
6208
  const reading: DriftYieldReading = { part: name, from: b.key, refusedCandidates: 0, yielded: 0, yieldedRim: 0, yieldedTaken: 0, skipped: { merge: 0, ring: 0, notOpaque: 0, noMatchingBehind: 0 }, originalGlobalHolderWouldSkip: 0, originalHolders: [], finalHolders: [] };
6206
6209
  const holders = new Map<string | null, number>();
@@ -6263,10 +6266,10 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6263
6266
  reading.originalHolders = [...holders].map(([part, px]) => ({ part, px }));
6264
6267
  yields.set(name, { mask, reading });
6265
6268
  }
6266
- const found = driftBodies(name, b.key, refused, bodyMinPx(frame), holderAt, stackNames, behindAt, input.yieldRefused === true ? yielded : undefined);
6267
- if (found !== null) drift.push(found);
6269
+ const found = driftBodies(name, b.key, refused, bodyMinPx(frame), holderAt, stackNames, behindAt, yieldPart ? yielded : undefined);
6270
+ if (found !== null) drift.push(yieldPart && yieldSelection !== null ? { ...found, scopedYield: true } : found);
6268
6271
  });
6269
- if (input.yieldRefused === true) {
6272
+ if (input.yieldRefused === true || yields.size > 0) {
6270
6273
  const finalAt = new Int32Array(W * H).fill(-1);
6271
6274
  stack.forEach(({ image }, i) => { for (let p = 0; p < W * H; p++) if (image.data[p * 4 + 3] >= CORE_ALPHA) finalAt[p] = i; });
6272
6275
  for (const { mask, reading } of yields.values()) {
@@ -6804,7 +6807,7 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
6804
6807
  uncovered,
6805
6808
  holeKinds: kinds,
6806
6809
  drift,
6807
- ...(input.yieldRefused === true ? { yieldReadings: [...yields.values()].map(q => q.reading) } : {}),
6810
+ ...(input.yieldRefused === true || yieldSelection !== null ? { yieldReadings: [...yields.values()].map(q => q.reading) } : {}),
6808
6811
  ...(occluderUnheldWarnings.length === 0 ? {} : { occluderUnheldWarnings }),
6809
6812
  hidden: [...hiddenUses].map(([layer, readBy]) => ({ layer, readBy })),
6810
6813
  seamRule,
@@ -6829,6 +6832,8 @@ export { edgeSplitLines };
6829
6832
 
6830
6833
  /** A part whose `DRIFT_LIMIT` refusals hold a body, and which parts the draw order puts there. */
6831
6834
  export interface DriftBodies {
6835
+ /** An explicit part list enabled the yield reading for this part. */
6836
+ scopedYield?: true;
6832
6837
  /** The part, and its `<run>:<tag>`. */
6833
6838
  part: string;
6834
6839
  from: string;
@@ -6931,7 +6936,7 @@ export function driftLine(d: DriftBodies): string {
6931
6936
  "informational: no gate reads this. Swapping the plan order of the parts named here can clear it (when only the front one differs from the painting) or move it to the other part (when both do): swap, rebuild and read this line again; if it moves, removing it needs different input layers. At rest, the seam pass repaints the holder's pixels that pass its rule from the painting" +
6932
6937
  (d.yieldedPx === undefined
6933
6938
  ? '; set assemble.yield_refused: true to yield original refused front pixels and their connected non-core rims only where the top-most opaque behind holder matches the painting, before considering a cut'
6934
- : `; yielded ${d.yieldedPx} px to top-most opaque behind holders matching the painting (assemble.yield_refused: true; alpha only)`)
6939
+ : `; yielded ${d.yieldedPx} px to top-most opaque behind holders matching the painting (${d.scopedYield ? 'listed in assemble.yield_refused' : 'assemble.yield_refused: true'}; alpha only)`)
6935
6940
  );
6936
6941
  }
6937
6942
 
@@ -7701,24 +7706,19 @@ function unplannedNotes(
7701
7706
  // ---------------------------------------------------------------------------
7702
7707
 
7703
7708
  /**
7704
- * The config fields the stage reads: `seethrough.resolution` and `.head_box`,
7705
- * `assemble.rig_scale`, `.plan`, `.extend_below_crop`, `.patches` and `.cuts` — and
7706
- * nothing of the rig. The CLI hands it a config from
7707
- * `parseEarlyConfig(raw, 'assemble')`; a config the full loader accepted is
7708
- * the same shape with more in it. The head box is refused here rather than by
7709
- * the loader, because `inputs` runs before it exists; `seethrough` too, for a
7710
- * full-loader config, where it is optional.
7709
+ * Select the assembly view before deriving geometry. A full-loader config may
7710
+ * omit seethrough, and an early config can precede the head-box declaration.
7711
+ * Keep those refusals here, where the run shape is known.
7711
7712
  */
7712
7713
  export function stageFields(
7713
- cfg: Pick<CharacterConfig, 'seethrough' | 'assemble' | 'scene' | 'motion_seams'> & {
7714
- limbs?: Record<string, Limb>;
7715
- bones?: BoneEntry[];
7716
- meshes?: Record<string, MeshSpec>;
7717
- regions?: Record<string, RegionSpec>;
7718
- constraints?: ConfigConstraint[];
7719
- turn?: TurnSpec;
7720
- motion?: CharacterConfig['motion'];
7721
- },
7714
+ cfg: Omit<AssemblySource, 'key' | 'proposed_rig_scale'>,
7715
+ single: { w: number; h: number } | null = null,
7716
+ ): ReturnType<typeof projectedStageFields> {
7717
+ return projectedStageFields(projectAssemblyConfig(cfg).config, single);
7718
+ }
7719
+
7720
+ export function projectedStageFields(
7721
+ cfg: AssemblyView,
7722
7722
  single: { w: number; h: number } | null = null,
7723
7723
  ): {
7724
7724
  resolution: number;
@@ -7730,14 +7730,14 @@ export function stageFields(
7730
7730
  cuts: Cut[];
7731
7731
  motion_seams?: MotionSeamDeclaration[];
7732
7732
  scene?: boolean;
7733
- limbs?: Record<string, Limb>;
7733
+ limbs?: Record<string, AssemblyLimb>;
7734
7734
  bones?: BoneEntry[];
7735
7735
  single?: boolean;
7736
7736
  armSplit?: ArmSplit;
7737
7737
  keySkeleton?: ControlSkeleton;
7738
7738
  headFaceUnderfill?: boolean;
7739
7739
  /** `assemble.yield_refused`, default false; transfer of refused cores/rims, finishing nearby accepted projection RGB. */
7740
- yieldRefused?: boolean;
7740
+ yieldRefused?: boolean | readonly string[];
7741
7741
  /** Report-only last-writer sidecar, default off. */
7742
7742
  stageMap?: boolean;
7743
7743
  /** Plan parts whose own samples survive source re-take beneath soft front cover. */
@@ -7752,7 +7752,7 @@ export function stageFields(
7752
7752
  turn?: TurnSpec;
7753
7753
  regions?: Record<string, RegionSpec>;
7754
7754
  meshes?: Record<string, MeshSpec>;
7755
- motion?: CharacterConfig['motion'];
7755
+ motion?: AssemblyView['motion'];
7756
7756
  /** `assemble.ground` (issue #996); absent, `plain`. */
7757
7757
  ground?: Ground;
7758
7758
  } {
@@ -7764,8 +7764,8 @@ export function stageFields(
7764
7764
  problems.push({ code: 'ASSEMBLE_FIELD_PRESENT', object: 'config.seethrough.head_box', detail: 'is absent; the head run cannot be placed on the painting without the box it was cropped from' });
7765
7765
  }
7766
7766
  refuseIfAny(problems);
7767
- const st = cfg.seethrough as SeeThrough;
7768
- const keySkeleton = controlSkeletonOf(cfg);
7767
+ const st = cfg.seethrough!;
7768
+ const keySkeleton = cfg.keySkeleton;
7769
7769
  const turnMovingPair = turnMovingPartPair(cfg);
7770
7770
  return {
7771
7771
  resolution: st.resolution,
@@ -7789,7 +7789,7 @@ export function stageFields(
7789
7789
  patches: cfg.assemble.patches ?? [],
7790
7790
  cuts: cfg.assemble.cuts ?? [],
7791
7791
  ...(cfg.motion_seams === undefined ? {} : { motion_seams: cfg.motion_seams }),
7792
- ...(cfg.scene === undefined ? {} : { scene: true }),
7792
+ ...(cfg.scene === undefined ? {} : { scene: cfg.scene }),
7793
7793
  ...(cfg.limbs === undefined ? {} : { limbs: cfg.limbs, bones: cfg.bones ?? [] }),
7794
7794
  };
7795
7795
  }