spine-rigc 1.9.2 → 1.9.4
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/cli.ts +28 -4397
- package/docs/AUTHORING.md +4 -4
- package/package.json +1 -1
- package/src/assertions/bodies/a06.ts +53 -3
- package/src/assertions/bodies/a13.ts +3 -3
- package/src/assertions/bodies/a14.ts +3 -3
- package/src/assertions/bodies/a15.ts +5 -5
- package/src/assertions/bodies/a19.ts +44 -2
- package/src/assertions/bodies/a22.ts +3 -3
- package/src/assertions/facts/animated_bones.ts +4 -2
- package/src/assertions/facts/mesh_attachments.ts +33 -4
- package/src/assertions/model/animated_bones.ts +13 -5
- package/src/assertions/model/bone_timelines.ts +5 -3
- package/src/assertions/model/declared.ts +127 -0
- package/src/assertions/model/index.ts +63 -40
- package/src/assertions/model/mesh_attachments.ts +31 -2
- package/src/assertions/model/parse.ts +9 -1
- package/src/assertions/model/runtime_timelines.ts +78 -0
- package/src/assertions/model/slider_composition.ts +10 -8
- package/src/assertions/model/stepped_poses.ts +3 -2
- package/src/bonedist.ts +4 -5
- package/src/check.ts +3 -2
- package/src/checkpics.ts +1 -1
- package/src/cli/core_commands.ts +1532 -0
- package/src/cli/shared.ts +1935 -0
- package/src/cli/spine_commands.ts +1141 -0
- package/src/core/additive.ts +52 -62
- package/src/core/constraints.ts +26 -3
- package/src/core/constraints_physics.ts +11 -1
- package/src/core/constraints_slider.ts +136 -6
- package/src/core/index.ts +27 -3
- package/src/core/skins.ts +28 -3
- package/src/core/walk.ts +9 -36
- package/src/correspondence.ts +15 -0
- package/src/deformbuild.ts +60 -0
- package/src/deformmeasure.ts +20 -48
- package/src/deformreport.ts +2 -2
- package/src/framing.ts +1 -1
- package/src/pose.ts +1 -1
- package/src/preview.ts +1 -1
- package/src/region_joins.ts +54 -0
- package/src/render.ts +206 -2836
- package/src/render_core.ts +19 -36
- package/src/render_shared.ts +2887 -0
- package/src/slots.ts +1 -1
- package/src/spine_side.ts +123 -0
- package/src/validate.ts +11 -91
- package/src/assertions/facts/skin_meshes.ts +0 -49
- package/src/assertions/model/skin_meshes.ts +0 -90
package/src/render_core.ts
CHANGED
|
@@ -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"
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
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 {
|
|
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,
|
|
279
|
-
*
|
|
280
|
-
*
|
|
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
|
-
|
|
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
|
|
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`).
|