@anime-studio/cli 0.2.0 → 0.2.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/dist/bin.js +20 -0
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/skills.d.ts +28 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +56 -0
- package/dist/skills.js.map +1 -0
- package/package.json +6 -5
- package/skills/animestudio/SKILL.md +165 -0
- package/skills/animestudio/examples/first-frame.ts +54 -0
- package/skills/animestudio/examples/hello.scene.json +50 -0
- package/skills/animestudio/examples/hello.sequence.json +13 -0
- package/skills/animestudio/examples/remotion/Root.tsx +25 -0
- package/skills/animestudio/examples/remotion/index.ts +5 -0
- package/skills/animestudio/examples/render-video.ts +110 -0
- package/skills/animestudio/references/packages.md +54 -0
- package/skills/animestudio/references/rendering.md +127 -0
- package/skills/animestudio/references/scene-format.md +101 -0
- package/skills/animestudio/references/validation-and-debugging.md +67 -0
- package/skills/animestudio-animation/SKILL.md +176 -0
- package/skills/animestudio-animation/examples/gestures.ts +55 -0
- package/skills/animestudio-animation/examples/hold.ts +82 -0
- package/skills/animestudio-animation/examples/knockdown.ts +68 -0
- package/skills/animestudio-animation/examples/sheet.ts +80 -0
- package/skills/animestudio-animation/examples/walk-wave-run.ts +59 -0
- package/skills/animestudio-animation/references/clips.md +103 -0
- package/skills/animestudio-animation/references/director-beats.md +48 -0
- package/skills/animestudio-animation/references/holding.md +106 -0
- package/skills/animestudio-animation/references/locomotion.md +86 -0
- package/skills/animestudio-animation/references/timing.md +89 -0
- package/skills/animestudio-characters/SKILL.md +211 -0
- package/skills/animestudio-characters/examples/cast.ts +63 -0
- package/skills/animestudio-characters/examples/human.ts +52 -0
- package/skills/animestudio-characters/examples/import-svg.ts +68 -0
- package/skills/animestudio-characters/examples/lumo.svg +36 -0
- package/skills/animestudio-characters/examples/sprout.toon.json +116 -0
- package/skills/animestudio-characters/examples/sprout.ts +48 -0
- package/skills/animestudio-characters/examples/turnaround.ts +91 -0
- package/skills/animestudio-characters/references/custom-rig.md +139 -0
- package/skills/animestudio-characters/references/import-svg.md +59 -0
- package/skills/animestudio-characters/references/look-options.md +143 -0
- package/skills/animestudio-characters/references/rig-surface.md +62 -0
- package/skills/animestudio-script/SKILL.md +164 -0
- package/skills/animestudio-script/examples/director.ts +143 -0
- package/skills/animestudio-script/examples/sheet.ts +58 -0
- package/skills/animestudio-script/examples/short.ts +193 -0
- package/skills/animestudio-script/references/actions.md +84 -0
- package/skills/animestudio-script/references/dialogue-lipsync.md +87 -0
- package/skills/animestudio-script/references/director.md +110 -0
- package/skills/animestudio-script/references/shots-and-editing.md +79 -0
- package/skills/animestudio-script/references/writing-for-animation.md +84 -0
- package/skills/animestudio-sets/SKILL.md +232 -0
- package/skills/animestudio-sets/examples/hillside.scene.json +93 -0
- package/skills/animestudio-sets/examples/render-scene.ts +35 -0
- package/skills/animestudio-sets/examples/sets.ts +257 -0
- package/skills/animestudio-sets/references/drawing-sets.md +119 -0
- package/skills/animestudio-sets/references/fx.md +92 -0
- package/skills/animestudio-sets/references/lighting-camera.md +93 -0
- package/skills/animestudio-sets/references/scene-fields.md +132 -0
package/dist/bin.js
CHANGED
|
@@ -9,6 +9,7 @@ import { lipsyncFile } from "@anime-studio/lipsync/node";
|
|
|
9
9
|
import { describeCharacter } from "./describe.js";
|
|
10
10
|
import { debugDocument, doctor } from "./doctor.js";
|
|
11
11
|
import { loadSceneAssets, readJson, tryLoadSceneAssets } from "./load.js";
|
|
12
|
+
import { installSkills, listSkills } from "./skills.js";
|
|
12
13
|
const ENGINES = ["auto", "rhubarb", "align", "amplitude"];
|
|
13
14
|
const HELP = `toon — animeStudio command line
|
|
14
15
|
|
|
@@ -21,6 +22,8 @@ Usage:
|
|
|
21
22
|
toon render <file> [--time 1.5] [--clip walk] [-o frame.svg] Render one frame to SVG
|
|
22
23
|
toon debug <scene|sequence> [--from s] [--to s] [--json] Diagnose library output frame by frame (exit 1 on errors)
|
|
23
24
|
toon doctor <video.mp4> <scene|sequence> [--json] Find flickers / unpainted nodes in a render
|
|
25
|
+
toon skills list The agent skills shipped with animeStudio
|
|
26
|
+
toon skills install [name...] [--project] [--dir d] Install them for Claude Code (~/.claude/skills; --project: ./.claude/skills)
|
|
24
27
|
toon --help | -h This text
|
|
25
28
|
`;
|
|
26
29
|
/** A time argument as a number (a typo is an error, not a NaN frame). */
|
|
@@ -81,6 +84,8 @@ async function main() {
|
|
|
81
84
|
from: { type: "string" },
|
|
82
85
|
to: { type: "string" },
|
|
83
86
|
json: { type: "boolean" },
|
|
87
|
+
project: { type: "boolean" },
|
|
88
|
+
dir: { type: "string" },
|
|
84
89
|
help: { type: "boolean", short: "h" },
|
|
85
90
|
},
|
|
86
91
|
});
|
|
@@ -89,6 +94,21 @@ async function main() {
|
|
|
89
94
|
return;
|
|
90
95
|
}
|
|
91
96
|
switch (cmd) {
|
|
97
|
+
case "skills": {
|
|
98
|
+
const [sub = "list", ...names] = positionals;
|
|
99
|
+
if (sub === "list") {
|
|
100
|
+
for (const s of listSkills())
|
|
101
|
+
console.log(`${s.name}\n ${s.description}\n`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (sub !== "install")
|
|
105
|
+
throw new Error(`toon skills: unknown subcommand "${sub}" (list | install)`);
|
|
106
|
+
const dirs = installSkills({ only: names, project: values.project, dir: values.dir });
|
|
107
|
+
for (const d of dirs)
|
|
108
|
+
console.log(`installed ${d}`);
|
|
109
|
+
console.log("Restart your agent (or start a new session) to load them.");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
92
112
|
case "validate": {
|
|
93
113
|
let failed = false;
|
|
94
114
|
for (const file of positionals) {
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":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AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* own (document loading, library-side diagnostics, the video doctor, character descriptions, the
|
|
4
|
+
* agent skills).
|
|
4
5
|
* Importing this module runs nothing; the command line itself is `bin.ts`.
|
|
5
6
|
*/
|
|
6
7
|
export { describeCharacter } from "./describe.js";
|
|
7
8
|
export { type DoctorReport, type Evaluable, debugDocument, doctor, loadEvaluable } from "./doctor.js";
|
|
8
9
|
export { loadSceneAssets, readJson } from "./load.js";
|
|
10
|
+
export { type InstallSkillsOptions, type SkillInfo, installSkills, listSkills, skillsSource } from "./skills.js";
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* own (document loading, library-side diagnostics, the video doctor, character descriptions, the
|
|
4
|
+
* agent skills).
|
|
4
5
|
* Importing this module runs nothing; the command line itself is `bin.ts`.
|
|
5
6
|
*/
|
|
6
7
|
export { describeCharacter } from "./describe.js";
|
|
7
8
|
export { debugDocument, doctor, loadEvaluable } from "./doctor.js";
|
|
8
9
|
export { loadSceneAssets, readJson } from "./load.js";
|
|
10
|
+
export { installSkills, listSkills, skillsSource } from "./skills.js";
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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;AACnD,OAAO,EAA6C,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/skills.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** An agent skill shipped with animeStudio: its folder name and its frontmatter description. */
|
|
2
|
+
export interface SkillInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
dir: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Where the skills are: next to the published package (`skills/`, copied there by the build), or —
|
|
9
|
+
* run from the repository's sources — the repository's own `skills/`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function skillsSource(): string;
|
|
12
|
+
/** Every skill shipped with animeStudio. */
|
|
13
|
+
export declare function listSkills(source?: string): SkillInfo[];
|
|
14
|
+
export interface InstallSkillsOptions {
|
|
15
|
+
/** Folder the skills go into (default `~/.claude/skills`, or `.claude/skills` with `project`). */
|
|
16
|
+
dir?: string;
|
|
17
|
+
/** Install into the current project's `.claude/skills` instead of the user's. */
|
|
18
|
+
project?: boolean;
|
|
19
|
+
/** Only these skills (default: all). */
|
|
20
|
+
only?: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Installs the animeStudio agent skills (each `skills/<name>/` folder with its SKILL.md, references
|
|
24
|
+
* and examples) where Claude Code and other agents load skills from. An earlier copy of the same
|
|
25
|
+
* skill is replaced; other skills in the folder are left alone. Returns the installed folders.
|
|
26
|
+
*/
|
|
27
|
+
export declare function installSkills(opts?: InstallSkillsOptions): string[];
|
|
28
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAIA,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAWD,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,MAAM,SAAiB,GAAG,SAAS,EAAE,CAK/D;AAED,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,oBAAyB,GAAG,MAAM,EAAE,CAevE"}
|
package/dist/skills.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Where the skills are: next to the published package (`skills/`, copied there by the build), or —
|
|
6
|
+
* run from the repository's sources — the repository's own `skills/`.
|
|
7
|
+
*/
|
|
8
|
+
export function skillsSource() {
|
|
9
|
+
const here = import.meta.dirname;
|
|
10
|
+
// From the sources (src/) the repository's skills are the current ones; a built package has its copy.
|
|
11
|
+
const order = here.endsWith("src") ? [resolve(here, "..", "..", "..", "skills")] : [resolve(here, "..", "skills")];
|
|
12
|
+
for (const dir of order) {
|
|
13
|
+
if (existsSync(dir) && statSync(dir).isDirectory())
|
|
14
|
+
return dir;
|
|
15
|
+
}
|
|
16
|
+
throw new Error("animeStudio skills not found (expected a skills/ folder next to the package)");
|
|
17
|
+
}
|
|
18
|
+
/** The frontmatter `description` of a SKILL.md (one line or a folded block). */
|
|
19
|
+
function description(skillMd) {
|
|
20
|
+
const fm = /^---\n([\s\S]*?)\n---/.exec(skillMd)?.[1] ?? "";
|
|
21
|
+
const m = /^description:\s*(?:[>|]-?\s*\n((?:[ \t]+.*\n?)+)|(.*))$/m.exec(fm);
|
|
22
|
+
if (!m)
|
|
23
|
+
return "";
|
|
24
|
+
const raw = m[1] ? m[1].split("\n").map((l) => l.trim()).join(" ") : m[2];
|
|
25
|
+
return raw.trim().replace(/^["']|["']$/g, "");
|
|
26
|
+
}
|
|
27
|
+
/** Every skill shipped with animeStudio. */
|
|
28
|
+
export function listSkills(source = skillsSource()) {
|
|
29
|
+
return readdirSync(source)
|
|
30
|
+
.filter((n) => existsSync(join(source, n, "SKILL.md")))
|
|
31
|
+
.sort()
|
|
32
|
+
.map((name) => ({ name, dir: join(source, name), description: description(readFileSync(join(source, name, "SKILL.md"), "utf8")) }));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Installs the animeStudio agent skills (each `skills/<name>/` folder with its SKILL.md, references
|
|
36
|
+
* and examples) where Claude Code and other agents load skills from. An earlier copy of the same
|
|
37
|
+
* skill is replaced; other skills in the folder are left alone. Returns the installed folders.
|
|
38
|
+
*/
|
|
39
|
+
export function installSkills(opts = {}) {
|
|
40
|
+
const dest = resolve(opts.dir ?? (opts.project ? join(process.cwd(), ".claude", "skills") : join(homedir(), ".claude", "skills")));
|
|
41
|
+
const skills = listSkills().filter((s) => !opts.only?.length || opts.only.includes(s.name));
|
|
42
|
+
if (opts.only?.length) {
|
|
43
|
+
const unknown = opts.only.filter((n) => !skills.some((s) => s.name === n));
|
|
44
|
+
if (unknown.length)
|
|
45
|
+
throw new Error(`unknown skill: ${unknown.join(", ")} (see toon skills list)`);
|
|
46
|
+
}
|
|
47
|
+
mkdirSync(dest, { recursive: true });
|
|
48
|
+
return skills.map((s) => {
|
|
49
|
+
const to = join(dest, s.name);
|
|
50
|
+
rmSync(to, { recursive: true, force: true });
|
|
51
|
+
// Rendered example output and dependencies are not part of a skill.
|
|
52
|
+
cpSync(s.dir, to, { recursive: true, filter: (src) => !/[\\/](out|node_modules)$/.test(src) });
|
|
53
|
+
return to;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OA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I,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACrG,CAAC;IACD,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,oEAAoE;QACpE,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/F,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anime-studio/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The toon CLI for animeStudio: validate, describe, render, debug and lip sync character and scene documents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
|
+
"skills",
|
|
39
40
|
"README.md",
|
|
40
41
|
"LICENSE"
|
|
41
42
|
],
|
|
@@ -46,10 +47,10 @@
|
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@anime-studio/core": "0.2.
|
|
50
|
-
"@anime-studio/rigid": "0.2.
|
|
51
|
-
"@anime-studio/
|
|
52
|
-
"@anime-studio/
|
|
50
|
+
"@anime-studio/core": "0.2.1",
|
|
51
|
+
"@anime-studio/rigid": "0.2.1",
|
|
52
|
+
"@anime-studio/lipsync": "0.2.1",
|
|
53
|
+
"@anime-studio/import-svg": "0.2.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"tsx": "^4.23.15"
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: animestudio
|
|
3
|
+
description: Start here to make cartoon animation with animeStudio (@anime-studio/* on npm). Covers installing the packages, the character → scene → frame → video pipeline, validating and debugging toon.json / scene.json / sequence.json documents with the `toon` CLI, and rendering a still, a whole MP4 without a browser, or a Remotion video. Use it whenever someone wants to render an animation video, write or fix a scene.json, or use animeStudio as a library; it points to the sibling skills for characters, sets, scripts and animation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# animeStudio: using the engine
|
|
7
|
+
|
|
8
|
+
animeStudio is a **deterministic 2D / 2.5D cartoon animation engine** written in TypeScript.
|
|
9
|
+
Everything is data and every frame is a pure function:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
pose = f(document, time) // same document + same time → the same SVG, byte for byte
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- A **character** (`*.toon.json`, `format: "toon"`) is a rig: SVG art on a skeleton with IK,
|
|
16
|
+
physics, controls (emotions, look-at, visemes, views) and clips (idle, walk, wave…).
|
|
17
|
+
- A **scene** (`*.scene.json`, `format: "toon-scene"`) places actors, props and background layers
|
|
18
|
+
and lists timed **script** actions (`play`, `walkTo`, `say`, `lookAt`, `camera`, `fx`…).
|
|
19
|
+
- A **sequence** (`*.sequence.json`, `format: "toon-sequence"`) strings scenes into shots with
|
|
20
|
+
transitions.
|
|
21
|
+
- Rendering = `evaluateScene(scene, t)` → `frameToSVG(frame)` → rasterize. Because frames are
|
|
22
|
+
pure, render them in any order and in parallel.
|
|
23
|
+
|
|
24
|
+
You are a **library user**: build documents and render them. Never patch the engine to get a
|
|
25
|
+
motion; if the engine cannot do something, say so (the engine owns behaviour).
|
|
26
|
+
|
|
27
|
+
## Sibling skills (read the one that matches the task)
|
|
28
|
+
|
|
29
|
+
| Task | Skill |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Building or editing characters (`cartoonCharacter`, looks, hand-made rigs, SVG import) | `animestudio-characters` |
|
|
32
|
+
| Sets / backgrounds, props, lighting, camera work | `animestudio-sets` |
|
|
33
|
+
| Turning a story or script into scenes: dialogue, lip sync, shots, the director (`@anime-studio/director`) | `animestudio-script` |
|
|
34
|
+
| Motion: clips, walks, runs, gestures, holding objects, falls, timing | `animestudio-animation` |
|
|
35
|
+
|
|
36
|
+
This skill covers what all of them share: install, pipeline, validation, rendering.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
Node.js 22+, ES modules. Install only what you need:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @anime-studio/core @anime-studio/kit # engine + ready-made TV-cartoon characters
|
|
44
|
+
npm install @anime-studio/rigid # rigid-body props (needed for prepareScene)
|
|
45
|
+
npm install -g @anime-studio/cli # the `toon` command (or: npx @anime-studio/cli …)
|
|
46
|
+
npm install @anime-studio/remotion remotion @remotion/media react # only for Remotion renders
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Run TypeScript with `npx tsx file.ts`. Inside the animeStudio repo itself, the workspace already
|
|
50
|
+
resolves `@anime-studio/*` to the sources and the CLI is `npx tsx packages/cli/src/bin.ts`.
|
|
51
|
+
Which package does what, and when to reach for each: [references/packages.md](references/packages.md).
|
|
52
|
+
|
|
53
|
+
## The pipeline
|
|
54
|
+
|
|
55
|
+
1. **Characters.** Prefer the kit: `cartoonCharacter(look)` turns a short look (build, skin, hair,
|
|
56
|
+
clothes) into a full 2.5D rig with 12 drawn angles, ~15 emotions and ~50 clips. Save it as a
|
|
57
|
+
`.toon.json` if a JSON scene or the CLI must load it. Details: `animestudio-characters`.
|
|
58
|
+
2. **Describe before you write.** `toon describe hero.toon.json` lists the real control values,
|
|
59
|
+
clip names (with loop / stride) and channels. Never guess a clip or emotion name.
|
|
60
|
+
3. **Scene.** Write the `*.scene.json` (or build the same object in TS): size, fps, duration,
|
|
61
|
+
`characters`, `layers`, `actors`, `props`, `script`. Essentials and the action catalogue:
|
|
62
|
+
[references/scene-format.md](references/scene-format.md).
|
|
63
|
+
4. **Validate** with `toon validate` until it prints ✓, then `toon debug` (see below).
|
|
64
|
+
5. **Look at frames** before rendering a video: one still at each key beat.
|
|
65
|
+
6. **Render** the video: browserless (frames → ffmpeg) or Remotion.
|
|
66
|
+
|
|
67
|
+
Runnable versions of every step are in [examples/](examples/) (run from anywhere with
|
|
68
|
+
`npx tsx <path>`; outputs go to `examples/out/`):
|
|
69
|
+
|
|
70
|
+
| File | What it shows |
|
|
71
|
+
|---|---|
|
|
72
|
+
| [examples/first-frame.ts](examples/first-frame.ts) | Two kit characters, `hello.scene.json` loaded, validated, one frame → SVG → PNG |
|
|
73
|
+
| [examples/hello.scene.json](examples/hello.scene.json) | A small valid scene: idle loops, `walkTo`, `lookAt`, `wave`, `say` with text, emotions, `fx`, a camera move |
|
|
74
|
+
| [examples/render-video.ts](examples/render-video.ts) | Whole MP4 from a scene **or** sequence: pooled frames, rsvg-convert, ffmpeg, audio mix; `--frames N` for a quick check |
|
|
75
|
+
| [examples/hello.sequence.json](examples/hello.sequence.json) | Three shots of the scene with a crossfade and an iris |
|
|
76
|
+
| [examples/remotion/](examples/remotion/) | `Root.tsx` + `index.ts`: the same scene as a Remotion `<Composition>` |
|
|
77
|
+
|
|
78
|
+
Run `first-frame.ts` first: it writes `out/maya.toon.json` and `out/kai.toon.json`, the files the
|
|
79
|
+
JSON examples reference.
|
|
80
|
+
|
|
81
|
+
## A first frame in code
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { evaluateScene, frameToSVG, validateScene } from "@anime-studio/core";
|
|
85
|
+
import { cartoonCharacter } from "@anime-studio/kit";
|
|
86
|
+
import { prepareScene } from "@anime-studio/rigid";
|
|
87
|
+
|
|
88
|
+
const maya = cartoonCharacter({ name: "Maya", build: "woman", female: true, skin: "#a8704f",
|
|
89
|
+
hair: "puffs", hairColor: "#2a1b14", top: "jacket", topColor: "#ff6b5b",
|
|
90
|
+
bottom: "pants", bottomColor: "#2f3a5c", shoes: "sneakers" });
|
|
91
|
+
const doc = { format: "toon-scene", version: 1, width: 1280, height: 720, fps: 30, duration: 3,
|
|
92
|
+
characters: { maya: "maya.toon.json" }, // path only read by loaders; ignored when assets are given
|
|
93
|
+
actors: [{ id: "maya", character: "maya", x: 640, y: 660, scale: 0.8 }],
|
|
94
|
+
script: [
|
|
95
|
+
{ at: 0, actor: "maya", action: "play", clip: "idle", loop: true, layer: -1 },
|
|
96
|
+
{ at: 0.5, actor: "maya", action: "play", clip: "wave", duration: 2 },
|
|
97
|
+
] } as const;
|
|
98
|
+
const assets = { characters: { maya } };
|
|
99
|
+
const v = validateScene(doc, assets); // with assets: the script is compiled and checked
|
|
100
|
+
if (!v.ok) throw new Error(v.issues.map((i) => `${i.path}: ${i.message}`).join("\n"));
|
|
101
|
+
const scene = await prepareScene(doc as any, assets); // compileScene + rigid-body bake
|
|
102
|
+
const svg = frameToSVG(evaluateScene(scene, 1.2)); // standalone SVG string
|
|
103
|
+
// then: rsvg-convert -w 1280 frame.svg -o frame.png
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Validate and debug (do this every time)
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
toon validate my.scene.json # schema → assets → full compile; every error has a JSON path
|
|
110
|
+
toon describe hero.toon.json # the character's real controls, clips, anchors, channels
|
|
111
|
+
toon render my.scene.json --time 2.5 -o f.svg # one frame (rigid bodies simulated) → rsvg-convert
|
|
112
|
+
toon debug my.scene.json [--from s --to s] # frame-by-frame library checks: NaN, broken refs, pops, jumps
|
|
113
|
+
toon doctor video.mp4 my.scene.json # after a render: flickers / unpainted nodes (Remotion debug strip)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Fix every reported path; messages name the bad id and list the valid ones. The errors you will
|
|
117
|
+
meet, and what validation does **not** catch:
|
|
118
|
+
[references/validation-and-debugging.md](references/validation-and-debugging.md).
|
|
119
|
+
|
|
120
|
+
## Render
|
|
121
|
+
|
|
122
|
+
- **Still:** `frameToSVG(evaluateScene(scene, t))` → `rsvg-convert -w <width> in.svg -o out.png`.
|
|
123
|
+
Then actually look at the PNG.
|
|
124
|
+
- **MP4 without a browser** (fast, no Chrome, the repo's own promo videos use it): evaluate each
|
|
125
|
+
frame, write SVG, `rsvg-convert` to PNG in a pool of ~8 jobs, `ffmpeg -c:v libx264 -crf 14
|
|
126
|
+
-pix_fmt yuv420p`, mix `scene.audio` events with `adelay`. See
|
|
127
|
+
[examples/render-video.ts](examples/render-video.ts).
|
|
128
|
+
- **Remotion:** `<Composition component={ToonComposition} {...toonMetadata(scene)}
|
|
129
|
+
defaultProps={{ scene, assets }} />`; sequences use `ToonSequenceComposition`.
|
|
130
|
+
|
|
131
|
+
Pipelines, quality settings, sequences, Remotion setup and their pitfalls:
|
|
132
|
+
[references/rendering.md](references/rendering.md).
|
|
133
|
+
|
|
134
|
+
## Golden rules
|
|
135
|
+
|
|
136
|
+
1. **Never invent names.** Clips, emotions, views, fx types, actions and fields come from
|
|
137
|
+
`toon describe`, `toon validate` messages or the docs. The format rejects unknown fields
|
|
138
|
+
(`Unrecognized key`), but an unknown **pose value** (`emotion: "glad"`) passes validation and
|
|
139
|
+
silently does nothing — check pose values against `toon describe`.
|
|
140
|
+
2. **Validate with assets.** `validateScene(doc)` without assets only checks the schema; pass
|
|
141
|
+
`{ characters, lipsync }` (or use `toon validate`, which loads them) to compile the script.
|
|
142
|
+
3. **Render with `prepareScene`** (`@anime-studio/rigid`), not bare `compileScene`, whenever props
|
|
143
|
+
have a `body`; otherwise rigid bodies never move. It is harmless without bodies.
|
|
144
|
+
4. **Every actor gets a looping base clip**: `{ "action": "play", "clip": "idle", "loop": true,
|
|
145
|
+
"layer": -1 }` at `at: 0`, or it freezes between actions.
|
|
146
|
+
5. **Prefer high-level actions over raw tracks**: `walkTo` (stride-matched, no sliding), `say`,
|
|
147
|
+
`pose`, `lookAt`, `fall`/`getUp`, `camera` with `follow`/`frame`. Never fake a walk with `x`
|
|
148
|
+
tracks or a fall with `rotation`.
|
|
149
|
+
6. **Tracks hold their first key before it.** Give every channel you change later an explicit
|
|
150
|
+
value at `t = 0`.
|
|
151
|
+
7. **One `walkTo` at a time per actor.** A second one takes over the first from where the actor
|
|
152
|
+
is (no error is raised), which is rarely what you meant.
|
|
153
|
+
8. **Coordinates**: px, y down, degrees clockwise, seconds. Actor `x, y` is the point between the
|
|
154
|
+
feet on the ground; a character faces right unless `flip: true`.
|
|
155
|
+
9. **Look before you ship.** Render stills at the key beats and open them; then render the video.
|
|
156
|
+
A short `--frames` run proves the whole pipeline before a long encode.
|
|
157
|
+
10. **Rasterize with PNG frames and CRF ≈ 14**; JPEG rings round cartoon lines.
|
|
158
|
+
|
|
159
|
+
## Documentation (exhaustive references)
|
|
160
|
+
|
|
161
|
+
- Format: https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md
|
|
162
|
+
- API: https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md
|
|
163
|
+
- AI authoring guide: https://github.com/denerFernandes/animeStudio/blob/master/docs/AI_GUIDE.md
|
|
164
|
+
- Director: https://github.com/denerFernandes/animeStudio/blob/master/docs/DIRECTOR.md
|
|
165
|
+
- JSON Schemas: `toon schema --out schemas` (point `"$schema"` at them for editor completion)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First frame: build two kit characters, load a scene document, validate it, render one frame to
|
|
3
|
+
* SVG and PNG.
|
|
4
|
+
*
|
|
5
|
+
* npx tsx first-frame.ts [time=2.6]
|
|
6
|
+
*
|
|
7
|
+
* Writes out/maya.toon.json and out/kai.toon.json (the files hello.scene.json references, so
|
|
8
|
+
* `toon validate hello.scene.json` works afterwards), out/frame.svg and out/frame.png
|
|
9
|
+
* (needs `rsvg-convert` on PATH: `brew install librsvg` / `apt install librsvg2-bin`).
|
|
10
|
+
*/
|
|
11
|
+
import { execFileSync } from "node:child_process";
|
|
12
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { type SceneDoc, evaluateScene, frameToSVG, validateScene } from "@anime-studio/core";
|
|
15
|
+
import { type CartoonLook, cartoonCharacter } from "@anime-studio/kit";
|
|
16
|
+
import { prepareScene } from "@anime-studio/rigid";
|
|
17
|
+
|
|
18
|
+
const dir = import.meta.dirname;
|
|
19
|
+
const out = join(dir, "out");
|
|
20
|
+
mkdirSync(out, { recursive: true });
|
|
21
|
+
|
|
22
|
+
// 1. Characters: a kit character is a whole rig (12 drawn angles, emotions, ~50 clips) from a look.
|
|
23
|
+
const looks: Record<string, CartoonLook> = {
|
|
24
|
+
maya: {
|
|
25
|
+
name: "Maya", build: "woman", female: true, skin: "#a8704f", hair: "puffs", hairColor: "#2a1b14",
|
|
26
|
+
top: "jacket", topColor: "#ff6b5b", bottom: "pants", bottomColor: "#2f3a5c", shoes: "sneakers", shoeColor: "#f4f1ea",
|
|
27
|
+
},
|
|
28
|
+
kai: {
|
|
29
|
+
name: "Kai", build: "teen", skin: "#f2c9a6", hair: "spiky", hairColor: "#2b3a8c", top: "tee", topColor: "#ffc93c",
|
|
30
|
+
bottom: "shorts", bottomColor: "#2ec4b6", shoes: "sneakers", shoeColor: "#e2584a", socks: "#ffffff",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const characters = Object.fromEntries(Object.entries(looks).map(([id, look]) => [id, cartoonCharacter(look)]));
|
|
34
|
+
// Save them as documents so the scene's `characters` paths resolve for the CLI.
|
|
35
|
+
for (const [id, doc] of Object.entries(characters)) writeFileSync(join(out, `${id}.toon.json`), JSON.stringify(doc));
|
|
36
|
+
|
|
37
|
+
// 2. Scene: plain JSON. When assets are passed in code, the paths in `characters` are not read.
|
|
38
|
+
const doc = JSON.parse(readFileSync(join(dir, "hello.scene.json"), "utf8")) as SceneDoc;
|
|
39
|
+
|
|
40
|
+
// 3. Validate with the assets: compiles the script too, so unknown clips/emotions are reported.
|
|
41
|
+
const check = validateScene(doc, { characters });
|
|
42
|
+
for (const i of check.issues) console.log(`${i.severity} ${i.path}: ${i.message}`);
|
|
43
|
+
if (!check.ok) process.exit(1);
|
|
44
|
+
|
|
45
|
+
// 4. Compile (+ rigid-body bake; harmless without bodies) and evaluate one frame: pure, any order.
|
|
46
|
+
const scene = await prepareScene(doc, { characters });
|
|
47
|
+
const t = Number(process.argv[2] ?? 2.6);
|
|
48
|
+
const svg = join(out, "frame.svg");
|
|
49
|
+
writeFileSync(svg, frameToSVG(evaluateScene(scene, t)));
|
|
50
|
+
|
|
51
|
+
// 5. Rasterize. rsvg-convert renders the engine's SVG faithfully and needs no browser.
|
|
52
|
+
const png = join(out, "frame.png");
|
|
53
|
+
execFileSync("rsvg-convert", ["-w", String(doc.width), "-o", png, svg]);
|
|
54
|
+
console.log(`t=${t}s → ${png}`);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "toon-scene",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"width": 1280,
|
|
5
|
+
"height": 720,
|
|
6
|
+
"fps": 30,
|
|
7
|
+
"duration": 4,
|
|
8
|
+
"background": "#cfeaf5",
|
|
9
|
+
"characters": {
|
|
10
|
+
"maya": "out/maya.toon.json",
|
|
11
|
+
"kai": "out/kai.toon.json"
|
|
12
|
+
},
|
|
13
|
+
"camera": { "x": 640, "y": 360, "zoom": 1 },
|
|
14
|
+
"layers": [
|
|
15
|
+
{
|
|
16
|
+
"id": "sky",
|
|
17
|
+
"parallax": 0,
|
|
18
|
+
"z": -100,
|
|
19
|
+
"art": "<defs><linearGradient id='sky' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='#8fd3f4'/><stop offset='1' stop-color='#e6f6fb'/></linearGradient></defs><rect x='-200' y='-200' width='1680' height='1120' fill='url(#sky)'/>"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "hills",
|
|
23
|
+
"parallax": 0.5,
|
|
24
|
+
"z": -80,
|
|
25
|
+
"art": "<path d='M-300 600 Q 200 430 640 560 T 1600 540 L 1600 900 L -300 900 Z' fill='#9ad27c'/>"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "ground",
|
|
29
|
+
"z": -60,
|
|
30
|
+
"art": "<rect x='-400' y='660' width='2080' height='400' fill='#6db84f'/><path d='M-400 660 H1680' stroke='#4f9a3a' stroke-width='6'/>"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"actors": [
|
|
34
|
+
{ "id": "maya", "character": "maya", "x": 260, "y": 660, "scale": 0.8 },
|
|
35
|
+
{ "id": "kai", "character": "kai", "x": 980, "y": 660, "scale": 0.8, "flip": true }
|
|
36
|
+
],
|
|
37
|
+
"script": [
|
|
38
|
+
{ "at": 0, "actor": "maya", "action": "play", "clip": "idle", "loop": true, "layer": -1, "fadeIn": 0 },
|
|
39
|
+
{ "at": 0, "actor": "kai", "action": "play", "clip": "idle", "loop": true, "layer": -1, "fadeIn": 0 },
|
|
40
|
+
{ "at": 0, "actor": "kai", "action": "lookAt", "target": "maya" },
|
|
41
|
+
{ "at": 0.2, "actor": "maya", "action": "walkTo", "x": 560, "duration": 1.6 },
|
|
42
|
+
{ "at": 1.0, "actor": "maya", "action": "lookAt", "target": "kai" },
|
|
43
|
+
{ "at": 1.7, "actor": "maya", "action": "play", "clip": "wave", "duration": 1.8, "fadeIn": 0.25, "fadeOut": 0.35 },
|
|
44
|
+
{ "at": 1.8, "actor": "maya", "action": "pose", "control": "emotion", "value": "happy", "duration": 0.3 },
|
|
45
|
+
{ "at": 1.8, "actor": "maya", "action": "say", "text": "Hi Kai! Ready to animate?", "duration": 1.6 },
|
|
46
|
+
{ "at": 2.35, "action": "fx", "type": "surprise", "actor": "kai" },
|
|
47
|
+
{ "at": 2.4, "actor": "kai", "action": "pose", "control": "emotion", "value": "joy", "duration": 0.3 },
|
|
48
|
+
{ "at": 2.0, "action": "camera", "zoom": 1.12, "y": 380, "duration": 1.8 }
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "toon-sequence",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"width": 1280,
|
|
5
|
+
"height": 720,
|
|
6
|
+
"fps": 30,
|
|
7
|
+
"scenes": { "hello": "hello.scene.json" },
|
|
8
|
+
"shots": [
|
|
9
|
+
{ "scene": "hello", "duration": 1.8 },
|
|
10
|
+
{ "scene": "hello", "from": 1.8, "transition": { "type": "crossfade", "duration": 0.4 } },
|
|
11
|
+
{ "scene": "hello", "from": 0, "duration": 1.2, "transition": { "type": "iris", "target": "maya", "duration": 0.8 } }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Remotion root rendering hello.scene.json with <ToonComposition>.
|
|
3
|
+
* Install: npm i @anime-studio/core @anime-studio/remotion remotion @remotion/cli @remotion/media react react-dom
|
|
4
|
+
* The character files are the ones first-frame.ts writes to out/.
|
|
5
|
+
*/
|
|
6
|
+
import type { SceneDoc, ToonDoc } from "@anime-studio/core";
|
|
7
|
+
import { ToonComposition, toonMetadata } from "@anime-studio/remotion";
|
|
8
|
+
import { Composition } from "remotion";
|
|
9
|
+
import kai from "../out/kai.toon.json";
|
|
10
|
+
import maya from "../out/maya.toon.json";
|
|
11
|
+
import hello from "../hello.scene.json";
|
|
12
|
+
|
|
13
|
+
const scene = hello as unknown as SceneDoc;
|
|
14
|
+
// Assets are passed parsed: the paths in the scene's `characters` map are not read here.
|
|
15
|
+
// Audio paths in the scene resolve with staticFile() (files in public/) unless you pass resolveAudio.
|
|
16
|
+
const assets = { characters: { maya: maya as unknown as ToonDoc, kai: kai as unknown as ToonDoc }, lipsync: {} };
|
|
17
|
+
|
|
18
|
+
export const RemotionRoot = () => (
|
|
19
|
+
<Composition
|
|
20
|
+
id="Hello"
|
|
21
|
+
component={ToonComposition}
|
|
22
|
+
{...toonMetadata(scene)}
|
|
23
|
+
defaultProps={{ scene, assets }}
|
|
24
|
+
/>
|
|
25
|
+
);
|