rig-c 0.0.0-stage → 2.21.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/.claude-plugin/marketplace.json +19 -0
- package/.claude-plugin/plugin.json +13 -0
- package/LICENSE +30 -0
- package/NOTICE.md +145 -0
- package/README.md +817 -3
- package/bin/rigc.cjs +83 -0
- package/cli.ts +61 -0
- package/cli_core.ts +46 -0
- package/docs/AUTHORING.md +9923 -0
- package/docs/FACE.md +1948 -0
- package/docs/INGEST.md +1488 -0
- package/docs/MOTION.md +1241 -0
- package/docs/PROMPTING.md +109 -0
- package/docs/RIGGING.md +1441 -0
- package/docs/SPEC_COVERAGE.md +357 -0
- package/package.json +108 -4
- package/skills/rigc/SKILL.md +133 -0
- package/skills/rigc-face/SKILL.md +60 -0
- package/skills/rigc-ingest/SKILL.md +78 -0
- package/skills/rigc-motion/SKILL.md +51 -0
- package/skills/rigc-rigging/SKILL.md +49 -0
- package/src/areaband.ts +159 -0
- package/src/assertions/bodies/a01.ts +23 -0
- package/src/assertions/bodies/a02.ts +21 -0
- package/src/assertions/bodies/a03.ts +27 -0
- package/src/assertions/bodies/a04.ts +40 -0
- package/src/assertions/bodies/a05.ts +56 -0
- package/src/assertions/bodies/a06.ts +245 -0
- package/src/assertions/bodies/a07.ts +68 -0
- package/src/assertions/bodies/a08.ts +76 -0
- package/src/assertions/bodies/a09.ts +82 -0
- package/src/assertions/bodies/a10.ts +116 -0
- package/src/assertions/bodies/a11.ts +15 -0
- package/src/assertions/bodies/a12.ts +30 -0
- package/src/assertions/bodies/a13.ts +51 -0
- package/src/assertions/bodies/a14.ts +35 -0
- package/src/assertions/bodies/a15.ts +97 -0
- package/src/assertions/bodies/a16.ts +24 -0
- package/src/assertions/bodies/a17.ts +26 -0
- package/src/assertions/bodies/a18.ts +62 -0
- package/src/assertions/bodies/a19.ts +404 -0
- package/src/assertions/bodies/a20.ts +122 -0
- package/src/assertions/bodies/a21.ts +190 -0
- package/src/assertions/bodies/a22.ts +39 -0
- package/src/assertions/bodies/a23.ts +305 -0
- package/src/assertions/bodies/a24.ts +68 -0
- package/src/assertions/bodies/a25.ts +39 -0
- package/src/assertions/bodies/a26.ts +61 -0
- package/src/assertions/bodies/a27.ts +33 -0
- package/src/assertions/bodies/a28.ts +70 -0
- package/src/assertions/bodies/a29.ts +34 -0
- package/src/assertions/bodies/a30.ts +50 -0
- package/src/assertions/bodies/a31.ts +61 -0
- package/src/assertions/bodies/a32.ts +44 -0
- package/src/assertions/bodies/a33.ts +110 -0
- package/src/assertions/bodies/a34.ts +133 -0
- package/src/assertions/bodies/a35.ts +160 -0
- package/src/assertions/bodies/a36.ts +81 -0
- package/src/assertions/bodies/a37.ts +77 -0
- package/src/assertions/bodies/a38.ts +73 -0
- package/src/assertions/bodies/a39.ts +303 -0
- package/src/assertions/bodies/a40.ts +128 -0
- package/src/assertions/bodies/a42.ts +97 -0
- package/src/assertions/bodies/a43.ts +181 -0
- package/src/assertions/bodies/a44.ts +23 -0
- package/src/assertions/bodies/a45.ts +172 -0
- package/src/assertions/bodies/a46.ts +224 -0
- package/src/assertions/bodies/a47.ts +126 -0
- package/src/assertions/bodies/a48.ts +83 -0
- package/src/assertions/bodies/a49.ts +81 -0
- package/src/assertions/bodies/a50.ts +97 -0
- package/src/assertions/constraint_words.ts +169 -0
- package/src/assertions/emitted/index.ts +148 -0
- package/src/assertions/facts/animated_bones.ts +30 -0
- package/src/assertions/facts/animation_durations.ts +37 -0
- package/src/assertions/facts/atlas_pages.ts +19 -0
- package/src/assertions/facts/atlas_regions.ts +52 -0
- package/src/assertions/facts/bone_timelines.ts +37 -0
- package/src/assertions/facts/constraint_targets.ts +56 -0
- package/src/assertions/facts/constraints.ts +155 -0
- package/src/assertions/facts/deform_survey.ts +27 -0
- package/src/assertions/facts/event_keys.ts +55 -0
- package/src/assertions/facts/linked_meshes.ts +38 -0
- package/src/assertions/facts/mesh_attachments.ts +100 -0
- package/src/assertions/facts/region_joins.ts +34 -0
- package/src/assertions/facts/sequences.ts +85 -0
- package/src/assertions/facts/skeleton_roster.ts +45 -0
- package/src/assertions/facts/skin_entries.ts +37 -0
- package/src/assertions/facts/skin_members.ts +53 -0
- package/src/assertions/facts/slider_composition.ts +78 -0
- package/src/assertions/facts/slot_colour.ts +43 -0
- package/src/assertions/facts/stage.ts +27 -0
- package/src/assertions/facts/stage_box.ts +65 -0
- package/src/assertions/facts/stepped_poses.ts +74 -0
- package/src/assertions/facts/two_colour.ts +52 -0
- package/src/assertions/facts/vertex_polygons.ts +53 -0
- package/src/assertions/footprints.ts +367 -0
- package/src/assertions/harness.ts +109 -0
- package/src/assertions/inward_advance.ts +58 -0
- package/src/assertions/kinds.ts +105 -0
- package/src/assertions/mesh_kinds.ts +56 -0
- package/src/assertions/model/animated_bones.ts +38 -0
- package/src/assertions/model/animation_durations.ts +57 -0
- package/src/assertions/model/atlas_pages.ts +15 -0
- package/src/assertions/model/atlas_regions.ts +76 -0
- package/src/assertions/model/bone_timelines.ts +58 -0
- package/src/assertions/model/constraint_targets.ts +82 -0
- package/src/assertions/model/constraints.ts +233 -0
- package/src/assertions/model/declared.ts +125 -0
- package/src/assertions/model/deform_survey.ts +24 -0
- package/src/assertions/model/event_keys.ts +45 -0
- package/src/assertions/model/given.ts +45 -0
- package/src/assertions/model/index.ts +398 -0
- package/src/assertions/model/linked_meshes.ts +24 -0
- package/src/assertions/model/mesh_attachments.ts +119 -0
- package/src/assertions/model/parse.ts +146 -0
- package/src/assertions/model/region_joins.ts +67 -0
- package/src/assertions/model/runtime_timelines.ts +78 -0
- package/src/assertions/model/sequences.ts +157 -0
- package/src/assertions/model/skeleton_roster.ts +23 -0
- package/src/assertions/model/skin_entries.ts +69 -0
- package/src/assertions/model/skin_members.ts +64 -0
- package/src/assertions/model/slider_composition.ts +193 -0
- package/src/assertions/model/slot_colour.ts +81 -0
- package/src/assertions/model/stage.ts +28 -0
- package/src/assertions/model/stage_box.ts +51 -0
- package/src/assertions/model/stepped_poses.ts +105 -0
- package/src/assertions/model/two_colour.ts +61 -0
- package/src/assertions/model/vertex_polygons.ts +72 -0
- package/src/assertions/reasons.ts +129 -0
- package/src/assertions/region_lookups.ts +61 -0
- package/src/assertions/report.ts +189 -0
- package/src/assertions/values.ts +39 -0
- package/src/atlas.ts +2870 -0
- package/src/ballot.ts +866 -0
- package/src/bonedist.ts +643 -0
- package/src/chainfit.ts +2752 -0
- package/src/chains.ts +170 -0
- package/src/check.ts +4303 -0
- package/src/checkpics.ts +295 -0
- package/src/cli/core_commands.ts +1627 -0
- package/src/cli/repack.ts +414 -0
- package/src/cli/shared.ts +2776 -0
- package/src/cli/spine_commands.ts +820 -0
- package/src/compile.ts +9414 -0
- package/src/core/additive.ts +458 -0
- package/src/core/animation.ts +1050 -0
- package/src/core/clipping.ts +696 -0
- package/src/core/constraints.ts +1876 -0
- package/src/core/constraints_path.ts +964 -0
- package/src/core/constraints_physics.ts +881 -0
- package/src/core/constraints_slider.ts +635 -0
- package/src/core/deform.ts +613 -0
- package/src/core/draw_order.ts +125 -0
- package/src/core/events.ts +135 -0
- package/src/core/hooks.ts +249 -0
- package/src/core/index.ts +1400 -0
- package/src/core/raw.ts +739 -0
- package/src/core/skins.ts +129 -0
- package/src/core/uvs.ts +469 -0
- package/src/core/vertices.ts +490 -0
- package/src/core/walk.ts +197 -0
- package/src/core/world.ts +289 -0
- package/src/correspondence.ts +15 -0
- package/src/deformbuild.ts +60 -0
- package/src/deformgen.ts +630 -0
- package/src/deformmeasure.ts +732 -0
- package/src/deformreport.ts +373 -0
- package/src/deformstructure.ts +386 -0
- package/src/deformsurvey.ts +2162 -0
- package/src/depth.ts +784 -0
- package/src/diff.ts +2252 -0
- package/src/emit.ts +134 -0
- package/src/emit_spine.ts +854 -0
- package/src/errors.ts +53 -0
- package/src/framing.ts +819 -0
- package/src/generation.ts +139 -0
- package/src/ingest.ts +2293 -0
- package/src/json-position.ts +253 -0
- package/src/keyorder.ts +587 -0
- package/src/keys.ts +486 -0
- package/src/ladder.ts +121 -0
- package/src/mesh.ts +2382 -0
- package/src/meshcompare.ts +1191 -0
- package/src/meshquality.ts +2051 -0
- package/src/meshrasters.ts +944 -0
- package/src/meshreduce.ts +1444 -0
- package/src/model.ts +1245 -0
- package/src/motion.ts +809 -0
- package/src/nonfinite.ts +54 -0
- package/src/package_meta.ts +48 -0
- package/src/png.ts +297 -0
- package/src/pose.ts +2324 -0
- package/src/preview.ts +434 -0
- package/src/region_joins.ts +54 -0
- package/src/render.ts +1013 -0
- package/src/render_core.ts +871 -0
- package/src/render_shared.ts +2958 -0
- package/src/repack.ts +495 -0
- package/src/rig.ts +2941 -0
- package/src/slots.ts +892 -0
- package/src/spine_side.ts +138 -0
- package/src/timelines.ts +837 -0
- package/src/trackgen.ts +364 -0
- package/src/transform.ts +310 -0
- package/src/types.ts +1797 -0
- package/src/validate.ts +3875 -0
- package/tools/contact.ts +126 -0
- package/tools/editor_roundtrip.ts +1641 -0
- package/tools/font5x7.ts +101 -0
- package/tools/measure_contact_depth.ts +105 -0
- package/tools/plate.ts +508 -0
- package/tools/png_probe.mjs +72 -0
package/bin/rigc.cjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rigc's `bin` entry has one job: hand off to Bun.
|
|
6
|
+
*
|
|
7
|
+
* npm's `bin` field has to be something any installed Node can run, but rigc
|
|
8
|
+
* itself is a Bun script (top-level await, Bun's own APIs) — its own shebang
|
|
9
|
+
* says so. On a machine without Bun that used to fail as a bare
|
|
10
|
+
* `env: bun: No such file or directory`, with no hint why. This file exists
|
|
11
|
+
* so that failure explains itself: if `bun` is on PATH, run the real CLI
|
|
12
|
+
* (cli.ts, next to this file) under it and disappear — argv, stdio, the exit
|
|
13
|
+
* code and signals all pass straight through. If it isn't, say so once and
|
|
14
|
+
* stop. No downloads, no network, no writes — just the hand-off or the
|
|
15
|
+
* message.
|
|
16
|
+
*
|
|
17
|
+
* ## Which entry (issue #1061)
|
|
18
|
+
*
|
|
19
|
+
* `@esotericsoftware/spine-core` is a devDependency: a clone and CI have it, an
|
|
20
|
+
* install of the package does not unless somebody adds it beside. So the
|
|
21
|
+
* hand-off has two targets and one rule. When the runtime resolves from this
|
|
22
|
+
* package's own location — Node's resolution, from the package root, which is
|
|
23
|
+
* what an import in `cli.ts` would find — the target is `cli.ts`, every
|
|
24
|
+
* command, the round trip included. When it does not, the target is
|
|
25
|
+
* `cli_core.ts`, the entry that links nothing of the runtime and refuses by
|
|
26
|
+
* name the commands that need it. Nothing else chooses: no environment
|
|
27
|
+
* variable, no flag. `--version` says which ran and why, on stderr, so the
|
|
28
|
+
* version on stdout stays one line a script can read.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const path = require('node:path');
|
|
32
|
+
const fs = require('node:fs');
|
|
33
|
+
const { spawnSync } = require('node:child_process');
|
|
34
|
+
|
|
35
|
+
const root = path.join(__dirname, '..');
|
|
36
|
+
const RUNTIME = '@esotericsoftware/spine-core';
|
|
37
|
+
|
|
38
|
+
/** The runtime's version where it resolves from the package root, or null where it does not. */
|
|
39
|
+
function runtimeVersion() {
|
|
40
|
+
let manifest;
|
|
41
|
+
try {
|
|
42
|
+
manifest = require.resolve(`${RUNTIME}/package.json`, { paths: [root] });
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const version = JSON.parse(fs.readFileSync(manifest, 'utf8')).version;
|
|
48
|
+
return typeof version === 'string' ? version : '(no version field)';
|
|
49
|
+
} catch {
|
|
50
|
+
return '(unreadable package.json)';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const present = runtimeVersion();
|
|
55
|
+
const entry = present === null ? 'cli_core.ts' : 'cli.ts';
|
|
56
|
+
const args = process.argv.slice(2);
|
|
57
|
+
const result = spawnSync('bun', [path.join(root, entry), ...args], { stdio: 'inherit' });
|
|
58
|
+
|
|
59
|
+
if (!result.error && result.status === 0 && args.length === 1 && (args[0] === '--version' || args[0] === '-v')) {
|
|
60
|
+
process.stderr.write(
|
|
61
|
+
present === null
|
|
62
|
+
? `entry: ${entry} — ${RUNTIME} absent — the round trip and the commands that need it are not available here; see --help\n`
|
|
63
|
+
: `entry: ${entry} — ${RUNTIME} ${present} present\n`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (result.error) {
|
|
68
|
+
if (result.error.code === 'ENOENT') {
|
|
69
|
+
process.stderr.write('rigc runs on Bun, which was not found on PATH — install it from https://bun.sh\n');
|
|
70
|
+
} else {
|
|
71
|
+
process.stderr.write(`rigc: could not launch bun: ${result.error.message}\n`);
|
|
72
|
+
}
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (result.signal) {
|
|
77
|
+
// A signal (e.g. Ctrl-C) killed the child — die the same way instead of
|
|
78
|
+
// inventing an exit code, so the caller sees the same thing it would have
|
|
79
|
+
// seen running bun directly.
|
|
80
|
+
process.kill(process.pid, result.signal);
|
|
81
|
+
} else {
|
|
82
|
+
process.exit(typeof result.status === 'number' ? result.status : 1);
|
|
83
|
+
}
|
package/cli.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* rigc — the rig compiler.
|
|
4
|
+
*
|
|
5
|
+
* bun cli.ts build --rig <path> --motion <path> --out <dir> [--manifest <path>]
|
|
6
|
+
* bun cli.ts build --cut <name> --cuts <cuts.json>
|
|
7
|
+
* bun cli.ts explain --rig <path> --motion <path> --out <dir>
|
|
8
|
+
* bun cli.ts explain --cut <name> --cuts <cuts.json>
|
|
9
|
+
* bun cli.ts validate <dir> re-run the gate on artifacts on disk
|
|
10
|
+
* bun cli.ts check --candidate <dir> --frames <dir> compare against pictures
|
|
11
|
+
*
|
|
12
|
+
* `build` emits ONLY if validate is green. That ordering is the point: the
|
|
13
|
+
* compiler is allowed to be wrong, it is not allowed to leave the wrong thing
|
|
14
|
+
* on disk.
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ Green is a claim about VALIDITY and about nothing else. The gate has no way
|
|
17
|
+
* to know whether the animation is the one that was asked for — a build with
|
|
18
|
+
* every easing reversed passes it — so `check` is the other half of the loop, and
|
|
19
|
+
* it is a separate command because it needs something the gate does not have: a
|
|
20
|
+
* picture of what the result is supposed to look like.
|
|
21
|
+
*
|
|
22
|
+
* rigc knows nothing about any particular project. A cut is a rig spec, a motion
|
|
23
|
+
* spec and an output directory — plus a cut manifest when there is measured art
|
|
24
|
+
* behind it — and a `cuts.json` is a named table of them:
|
|
25
|
+
*
|
|
26
|
+
* {
|
|
27
|
+
* "my_cut": { "rig": "…/rigs/my_rig.rig.json", "motion": "…/my.motion.json",
|
|
28
|
+
* "out": "…/spine", "manifest": "…/manifest.json" }
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* Its paths resolve against the cuts.json file itself, so the table travels
|
|
32
|
+
* with the project that owns the art rather than with this repository.
|
|
33
|
+
*/
|
|
34
|
+
import { PROFILE_RULES, SPINE_COMMAND_REFUSALS, SPINE_COMMAND_RUNS } from './src/cli/spine_commands.ts';
|
|
35
|
+
import { CORE_COMMAND_RUNS } from './src/cli/core_commands.ts';
|
|
36
|
+
import { runCli } from './src/cli/shared.ts';
|
|
37
|
+
// The Spine side of the seam (issue #1052): loading the modules that link spine-core registers what they pose and read
|
|
38
|
+
// through it — an export's poser and loader, `--poser spine`, a fallback, the deform survey through the runtime — into
|
|
39
|
+
// `src/spine_side.ts`, which the commands below reach it through.
|
|
40
|
+
import './src/render.ts';
|
|
41
|
+
import './src/deformmeasure.ts';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* One entry of a cuts.json, every path relative to the cuts.json file — the
|
|
45
|
+
* shape `src/cli/shared.ts` reads, re-exported where it was always declared.
|
|
46
|
+
*/
|
|
47
|
+
export type { CutEntry, CutTable } from './src/cli/shared.ts';
|
|
48
|
+
|
|
49
|
+
// ⭐ Every command, every refusal and every exit code as they always were: the dispatch, the documentation and the
|
|
50
|
+
// bodies moved to `src/cli/` unchanged (issue #1052), and this entry registers all of them. `cli_core.ts` registers the
|
|
51
|
+
// commands whose bodies reach nothing of the runtime, and links none of it.
|
|
52
|
+
runCli(
|
|
53
|
+
{
|
|
54
|
+
checkout: 'cli.ts',
|
|
55
|
+
linksRuntime: true,
|
|
56
|
+
runs: { ...CORE_COMMAND_RUNS, ...SPINE_COMMAND_RUNS },
|
|
57
|
+
profileRules: PROFILE_RULES,
|
|
58
|
+
refusals: SPINE_COMMAND_REFUSALS,
|
|
59
|
+
},
|
|
60
|
+
process.argv.slice(2),
|
|
61
|
+
);
|
package/cli_core.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* rigc's second entry: the commands that reach nothing of spine-core (issue
|
|
4
|
+
* #1052, step 4e of #380).
|
|
5
|
+
*
|
|
6
|
+
* bun cli_core.ts render --candidate <dir> [flags]
|
|
7
|
+
* bun cli_core.ts check --candidate <dir> --frames <dir> [flags]
|
|
8
|
+
* bun cli_core.ts --help the commands this entry runs
|
|
9
|
+
*
|
|
10
|
+
* Which commands those are is not listed here: it is every command whose
|
|
11
|
+
* `runtime` is `false` in the one command table (`src/cli/shared.ts`), and
|
|
12
|
+
* every one whose `runtime` states a second body (`runtime.core`, below), and
|
|
13
|
+
* `--help` prints exactly that set. This file imports nothing that links the
|
|
14
|
+
* runtime — no module it reaches, statically, imports
|
|
15
|
+
* `@esotericsoftware/spine-core` — so it runs with the package absent
|
|
16
|
+
* (`RC24`/`RC25` in `selftest.ts` build that state and hold it). Each command
|
|
17
|
+
* prints and writes what `cli.ts` prints and writes for it.
|
|
18
|
+
*
|
|
19
|
+
* 📦 It is also what an install runs (issue #1061): `bin/rigc.cjs` hands `rigc`
|
|
20
|
+
* to this file wherever `@esotericsoftware/spine-core` does not resolve from the
|
|
21
|
+
* package — a devDependency, so every install until somebody adds it beside —
|
|
22
|
+
* and to `cli.ts` wherever it does. So the texts this entry prints are read in a
|
|
23
|
+
* clone and in an install alike, and where one names the entry that links the
|
|
24
|
+
* runtime it names both routes to it (issue #1072): installed, the same `rigc`
|
|
25
|
+
* once the runtime is installed beside the package; from a source checkout,
|
|
26
|
+
* `bun cli.ts`.
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ What it cannot do, and refuses by name rather than reaching for: an input
|
|
29
|
+
* only the runtime reads — a Spine export, `--poser spine`, a fallback the
|
|
30
|
+
* poser line names, the deform survey of a build the core refuses — and a
|
|
31
|
+
* command whose body is the runtime's (`validate`, `bench`, `bonedist`,
|
|
32
|
+
* `preview`, `vote`). Both say what they needed spine-core for and that this
|
|
33
|
+
* entry links none of it; the command's refusal also names the two routes to
|
|
34
|
+
* the entry that runs it.
|
|
35
|
+
*
|
|
36
|
+
* `build` is the one name with a body here of its own (issue #1060,
|
|
37
|
+
* `CORE_ENTRY_RUNS`): `cli.ts build`'s body (`runBuild`), writing the same
|
|
38
|
+
* files, with another gate — the model side over the document and the round
|
|
39
|
+
* trip's own rules restated over the emitted text, A00 (spine-core's parse) a
|
|
40
|
+
* SKIP naming it. `--help` and `build --help` say so; the command table states
|
|
41
|
+
* it (`runtime.core` in `src/cli/shared.ts`).
|
|
42
|
+
*/
|
|
43
|
+
import { CORE_COMMAND_RUNS, CORE_ENTRY_RUNS } from './src/cli/core_commands.ts';
|
|
44
|
+
import { runCli } from './src/cli/shared.ts';
|
|
45
|
+
|
|
46
|
+
runCli({ checkout: 'cli_core.ts', linksRuntime: false, runs: { ...CORE_COMMAND_RUNS, ...CORE_ENTRY_RUNS } }, process.argv.slice(2));
|