spine-rigc 1.9.2 → 1.9.3

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.
Files changed (47) hide show
  1. package/cli.ts +28 -4397
  2. package/docs/AUTHORING.md +1 -1
  3. package/package.json +1 -1
  4. package/src/assertions/bodies/a13.ts +3 -3
  5. package/src/assertions/bodies/a14.ts +3 -3
  6. package/src/assertions/bodies/a15.ts +5 -5
  7. package/src/assertions/bodies/a22.ts +3 -3
  8. package/src/assertions/facts/animated_bones.ts +4 -2
  9. package/src/assertions/facts/mesh_attachments.ts +33 -4
  10. package/src/assertions/model/animated_bones.ts +13 -5
  11. package/src/assertions/model/bone_timelines.ts +5 -3
  12. package/src/assertions/model/declared.ts +127 -0
  13. package/src/assertions/model/index.ts +63 -40
  14. package/src/assertions/model/mesh_attachments.ts +31 -2
  15. package/src/assertions/model/parse.ts +9 -1
  16. package/src/assertions/model/runtime_timelines.ts +78 -0
  17. package/src/assertions/model/slider_composition.ts +10 -8
  18. package/src/assertions/model/stepped_poses.ts +3 -2
  19. package/src/bonedist.ts +4 -5
  20. package/src/check.ts +3 -2
  21. package/src/checkpics.ts +1 -1
  22. package/src/cli/core_commands.ts +1532 -0
  23. package/src/cli/shared.ts +1935 -0
  24. package/src/cli/spine_commands.ts +1141 -0
  25. package/src/core/additive.ts +52 -62
  26. package/src/core/constraints.ts +26 -3
  27. package/src/core/constraints_physics.ts +11 -1
  28. package/src/core/constraints_slider.ts +136 -6
  29. package/src/core/index.ts +27 -3
  30. package/src/core/skins.ts +28 -3
  31. package/src/core/walk.ts +9 -36
  32. package/src/correspondence.ts +15 -0
  33. package/src/deformbuild.ts +60 -0
  34. package/src/deformmeasure.ts +20 -48
  35. package/src/deformreport.ts +2 -2
  36. package/src/framing.ts +1 -1
  37. package/src/pose.ts +1 -1
  38. package/src/preview.ts +1 -1
  39. package/src/region_joins.ts +54 -0
  40. package/src/render.ts +206 -2836
  41. package/src/render_core.ts +19 -36
  42. package/src/render_shared.ts +2887 -0
  43. package/src/slots.ts +1 -1
  44. package/src/spine_side.ts +123 -0
  45. package/src/validate.ts +11 -91
  46. package/src/assertions/facts/skin_meshes.ts +0 -49
  47. package/src/assertions/model/skin_meshes.ts +0 -90
@@ -67,14 +67,15 @@
67
67
  * `--skin <name>` poses `underSkin(doc, name)` — the named skin's record,
68
68
  * else the default skin's; the named skin's bones and constraints —
69
69
  * measured against spine-core's `setSkin(name)` by the per-skin gate
