@anime-studio/cli 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +44 -2
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +218 -0
- package/dist/bin.js.map +1 -0
- package/dist/describe.d.ts +7 -0
- package/dist/describe.d.ts.map +1 -0
- package/dist/describe.js +48 -0
- package/dist/describe.js.map +1 -0
- package/dist/doctor.d.ts +44 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +121 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/load.d.ts +13 -0
- package/dist/load.d.ts.map +1 -0
- package/dist/load.js +41 -0
- package/dist/load.js.map +1 -0
- package/package.json +54 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dener Fernandes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @anime-studio/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@anime-studio/cli)
|
|
4
|
+
[](https://github.com/denerFernandes/animeStudio/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/denerFernandes/animeStudio/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Part of [animeStudio](https://github.com/denerFernandes/animeStudio), a deterministic 2D/2.5D cartoon animation engine: characters are
|
|
8
|
+
SVG art bound to skeletons, scenes are JSON documents, and every frame is a pure function of the
|
|
9
|
+
documents and the time.
|
|
10
|
+
|
|
11
|
+
The `toon` command line: validate, describe, render, debug and lip sync character and scene documents, import SVG drawings, write the JSON schemas.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @anime-studio/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Requires Node.js 22 or later (or a modern browser / bundler). The packages are ES modules with
|
|
20
|
+
TypeScript types included.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
toon --help
|
|
26
|
+
toon validate my.scene.json # schema, then assets; exit 1 on errors
|
|
27
|
+
toon describe pip.toon.json # what can be animated — paste into AI prompts
|
|
28
|
+
toon render my.scene.json --time 3 -o frame.svg
|
|
29
|
+
toon lipsync line.wav --text "Hello there!" -o line.cues.json
|
|
30
|
+
toon debug my.sequence.json # diagnostics: refs, ids, pops…
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or without installing: `npx @anime-studio/cli --help`.
|
|
34
|
+
|
|
35
|
+
## Documentation
|
|
36
|
+
|
|
37
|
+
- [Getting started and features](https://github.com/denerFernandes/animeStudio#readme)
|
|
38
|
+
- [Format specification](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md)
|
|
39
|
+
- [API reference](https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md)
|
|
40
|
+
- [Authoring guide for AI agents](https://github.com/denerFernandes/animeStudio/blob/master/docs/AI_GUIDE.md)
|
|
41
|
+
- [Changelog](https://github.com/denerFernandes/animeStudio/blob/master/CHANGELOG.md)
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT © Dener Fernandes
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { parseArgs } from "node:util";
|
|
5
|
+
import { evaluateScene, frameToSVG, jsonSchemas, previewScene, validateScene, validateSequence, validateToon, } from "@anime-studio/core";
|
|
6
|
+
import { prepareScene } from "@anime-studio/rigid";
|
|
7
|
+
import { importSvg } from "@anime-studio/import-svg";
|
|
8
|
+
import { lipsyncFile } from "@anime-studio/lipsync/node";
|
|
9
|
+
import { describeCharacter } from "./describe.js";
|
|
10
|
+
import { debugDocument, doctor } from "./doctor.js";
|
|
11
|
+
import { loadSceneAssets, readJson, tryLoadSceneAssets } from "./load.js";
|
|
12
|
+
const ENGINES = ["auto", "rhubarb", "align", "amplitude"];
|
|
13
|
+
const HELP = `toon — animeStudio command line
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
toon validate <file.toon.json|.scene.json|.sequence.json>... Validate documents (exit 1 on errors)
|
|
17
|
+
toon describe <file.toon.json> List controls, clips and channels (great for AI prompts)
|
|
18
|
+
toon schema [--out dir] Write JSON Schemas (toon, scene, sequence)
|
|
19
|
+
toon lipsync <audio.wav> [--text "..."] [--lang pt] [--engine ${ENGINES.join("|")}] [-o cues.json]
|
|
20
|
+
toon import-svg <drawing.svg> [--name id] [-o out.toon.json]
|
|
21
|
+
toon render <file> [--time 1.5] [--clip walk] [-o frame.svg] Render one frame to SVG
|
|
22
|
+
toon debug <scene|sequence> [--from s] [--to s] [--json] Diagnose library output frame by frame (exit 1 on errors)
|
|
23
|
+
toon doctor <video.mp4> <scene|sequence> [--json] Find flickers / unpainted nodes in a render
|
|
24
|
+
toon --help | -h This text
|
|
25
|
+
`;
|
|
26
|
+
/** A time argument as a number (a typo is an error, not a NaN frame). */
|
|
27
|
+
function num(v, flag) {
|
|
28
|
+
const n = Number(v);
|
|
29
|
+
if (!Number.isFinite(n)) {
|
|
30
|
+
console.error(`${flag}: not a number: ${v}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
function out(path, content) {
|
|
36
|
+
if (path) {
|
|
37
|
+
writeFileSync(path, content);
|
|
38
|
+
console.error(`wrote ${path}`);
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
process.stdout.write(content + "\n");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Validates one document: the schema first, then — for a scene — the assets it references, each
|
|
45
|
+
* file that cannot be loaded reported as an issue of its own, and only then the compile check.
|
|
46
|
+
*/
|
|
47
|
+
function validateFile(file) {
|
|
48
|
+
let doc;
|
|
49
|
+
try {
|
|
50
|
+
doc = readJson(file);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
return { ok: false, issues: [{ path: "(file)", message: e.message, severity: "error" }] };
|
|
54
|
+
}
|
|
55
|
+
const format = doc && typeof doc === "object" ? doc.format : undefined;
|
|
56
|
+
if (format === "toon-sequence")
|
|
57
|
+
return validateSequence(doc);
|
|
58
|
+
if (format !== "toon-scene")
|
|
59
|
+
return validateToon(doc);
|
|
60
|
+
const schema = validateScene(doc);
|
|
61
|
+
if (!schema.ok)
|
|
62
|
+
return schema;
|
|
63
|
+
const { assets, issues } = tryLoadSceneAssets(file, schema.value);
|
|
64
|
+
if (issues.length)
|
|
65
|
+
return { ok: false, issues: [...schema.issues, ...issues] };
|
|
66
|
+
return validateScene(doc, assets);
|
|
67
|
+
}
|
|
68
|
+
async function main() {
|
|
69
|
+
const [cmd, ...rest] = process.argv.slice(2);
|
|
70
|
+
const { values, positionals } = parseArgs({
|
|
71
|
+
args: rest,
|
|
72
|
+
allowPositionals: true,
|
|
73
|
+
options: {
|
|
74
|
+
out: { type: "string", short: "o" },
|
|
75
|
+
text: { type: "string" },
|
|
76
|
+
lang: { type: "string" },
|
|
77
|
+
engine: { type: "string" },
|
|
78
|
+
name: { type: "string" },
|
|
79
|
+
time: { type: "string" },
|
|
80
|
+
clip: { type: "string" },
|
|
81
|
+
from: { type: "string" },
|
|
82
|
+
to: { type: "string" },
|
|
83
|
+
json: { type: "boolean" },
|
|
84
|
+
help: { type: "boolean", short: "h" },
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
if (!cmd || cmd === "--help" || cmd === "-h" || values.help) {
|
|
88
|
+
process.stdout.write(HELP);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
switch (cmd) {
|
|
92
|
+
case "validate": {
|
|
93
|
+
let failed = false;
|
|
94
|
+
for (const file of positionals) {
|
|
95
|
+
const result = validateFile(file);
|
|
96
|
+
const errors = result.issues.filter((i) => i.severity === "error");
|
|
97
|
+
console.log(`${errors.length || !result.ok ? "✗" : "✓"} ${file}`);
|
|
98
|
+
for (const i of result.issues)
|
|
99
|
+
console.log(` ${i.severity === "error" ? "error" : "warn "} ${i.path}: ${i.message}`);
|
|
100
|
+
if (!result.ok)
|
|
101
|
+
failed = true;
|
|
102
|
+
}
|
|
103
|
+
process.exit(failed ? 1 : 0);
|
|
104
|
+
}
|
|
105
|
+
case "describe": {
|
|
106
|
+
const r = validateToon(readJson(positionals[0]));
|
|
107
|
+
if (!r.ok)
|
|
108
|
+
throw new Error(r.issues.map((i) => `${i.path}: ${i.message}`).join("\n"));
|
|
109
|
+
out(values.out, describeCharacter(r.value));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
case "schema": {
|
|
113
|
+
const dir = values.out ?? "schemas";
|
|
114
|
+
mkdirSync(dir, { recursive: true });
|
|
115
|
+
const s = jsonSchemas();
|
|
116
|
+
writeFileSync(join(dir, "toon.schema.json"), JSON.stringify(s.toon, null, 2) + "\n");
|
|
117
|
+
writeFileSync(join(dir, "scene.schema.json"), JSON.stringify(s.scene, null, 2) + "\n");
|
|
118
|
+
writeFileSync(join(dir, "sequence.schema.json"), JSON.stringify(s.sequence, null, 2) + "\n");
|
|
119
|
+
console.error(`wrote ${dir}/toon.schema.json, ${dir}/scene.schema.json, ${dir}/sequence.schema.json`);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
case "lipsync": {
|
|
123
|
+
const engine = values.engine ?? "auto";
|
|
124
|
+
if (!ENGINES.includes(engine))
|
|
125
|
+
throw new Error(`--engine must be one of ${ENGINES.join(", ")} (got "${engine}")`);
|
|
126
|
+
const cues = await lipsyncFile(positionals[0], { text: values.text, language: values.lang, engine: engine });
|
|
127
|
+
out(values.out, JSON.stringify(cues, null, 2));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
case "import-svg": {
|
|
131
|
+
const { doc, warnings } = importSvg(readFileSync(positionals[0], "utf8"), { name: values.name });
|
|
132
|
+
for (const w of warnings)
|
|
133
|
+
console.error(`warn ${w}`);
|
|
134
|
+
out(values.out, JSON.stringify(doc, null, 2));
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
case "render": {
|
|
138
|
+
const doc = readJson(positionals[0]);
|
|
139
|
+
const t = num(values.time ?? "0", "--time");
|
|
140
|
+
const scene = doc.format === "toon-scene"
|
|
141
|
+
? await prepareScene(doc, loadSceneAssets(positionals[0], doc))
|
|
142
|
+
: previewScene(doc, { clip: values.clip });
|
|
143
|
+
out(values.out, frameToSVG(evaluateScene(scene, t)));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
case "debug": {
|
|
147
|
+
const issues = await debugDocument(positionals[0], values.from ? num(values.from, "--from") : 0, values.to ? num(values.to, "--to") : undefined);
|
|
148
|
+
if (values.json)
|
|
149
|
+
out(values.out, JSON.stringify(issues, null, 2));
|
|
150
|
+
else {
|
|
151
|
+
// Group identical findings across frames into ranges.
|
|
152
|
+
const groups = new Map();
|
|
153
|
+
for (const d of issues) {
|
|
154
|
+
const id = `${d.severity}|${d.kind}|${d.key ?? ""}|${d.message}`;
|
|
155
|
+
const g = groups.get(id) ?? { d, frames: [] };
|
|
156
|
+
g.frames.push(d.frame);
|
|
157
|
+
groups.set(id, g);
|
|
158
|
+
}
|
|
159
|
+
const ranges = (fs) => {
|
|
160
|
+
const out = [];
|
|
161
|
+
let start = fs[0];
|
|
162
|
+
let prev = fs[0];
|
|
163
|
+
for (const f of [...fs.slice(1), NaN]) {
|
|
164
|
+
if (f === prev + 1)
|
|
165
|
+
prev = f;
|
|
166
|
+
else {
|
|
167
|
+
out.push(start === prev ? `f${start}` : `f${start}–${prev}`);
|
|
168
|
+
start = prev = f;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return out.length > 6 ? `${out.slice(0, 6).join(", ")}, … (${fs.length} frames)` : out.join(", ");
|
|
172
|
+
};
|
|
173
|
+
console.log(issues.length ? `${issues.length} findings in ${groups.size} groups` : "✓ no findings");
|
|
174
|
+
for (const { d, frames } of [...groups.values()].sort((a, b) => b.frames.length - a.frames.length)) {
|
|
175
|
+
console.log(` [${d.severity}] ${d.kind}${d.key ? ` ${d.key}` : ""}: ${d.message} — ${ranges(frames)}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
process.exit(issues.some((d) => d.severity === "error") ? 1 : 0);
|
|
179
|
+
}
|
|
180
|
+
case "doctor": {
|
|
181
|
+
const report = await doctor(positionals[0], positionals[1]);
|
|
182
|
+
if (values.json)
|
|
183
|
+
return out(values.out, JSON.stringify(report, null, 2));
|
|
184
|
+
console.log(`${report.frames} frames analyzed`);
|
|
185
|
+
console.log(`A→B→A flickers: ${report.flickers.length}`);
|
|
186
|
+
for (const fl of report.flickers.slice(0, 30)) {
|
|
187
|
+
console.log(` f${fl.frame} ${fl.time.toFixed(3)}s — ${fl.libStable ? "library output stable → browser paint/capture problem" : "library node set changed → animation/logic"}`);
|
|
188
|
+
}
|
|
189
|
+
const capture = report.flickers.filter((f) => f.libStable).map((f) => f.frame);
|
|
190
|
+
if (capture.length > 0)
|
|
191
|
+
console.log(` Capture glitches are usually nondeterministic: re-render those frames (e.g. \`remotion still … --frame=${capture[0]}\`) or the whole video.`);
|
|
192
|
+
if (report.strip) {
|
|
193
|
+
console.log(`Debug strip: ${report.strip.frameMismatches.length} barcode mismatches, ${report.strip.unpainted.length} unpainted node sentinels` +
|
|
194
|
+
` (${report.strip.unverifiable} skipped: transparent or strongly blurred nodes)`);
|
|
195
|
+
const byKey = new Map();
|
|
196
|
+
for (const u of report.strip.unpainted)
|
|
197
|
+
byKey.set(u.key, [...(byKey.get(u.key) ?? []), u.frame]);
|
|
198
|
+
for (const [key, frames] of [...byKey].sort((a, b) => b[1].length - a[1].length)) {
|
|
199
|
+
const node = report.strip.unpainted.find((u) => u.key === key);
|
|
200
|
+
console.log(` ${key}: not painted in ${frames.length} frames (${frames.slice(0, 12).join(", ")}${frames.length > 12 ? ", …" : ""})${node.filter ? ` · filter ${node.filter}` : ""}`);
|
|
201
|
+
}
|
|
202
|
+
for (const m of report.strip.frameMismatches.slice(0, 10))
|
|
203
|
+
console.log(` f${m.frame}: barcode says ${m.barcode} (stale or reordered capture)`);
|
|
204
|
+
}
|
|
205
|
+
else
|
|
206
|
+
console.log("No debug strip found (render with `debug: true` to pinpoint unpainted nodes).");
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
default:
|
|
210
|
+
process.stderr.write(`unknown command "${cmd}"\n\n${HELP}`);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
main().catch((e) => {
|
|
215
|
+
console.error(e.message);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
218
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAKL,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAsB,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEvE,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,CAA6C,CAAC;AAEtG,MAAM,IAAI,GA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AAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToonDoc } from "@anime-studio/core";
|
|
2
|
+
/**
|
|
3
|
+
* Human/AI-readable summary of a character: everything that can be animated and how.
|
|
4
|
+
* Designed to be pasted into an LLM prompt before asking it to write a scene.
|
|
5
|
+
*/
|
|
6
|
+
export declare function describeCharacter(doc: ToonDoc): string;
|
|
7
|
+
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,oBAAoB,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CA8BtD"}
|
package/dist/describe.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compileRig } from "@anime-studio/core";
|
|
2
|
+
/**
|
|
3
|
+
* Human/AI-readable summary of a character: everything that can be animated and how.
|
|
4
|
+
* Designed to be pasted into an LLM prompt before asking it to write a scene.
|
|
5
|
+
*/
|
|
6
|
+
export function describeCharacter(doc) {
|
|
7
|
+
const rig = compileRig(doc);
|
|
8
|
+
const lines = [];
|
|
9
|
+
lines.push(`# Character "${rig.name}"`);
|
|
10
|
+
if (doc.meta?.description)
|
|
11
|
+
lines.push(String(doc.meta.description));
|
|
12
|
+
lines.push("");
|
|
13
|
+
lines.push("## Controls (prefer these)");
|
|
14
|
+
for (const c of Object.values(rig.controls)) {
|
|
15
|
+
if (c.type === "pose")
|
|
16
|
+
lines.push(`- controls.${c.name} (pose): ${Object.keys(c.poses).join(" | ")} — or a weight blend {name: weight}`);
|
|
17
|
+
else if (c.type === "viseme")
|
|
18
|
+
lines.push(`- controls.${c.name} (viseme): A B C D E F G H X — driven by the "say" action`);
|
|
19
|
+
else
|
|
20
|
+
lines.push(`- controls.${c.name} (aim): [x, y] or an actor/prop id — driven by the "lookAt" action`);
|
|
21
|
+
}
|
|
22
|
+
lines.push("");
|
|
23
|
+
lines.push("## Clips");
|
|
24
|
+
for (const c of Object.values(rig.clips)) {
|
|
25
|
+
lines.push(`- ${c.name}: ${c.duration}s${c.loop ? ", loop" : ""}${c.stride ? `, stride ${c.stride}px` : ""}`);
|
|
26
|
+
}
|
|
27
|
+
lines.push("");
|
|
28
|
+
lines.push("## Anchors");
|
|
29
|
+
for (const [k, a] of Object.entries(rig.anchors))
|
|
30
|
+
lines.push(`- ${k} (bone ${rig.bones[a.bone].id})`);
|
|
31
|
+
lines.push("");
|
|
32
|
+
lines.push("## Channels");
|
|
33
|
+
lines.push(`- bones.<id>.(rotation|x|y|scaleX|scaleY|squash) for bones: ${rig.bones.map((b) => b.id).join(", ")}`);
|
|
34
|
+
const switches = rig.parts.filter((p) => p.type === "switch");
|
|
35
|
+
for (const p of switches)
|
|
36
|
+
if (p.type === "switch")
|
|
37
|
+
lines.push(`- parts.${p.id}.variant: ${Object.keys(p.variants).join(" | ")}`);
|
|
38
|
+
for (const p of rig.parts)
|
|
39
|
+
if (p.type === "morph")
|
|
40
|
+
lines.push(`- parts.${p.id}.morph.<shape>: ${Object.keys(p.shapes).join(", ")}`);
|
|
41
|
+
lines.push(`- parts.<id>.opacity for parts: ${rig.parts.map((p) => p.id).join(", ")}`);
|
|
42
|
+
for (const k of rig.ik)
|
|
43
|
+
lines.push(`- ik.${k.id}.(x|y|mix): IK target offset for ${k.bones.map((b) => rig.bones[b].id).join(" → ")}`);
|
|
44
|
+
for (const b of rig.behaviors)
|
|
45
|
+
lines.push(`- behaviors.${b.id}.mix (${b.type})`);
|
|
46
|
+
return lines.join("\n");
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=describe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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C,EAAE,CAAC,CAAC;IACjI,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,KAAK;QAAE,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,mBAAmB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpI,KAAK,CAAC,IAAI,CAAC,mCAAmC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvF,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,oCAAoC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtI,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IACjF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/doctor.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Diagnostic, type RenderFrame } from "@anime-studio/core";
|
|
2
|
+
/** A scene or sequence loaded from disk, evaluable per frame. */
|
|
3
|
+
export interface Evaluable {
|
|
4
|
+
fps: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
duration: number;
|
|
8
|
+
frameAt(index: number): RenderFrame;
|
|
9
|
+
}
|
|
10
|
+
/** Rigid bodies are simulated (`prepareScene`), as a render would. */
|
|
11
|
+
export declare function loadEvaluable(path: string): Promise<Evaluable>;
|
|
12
|
+
/** Library-side diagnostics over a frame range. */
|
|
13
|
+
export declare function debugDocument(path: string, from?: number, to?: number): Promise<Diagnostic[]>;
|
|
14
|
+
export interface DoctorReport {
|
|
15
|
+
frames: number;
|
|
16
|
+
flickers: {
|
|
17
|
+
frame: number;
|
|
18
|
+
time: number;
|
|
19
|
+
libStable: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
/** Present when the video was rendered with `debug`. */
|
|
22
|
+
strip?: {
|
|
23
|
+
frameMismatches: {
|
|
24
|
+
frame: number;
|
|
25
|
+
barcode: number;
|
|
26
|
+
}[];
|
|
27
|
+
unpainted: {
|
|
28
|
+
frame: number;
|
|
29
|
+
time: number;
|
|
30
|
+
key: string;
|
|
31
|
+
filter?: string;
|
|
32
|
+
opacity?: number;
|
|
33
|
+
}[];
|
|
34
|
+
/** Sentinels skipped because their node was transparent or strongly blurred. */
|
|
35
|
+
unverifiable: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Analyzes a rendered video against its document: A→B→A flickers, whether the library output was
|
|
40
|
+
* stable at those frames (→ browser paint problem) and, for debug renders, exactly which nodes the
|
|
41
|
+
* browser did not paint.
|
|
42
|
+
*/
|
|
43
|
+
export declare function doctor(video: string, docPath: string): Promise<DoctorReport>;
|
|
44
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,WAAW,EAUjB,MAAM,oBAAoB,CAAC;AAI5B,iEAAiE;AACjE,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CACrC;AAED,sEAAsE;AACtE,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAoBpE;AAED,mDAAmD;AACnD,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAI,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAY9F;AAyBD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAChE,wDAAwD;IACxD,KAAK,CAAC,EAAE;QACN,eAAe,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACtD,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC7F,gFAAgF;QAChF,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAuDlF"}
|
package/dist/doctor.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { spawn, execFileSync } from "node:child_process";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { DEBUG_STRIP, compileSequence, diagnoseFrames, evaluateScene, evaluateSequence, findFlickers, readDebugStrip, } from "@anime-studio/core";
|
|
4
|
+
import { prepareScene } from "@anime-studio/rigid";
|
|
5
|
+
import { loadSceneAssets, readJson } from "./load.js";
|
|
6
|
+
/** Rigid bodies are simulated (`prepareScene`), as a render would. */
|
|
7
|
+
export async function loadEvaluable(path) {
|
|
8
|
+
const doc = readJson(path);
|
|
9
|
+
if (doc.format === "toon-sequence") {
|
|
10
|
+
const seqDoc = doc;
|
|
11
|
+
const base = dirname(resolve(path));
|
|
12
|
+
const scenes = Object.fromEntries(await Promise.all(Object.entries(seqDoc.scenes).map(async ([id, rel]) => {
|
|
13
|
+
const scenePath = resolve(base, rel);
|
|
14
|
+
const sceneDoc = readJson(scenePath);
|
|
15
|
+
return [id, await prepareScene(sceneDoc, loadSceneAssets(scenePath, sceneDoc))];
|
|
16
|
+
})));
|
|
17
|
+
const seq = compileSequence(seqDoc, { scenes });
|
|
18
|
+
return { fps: seq.fps, width: seq.width, height: seq.height, duration: seq.duration, frameAt: (i) => evaluateSequence(seq, i / seq.fps) };
|
|
19
|
+
}
|
|
20
|
+
const sceneDoc = doc;
|
|
21
|
+
const scene = await prepareScene(sceneDoc, loadSceneAssets(path, sceneDoc));
|
|
22
|
+
return { fps: scene.fps, width: scene.width, height: scene.height, duration: scene.duration, frameAt: (i) => evaluateScene(scene, i / scene.fps) };
|
|
23
|
+
}
|
|
24
|
+
/** Library-side diagnostics over a frame range. */
|
|
25
|
+
export async function debugDocument(path, from = 0, to) {
|
|
26
|
+
const ev = await loadEvaluable(path);
|
|
27
|
+
const first = Math.round(from * ev.fps);
|
|
28
|
+
// `duration × fps` can land a hair above a whole number (2.2 × 25 = 55.00…01): no extra frame for it.
|
|
29
|
+
const last = Math.min(Math.ceil(ev.duration * ev.fps - 1e-6) - 1, to !== undefined ? Math.round(to * ev.fps) : Infinity);
|
|
30
|
+
const frames = [];
|
|
31
|
+
const times = [];
|
|
32
|
+
for (let i = first; i <= last; i++) {
|
|
33
|
+
frames.push(ev.frameAt(i));
|
|
34
|
+
times.push(i / ev.fps);
|
|
35
|
+
}
|
|
36
|
+
return diagnoseFrames(frames, times).map((d) => ({ ...d, frame: d.frame + first }));
|
|
37
|
+
}
|
|
38
|
+
/** Streams decoded video frames (rgb24) through ffmpeg. Its stderr is read as it comes (a full pipe would stall ffmpeg) and quoted when it fails. */
|
|
39
|
+
async function readFrames(video, filter, w, h, onFrame) {
|
|
40
|
+
const size = w * h * 3;
|
|
41
|
+
await new Promise((resolvePromise, reject) => {
|
|
42
|
+
const ff = spawn("ffmpeg", ["-v", "error", "-i", video, "-vf", filter, "-f", "rawvideo", "-pix_fmt", "rgb24", "-"]);
|
|
43
|
+
let buf = Buffer.alloc(0);
|
|
44
|
+
let index = 0;
|
|
45
|
+
let errors = "";
|
|
46
|
+
ff.stderr.on("data", (chunk) => {
|
|
47
|
+
errors += chunk.toString();
|
|
48
|
+
});
|
|
49
|
+
ff.stdout.on("data", (chunk) => {
|
|
50
|
+
buf = Buffer.concat([buf, chunk]);
|
|
51
|
+
while (buf.length >= size) {
|
|
52
|
+
onFrame({ width: w, height: h, data: new Uint8Array(buf.subarray(0, size)) }, index++);
|
|
53
|
+
buf = buf.subarray(size);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
ff.on("error", (e) => reject(new Error(`ffmpeg is required for "toon doctor" (${e.message})`)));
|
|
57
|
+
ff.on("close", (code) => (code === 0 ? resolvePromise() : reject(new Error(`ffmpeg exited with ${code}${errors.trim() ? `: ${errors.trim()}` : ""}`))));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Analyzes a rendered video against its document: A→B→A flickers, whether the library output was
|
|
62
|
+
* stable at those frames (→ browser paint problem) and, for debug renders, exactly which nodes the
|
|
63
|
+
* browser did not paint.
|
|
64
|
+
*/
|
|
65
|
+
export async function doctor(video, docPath) {
|
|
66
|
+
const ev = await loadEvaluable(docPath);
|
|
67
|
+
const [vw, vh] = execFileSync("ffprobe", ["-v", "error", "-select_streams", "v:0", "-show_entries", "stream=width,height", "-of", "csv=p=0", video])
|
|
68
|
+
.toString()
|
|
69
|
+
.trim()
|
|
70
|
+
.split(",")
|
|
71
|
+
.map(Number);
|
|
72
|
+
// 1. Flicker detection on downscaled frames.
|
|
73
|
+
const small = [];
|
|
74
|
+
const sw = 192;
|
|
75
|
+
const sh = Math.round((sw * vh) / vw / 2) * 2;
|
|
76
|
+
await readFrames(video, `scale=${sw}:${sh}`, sw, sh, (img) => small.push(img));
|
|
77
|
+
const flickerFrames = findFlickers(small);
|
|
78
|
+
const libString = (i) => JSON.stringify(ev.frameAt(i).nodes.map((n) => n.key));
|
|
79
|
+
const flickers = flickerFrames.map((i) => ({
|
|
80
|
+
frame: i,
|
|
81
|
+
time: i / ev.fps,
|
|
82
|
+
// The node set is the same before/at/after → the library did not drop anything.
|
|
83
|
+
libStable: libString(i - 1) === libString(i) && libString(i) === libString(i + 1),
|
|
84
|
+
}));
|
|
85
|
+
// 2. Debug strip (if present): barcode + sentinels at native resolution.
|
|
86
|
+
const stripH = Math.round((DEBUG_STRIP * vh) / ev.height);
|
|
87
|
+
const full = { width: vw, height: vh, data: new Uint8Array(vw * vh * 3) };
|
|
88
|
+
const mismatches = [];
|
|
89
|
+
const unpainted = [];
|
|
90
|
+
let validBarcodes = 0;
|
|
91
|
+
let unverifiable = 0;
|
|
92
|
+
await readFrames(video, `crop=${vw}:${stripH}:0:${vh - stripH}`, vw, stripH, (strip, index) => {
|
|
93
|
+
full.data.set(strip.data, (vh - stripH) * vw * 3);
|
|
94
|
+
const expected = ev.frameAt(index);
|
|
95
|
+
const reading = readDebugStrip(full, expected);
|
|
96
|
+
if (reading.frameIndex === index)
|
|
97
|
+
validBarcodes++;
|
|
98
|
+
else
|
|
99
|
+
mismatches.push({ frame: index, barcode: reading.frameIndex });
|
|
100
|
+
for (const key of reading.missing) {
|
|
101
|
+
const node = expected.nodes.find((n) => n.key === key);
|
|
102
|
+
// Sentinels of transparent or strongly blurred nodes cannot be verified (their color fades).
|
|
103
|
+
const opacity = node && "opacity" in node ? node.opacity : undefined;
|
|
104
|
+
const blur = node && "filter" in node && node.filter ? Number(/blur\(([\d.]+)px\)/.exec(node.filter)?.[1] ?? 0) : 0;
|
|
105
|
+
if ((opacity !== undefined && opacity < 0.6) || blur >= 2) {
|
|
106
|
+
unverifiable++;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
unpainted.push({
|
|
110
|
+
frame: index,
|
|
111
|
+
time: index / ev.fps,
|
|
112
|
+
key,
|
|
113
|
+
filter: node && "filter" in node ? node.filter : undefined,
|
|
114
|
+
opacity: node && "opacity" in node ? node.opacity : undefined,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const isDebug = validBarcodes > small.length * 0.5;
|
|
119
|
+
return { frames: small.length, flickers, strip: isDebug ? { frameMismatches: mismatches, unpainted, unverifiable } : undefined };
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAML,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAWnD,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAwB,CAAC;IAClD,IAAI,GAAG,CAAC,MAAM,KAAK,eAAe,EAAE,CA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,CAAC;gBACf,SAAS;YACX,CAAC;YACD,SAAS,CAAC,IAAI,CAAC;gBACb,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC,GAAG;gBACpB,GAAG;gBACH,MAAM,EAAE,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBAC1D,OAAO,EAAE,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,aAAa,GAAG,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;IACnD,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACnI,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@anime-studio/cli` as a library: the parts of the `toon` command line that are useful on their
|
|
3
|
+
* own (document loading, library-side diagnostics, the video doctor, character descriptions).
|
|
4
|
+
* Importing this module runs nothing; the command line itself is `bin.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export { describeCharacter } from "./describe.js";
|
|
7
|
+
export { type DoctorReport, type Evaluable, debugDocument, doctor, loadEvaluable } from "./doctor.js";
|
|
8
|
+
export { loadSceneAssets, readJson } from "./load.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@anime-studio/cli` as a library: the parts of the `toon` command line that are useful on their
|
|
3
|
+
* own (document loading, library-side diagnostics, the video doctor, character descriptions).
|
|
4
|
+
* Importing this module runs nothing; the command line itself is `bin.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export { describeCharacter } from "./describe.js";
|
|
7
|
+
export { debugDocument, doctor, loadEvaluable } from "./doctor.js";
|
|
8
|
+
export { loadSceneAssets, readJson } from "./load.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAqC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/load.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Issue, SceneAssets, SceneDoc } from "@anime-studio/core";
|
|
2
|
+
export declare const readJson: (path: string) => unknown;
|
|
3
|
+
/** Loads the characters and lip sync files referenced by a scene (paths relative to the scene). Throws on the first file that cannot be read. */
|
|
4
|
+
export declare function loadSceneAssets(scenePath: string, scene: SceneDoc): SceneAssets;
|
|
5
|
+
/**
|
|
6
|
+
* Loads a scene's assets, reporting every file that cannot be read or parsed as an issue at
|
|
7
|
+
* `characters.<id>` / `lipsync.<id>` instead of throwing (for `toon validate`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function tryLoadSceneAssets(scenePath: string, scene: SceneDoc): {
|
|
10
|
+
assets: SceneAssets;
|
|
11
|
+
issues: Issue[];
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAc,WAAW,EAAE,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAE5F,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,OAAiD,CAAC;AAE1F,iJAAiJ;AACjJ,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,WAAW,CAI/E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAsB/G"}
|
package/dist/load.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
export const readJson = (path) => JSON.parse(readFileSync(path, "utf8"));
|
|
4
|
+
/** Loads the characters and lip sync files referenced by a scene (paths relative to the scene). Throws on the first file that cannot be read. */
|
|
5
|
+
export function loadSceneAssets(scenePath, scene) {
|
|
6
|
+
const { assets, issues } = tryLoadSceneAssets(scenePath, scene);
|
|
7
|
+
if (issues.length)
|
|
8
|
+
throw new Error(`${issues[0].path}: ${issues[0].message}`);
|
|
9
|
+
return assets;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Loads a scene's assets, reporting every file that cannot be read or parsed as an issue at
|
|
13
|
+
* `characters.<id>` / `lipsync.<id>` instead of throwing (for `toon validate`).
|
|
14
|
+
*/
|
|
15
|
+
export function tryLoadSceneAssets(scenePath, scene) {
|
|
16
|
+
const base = dirname(resolve(scenePath));
|
|
17
|
+
const issues = [];
|
|
18
|
+
const load = (section, id, rel) => {
|
|
19
|
+
try {
|
|
20
|
+
return readJson(resolve(base, rel));
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
issues.push({ path: `${section}.${id}`, message: `cannot load "${rel}": ${e.message}`, severity: "error" });
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const characters = {};
|
|
28
|
+
for (const [id, path] of Object.entries(scene.characters ?? {})) {
|
|
29
|
+
const doc = load("characters", id, path);
|
|
30
|
+
if (doc)
|
|
31
|
+
characters[id] = doc;
|
|
32
|
+
}
|
|
33
|
+
const lipsync = {};
|
|
34
|
+
for (const [id, path] of Object.entries(scene.lipsync ?? {})) {
|
|
35
|
+
const doc = load("lipsync", id, path);
|
|
36
|
+
if (doc)
|
|
37
|
+
lipsync[id] = doc;
|
|
38
|
+
}
|
|
39
|
+
return { assets: { characters, lipsync }, issues };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=load.js.map
|
package/dist/load.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1F,iJAAiJ;AACjJ,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,KAAe;IAChE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAAC,SAA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EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QAC7D,MAAM,GAAG,GAAG,IAAI,CAAa,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,GAAG;YAAE,OAAO,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anime-studio/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The toon CLI for animeStudio: validate, describe, render, debug and lip sync character and scene documents.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"animation",
|
|
7
|
+
"cartoon",
|
|
8
|
+
"2d-animation",
|
|
9
|
+
"svg",
|
|
10
|
+
"character-animation",
|
|
11
|
+
"animestudio",
|
|
12
|
+
"cli"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Dener Fernandes (https://github.com/denerFernandes)",
|
|
16
|
+
"homepage": "https://github.com/denerFernandes/animeStudio/tree/master/packages/cli#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/denerFernandes/animeStudio.git",
|
|
20
|
+
"directory": "packages/cli"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/denerFernandes/animeStudio/issues"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"toon": "./dist/bin.js"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@anime-studio/core": "0.2.0",
|
|
50
|
+
"@anime-studio/rigid": "0.2.0",
|
|
51
|
+
"@anime-studio/import-svg": "0.2.0",
|
|
52
|
+
"@anime-studio/lipsync": "0.2.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"tsx": "^4.23.15"
|
|
56
|
+
}
|
|
6
57
|
}
|