70
- * (issue #932). No `--skin` is spine-core's "no skin set", which resolves
71
- * every slot through the default skin alone: posed as `underSkin(doc,
72
- * 'default')`, the reading `CR03` measured bit-exact against it on every tree
73
- * row. ⚠️ That equivalence is measured only where the default skin names no
74
- * skin-required bone and no constraint — which of the two readings activates
75
- * such a bone with no skin set was not measured — so a document whose default
76
- * skin names one is REFUSED by the core poser, by name, and renders through
77
- * spine-core; so is a document with skins and no default one.
70
+ * (issue #932). No `--skin` is spine-core's "no skin set" — a fresh skeleton
71
+ * whose `setSkin` was never called — posed as `underNoSkin` (`noSkinView`,
72
+ * issue #1051): no skin's bones or constraints applied, the default skin's
73
+ * included, and every slot resolved through the default skin alone, or
74
+ * through nothing where the document declares skins and no `default` one
75
+ * (`./core/skins.ts`, *No skin set*, for the measurement). Until #1051 it was
76
+ * posed as `underSkin(doc, 'default')`, and the two documents that reading
77
+ * did not cover — a default skin naming a skin-required member, skins with
78
+ * no default one — were refused here and rendered through spine-core.
78
79
  */
79
80
  import type {
80
81
  AttachmentPose,
@@ -92,9 +93,9 @@ import type {
92
93
  import { atlasRegionLookup, parseAtlasText } from './atlas.ts';
93
94
  import { pagesOfAtlas, spineFileSha256, type ModelPage } from './model.ts';
94
95
  import { clipThrough, type ClipShape, type ShapeClipper } from './core/clipping.ts';
95
- import { activeBones, CoreInputError, readModel, sourceOfDoc, underSkin, type CompiledDocument, type CoreSlotRow } from './core/index.ts';
96
+ import { activeBones, CoreInputError, readModel, sourceOfDoc, underNoSkin, underSkin, type CompiledDocument, type CoreSlotRow } from './core/index.ts';
96
97
  import { poseRawAnimation, poseRawSetup, type RawDrawn, type RawPose } from './core/raw.ts';
97
- import { CORE_ALL_SKINS, CORE_DEFAULT_SKIN, lookupSkins } from './core/skins.ts';
98
+ import { CORE_DEFAULT_SKIN, lookupSkins } from './core/skins.ts';
98
99
  import { documentPageLookup, drawnRegions, meshPageUvs, readUvSequences, regionPageUvs, type DrawnRegion, type UvRegion, type UvSource } from './core/uvs.ts';
99
100
  import { regionCorners, worldVertices } from './core/vertices.ts';
100
101
  import type { CoreWorld } from './core/world.ts';
@@ -275,36 +276,19 @@ interface CoreInput {
275
276
  }
276
277
 
277
278
  /**
278
- * The document posed with no skin set — spine-core's initial state, every slot
279
- * resolved through the default skin alone — or refused by name where that
280
- * equivalence was not measured (the header's *The skin*).
279
+ * The document posed with no skin set — spine-core's initial state, a fresh
280
+ * skeleton whose `setSkin` was never called: `underNoSkin` (issue #1051), no
281
+ * skin's `bones` or constraint lists applied, the default skin's included,
282
+ * and every slot resolved through the default skin alone — or through
283
+ * nothing, where the document declares skins and none of them `default`
284
+ * (`./core/skins.ts`, *No skin set*, for the measurement).
281
285
  *
282
286
  * Exported for the model side of the validator (issue #1025), which poses a
283
287
  * slot the way `validate()` does — a fresh skeleton, no skin set — and must
284
288
  * resolve that state by this rule rather than by a copy of it.
285
- *
286
- * ⚠️ The first refusal — skins declared and none of them `default` — is issue
287
- * #1051: the model side's A10, which always poses, fails such a rig the round
288
- * trip passes; `tools/verdict_gate.ts` and the selftest's `VF02` count those
289
- * line sets apart as this documented class rather than as a difference.
290
289
  */
291
290
  export function noSkinView(doc: CompiledDocument): CompiledDocument {
292
- if (doc.skins.length === 0) return underSkin(doc, CORE_ALL_SKINS);
293
- const fallback = doc.skins.find((k) => k.name === CORE_DEFAULT_SKIN);
294
- if (fallback === undefined) {
295
- throw new CoreInputError(
296
- `no skin was set, and this document declares skins [${doc.skins.map((k) => k.name).join(', ')}] and no "${CORE_DEFAULT_SKIN}" one — ` +
297
- 'what spine-core shows with no skin set over such a document was not measured',
298
- );
299
- }
300
- const constraints = Object.entries(fallback.constraints).flatMap(([kind, names]) => names.map((n) => `${kind} "${n}"`));
301
- if (fallback.bones.length > 0 || constraints.length > 0) {
302
- throw new CoreInputError(
303
- `no skin was set, and the "${CORE_DEFAULT_SKIN}" skin names ${[...fallback.bones.map((b) => `bone "${b}"`), ...constraints].join(', ')} — ` +
304
- 'whether spine-core activates what the default skin names when no skin is set was not measured, so the core does not pose it',
305
- );
306
- }
307
- return underSkin(doc, CORE_DEFAULT_SKIN);
291
+ return underNoSkin(doc);
308
292
  }
309
293
 
310
294
  /** A slot row's number, which the raw entry writes as a double — `null` only for a value that is not finite. */
@@ -670,8 +654,7 @@ export function corePoser(modelText: string, atlasText: string, where = 'skeleto
670
654
  * issue #1014): the bones each skin leaves unposed, read off the model
671
655
  * document — `unposedBones` over `activeBones` of the skin's view, the
672
656
  * predicate the raw pose flags its bones with, and under no skin the view the
673
- * core poses with no skin set (`noSkinView`, refused by `CoreInputError` where
674
- * it refuses to pose). `skins` is the skin list in the Spine file's order:
657
+ * core poses with no skin set (`noSkinView`). `skins` is the skin list in the Spine file's order:
675
658
  * a `rigc-compiled/3` document's `editorOrder` (issue #1026), else the file's
676
659
  * own list, which a `/2` or `/1` document does not hold (`resolveSkinView`'s
677
660
  * note in `./core/index.ts`).