@anime-studio/cli 0.2.0 → 0.3.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.
Files changed (82) hide show
  1. package/dist/bin.js +74 -2
  2. package/dist/bin.js.map +1 -1
  3. package/dist/doctor.d.ts +8 -1
  4. package/dist/doctor.d.ts.map +1 -1
  5. package/dist/doctor.js +30 -5
  6. package/dist/doctor.js.map +1 -1
  7. package/dist/index.d.ts +6 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +6 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/mix.d.ts +21 -0
  12. package/dist/mix.d.ts.map +1 -0
  13. package/dist/mix.js +95 -0
  14. package/dist/mix.js.map +1 -0
  15. package/dist/raster.d.ts +63 -0
  16. package/dist/raster.d.ts.map +1 -0
  17. package/dist/raster.js +145 -0
  18. package/dist/raster.js.map +1 -0
  19. package/dist/render-worker.d.ts +27 -0
  20. package/dist/render-worker.d.ts.map +1 -0
  21. package/dist/render-worker.js +33 -0
  22. package/dist/render-worker.js.map +1 -0
  23. package/dist/skills.d.ts +28 -0
  24. package/dist/skills.d.ts.map +1 -0
  25. package/dist/skills.js +56 -0
  26. package/dist/skills.js.map +1 -0
  27. package/dist/video.d.ts +64 -0
  28. package/dist/video.d.ts.map +1 -0
  29. package/dist/video.js +221 -0
  30. package/dist/video.js.map +1 -0
  31. package/package.json +7 -5
  32. package/skills/animestudio/SKILL.md +168 -0
  33. package/skills/animestudio/examples/first-frame.ts +54 -0
  34. package/skills/animestudio/examples/hello.scene.json +50 -0
  35. package/skills/animestudio/examples/hello.sequence.json +13 -0
  36. package/skills/animestudio/examples/remotion/Root.tsx +25 -0
  37. package/skills/animestudio/examples/remotion/index.ts +5 -0
  38. package/skills/animestudio/examples/render-video.ts +110 -0
  39. package/skills/animestudio/references/packages.md +54 -0
  40. package/skills/animestudio/references/rendering.md +148 -0
  41. package/skills/animestudio/references/scene-format.md +101 -0
  42. package/skills/animestudio/references/validation-and-debugging.md +66 -0
  43. package/skills/animestudio-animation/SKILL.md +177 -0
  44. package/skills/animestudio-animation/examples/gestures.ts +55 -0
  45. package/skills/animestudio-animation/examples/hold.ts +82 -0
  46. package/skills/animestudio-animation/examples/knockdown.ts +68 -0
  47. package/skills/animestudio-animation/examples/sheet.ts +80 -0
  48. package/skills/animestudio-animation/examples/walk-wave-run.ts +59 -0
  49. package/skills/animestudio-animation/references/clips.md +103 -0
  50. package/skills/animestudio-animation/references/director-beats.md +48 -0
  51. package/skills/animestudio-animation/references/holding.md +106 -0
  52. package/skills/animestudio-animation/references/locomotion.md +86 -0
  53. package/skills/animestudio-animation/references/timing.md +89 -0
  54. package/skills/animestudio-characters/SKILL.md +211 -0
  55. package/skills/animestudio-characters/examples/cast.ts +63 -0
  56. package/skills/animestudio-characters/examples/human.ts +52 -0
  57. package/skills/animestudio-characters/examples/import-svg.ts +68 -0
  58. package/skills/animestudio-characters/examples/lumo.svg +36 -0
  59. package/skills/animestudio-characters/examples/sprout.toon.json +116 -0
  60. package/skills/animestudio-characters/examples/sprout.ts +48 -0
  61. package/skills/animestudio-characters/examples/turnaround.ts +91 -0
  62. package/skills/animestudio-characters/references/custom-rig.md +139 -0
  63. package/skills/animestudio-characters/references/import-svg.md +59 -0
  64. package/skills/animestudio-characters/references/look-options.md +143 -0
  65. package/skills/animestudio-characters/references/rig-surface.md +62 -0
  66. package/skills/animestudio-script/SKILL.md +164 -0
  67. package/skills/animestudio-script/examples/director.ts +143 -0
  68. package/skills/animestudio-script/examples/sheet.ts +58 -0
  69. package/skills/animestudio-script/examples/short.ts +193 -0
  70. package/skills/animestudio-script/references/actions.md +84 -0
  71. package/skills/animestudio-script/references/dialogue-lipsync.md +87 -0
  72. package/skills/animestudio-script/references/director.md +110 -0
  73. package/skills/animestudio-script/references/shots-and-editing.md +79 -0
  74. package/skills/animestudio-script/references/writing-for-animation.md +84 -0
  75. package/skills/animestudio-sets/SKILL.md +232 -0
  76. package/skills/animestudio-sets/examples/hillside.scene.json +93 -0
  77. package/skills/animestudio-sets/examples/render-scene.ts +35 -0
  78. package/skills/animestudio-sets/examples/sets.ts +257 -0
  79. package/skills/animestudio-sets/references/drawing-sets.md +119 -0
  80. package/skills/animestudio-sets/references/fx.md +93 -0
  81. package/skills/animestudio-sets/references/lighting-camera.md +93 -0
  82. package/skills/animestudio-sets/references/scene-fields.md +132 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Knock-downs: a character trips mid-walk (`fall` without `from`), lies, gets up (`getUp`); then
3
+ * another walks up and punches him, and he is thrown back on an arc (`fall` `from` the hitter).
4
+ *
5
+ * npx tsx skills/animestudio-animation/examples/knockdown.ts
6
+ *
7
+ * Shows: the engine's fall (never fake it with rotation tracks), the K.O. hold (≥ 1.5 s before
8
+ * getUp), the punch timing (the fist lands 0.28 s into the kit's `punch`), emotions and fx as the
9
+ * reaction, characters kept a step apart before the hit.
10
+ */
11
+ import type { ActionDef } from "@anime-studio/core";
12
+ import { FLOOR, cast, contactSheet, sceneDoc } from "./sheet";
13
+
14
+ const characters = cast("ana", "ben");
15
+ const TRIP = 1.5; // Ben trips here, mid-walk
16
+ const UP = TRIP + 2.0; // the K.O. is held 2 s before getting up (≥ 1.5 s)
17
+ const PUNCH = 6.2; // Ana's punch starts…
18
+ const HIT = PUNCH + 0.28; // …and the fist lands 0.28 s into the kit's punch clip
19
+
20
+ const script: ActionDef[] = [
21
+ { at: 0, actor: "ben", action: "play", clip: "idle", loop: true, layer: -1 },
22
+ { at: 0, actor: "ana", action: "play", clip: "idle", loop: true, layer: -1 },
23
+ { at: 0, actor: "ben", action: "pose", control: "view", value: "profile", duration: 0 },
24
+ { at: 0, actor: "ana", action: "pose", control: "view", value: "profile", duration: 0 },
25
+ { at: 0, actor: "ben", action: "pose", control: "emotion", value: "happy", duration: 0 },
26
+ { at: 0, actor: "ana", action: "pose", control: "emotion", value: "annoyed", duration: 0 },
27
+
28
+ // 1. The trip: fall while the walk is still under way. The fall takes over the placement; the
29
+ // walk's clip fades out in 0.12 s and the body carries the walk's speed on.
30
+ { at: 0.1, actor: "ben", action: "walkTo", x: 640, duration: 2.0 },
31
+ { at: TRIP - 0.12, actor: "ben", action: "pose", control: "emotion", value: "surprised", duration: 0.06 },
32
+ { at: TRIP - 0.1, actor: "ben", action: "fx", type: "exclaim" },
33
+ { at: TRIP, actor: "ben", action: "fall" }, // tripping where he stands, on his back
34
+ { at: TRIP + 0.45, action: "shake", duration: 0.25, amount: 8 }, // the hips touch down at 0.45 s
35
+ { at: TRIP + 0.45, actor: "ben", action: "fx", type: "dust", anchor: "origin" },
36
+ { at: TRIP + 0.6, actor: "ben", action: "pose", control: "emotion", value: "dead", duration: 0.2 },
37
+ { at: TRIP + 0.7, actor: "ben", action: "fx", type: "stars", duration: 1.2 },
38
+ { at: UP, actor: "ben", action: "getUp" }, // sits up into a crouch, then stands (1.2 s)
39
+ { at: UP + 0.6, actor: "ben", action: "pose", control: "emotion", value: "annoyed", duration: 0.3 },
40
+
41
+ // 2. The punch: Ana walks in behind him and stops a fist's reach away (not nose to nose). He
42
+ // stands at x ≈ 420 after getting up (the fall moved him back); measure, don't guess.
43
+ { at: 4.6, actor: "ana", action: "walkTo", x: 270, duration: 1.3 },
44
+ { at: 5.0, actor: "ben", action: "face", direction: "left" },
45
+ { at: 4.6, actor: "ana", action: "lookAt", target: "ben" },
46
+ { at: 5.0, actor: "ben", action: "lookAt", target: "ana" },
47
+ { at: 5.6, actor: "ana", action: "pose", control: "emotion", value: "angry", duration: 0.2 },
48
+ { at: 5.7, actor: "ana", action: "fx", type: "anger" },
49
+ { at: PUNCH, actor: "ana", action: "play", clip: "punch", duration: 0.9, fadeIn: 0.05 },
50
+ { at: HIT, actor: "ben", action: "fx", type: "burst" },
51
+ { at: HIT, action: "shake", duration: 0.3, amount: 14 },
52
+ { at: HIT, actor: "ben", action: "pose", control: "emotion", value: "dead", duration: 0.05 },
53
+ // Thrown away from Ana on an arc: up, the hips land first, the shoulders slap down, a bounce.
54
+ { at: HIT, actor: "ben", action: "fall", from: "ana" },
55
+ { at: HIT + 0.9, actor: "ben", action: "fx", type: "stars", duration: 1.5 },
56
+ { at: HIT + 0.5, actor: "ana", action: "pose", control: "emotion", value: "smug", duration: 0.3 },
57
+ ];
58
+
59
+ const doc = sceneDoc(9.0, {
60
+ characters: { ana: "ana", ben: "ben" },
61
+ actors: [
62
+ { id: "ben", character: "ben", x: 220, y: FLOOR, scale: 0.85 },
63
+ { id: "ana", character: "ana", x: -200, y: FLOOR, scale: 0.85 },
64
+ ],
65
+ script,
66
+ });
67
+
68
+ await contactSheet(doc, characters, [1.3, 1.65, 2.0, 2.6, 3.8, 4.2, 6.1, HIT, HIT + 0.3, HIT + 0.85, HIT + 1.3, 8.9], "knockdown");
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Shared helpers for the animation examples: a plain set, a cast built by the kit, and a contact
3
+ * sheet of key frames (evaluateScene → frameToSVG → rsvg-convert → magick montage).
4
+ * Every output goes to `skills/animestudio-animation/examples/out/`.
5
+ */
6
+ import { execFileSync } from "node:child_process";
7
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
8
+ import { join } from "node:path";
9
+ import { type SceneDoc, type ToonDoc, evaluateScene, frameToSVG } from "@anime-studio/core";
10
+ import { type CartoonLook, cartoonCharacter } from "@anime-studio/kit";
11
+ import { prepareScene } from "@anime-studio/rigid";
12
+
13
+ export const W = 1280;
14
+ export const H = 720;
15
+ /** Where the feet stand. */
16
+ export const FLOOR = 620;
17
+ export const OUT = join(import.meta.dirname, "out");
18
+ const FONTS = [
19
+ "/System/Library/Fonts/Supplemental/Arial.ttf",
20
+ "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
21
+ "/usr/share/fonts/TTF/DejaVuSans.ttf",
22
+ "C:\\Windows\\Fonts\\arial.ttf",
23
+ ];
24
+
25
+ /** Two generic looks; any `CartoonLook` works. */
26
+ export const LOOKS: Record<string, CartoonLook> = {
27
+ ana: {
28
+ name: "Ana", build: "woman", female: true, skin: "#c68863", hair: "ponytail", hairColor: "#3a2418",
29
+ top: "tee", topColor: "#e2584a", bottom: "pants", bottomColor: "#34406b", shoes: "sneakers", shoeColor: "#f4f1ea",
30
+ } as CartoonLook,
31
+ ben: {
32
+ name: "Ben", build: "man", skin: "#f0c8a8", hair: "sidePart", hairColor: "#5a3b22",
33
+ top: "polo", topColor: "#3f8fd2", bottom: "pants", bottomColor: "#4a4038", shoes: "sneakers", shoeColor: "#2b2b2b",
34
+ } as CartoonLook,
35
+ };
36
+
37
+ export const cast = (...ids: string[]): Record<string, ToonDoc> =>
38
+ Object.fromEntries(ids.map((id) => [id, cartoonCharacter(LOOKS[id])]));
39
+
40
+ /** A flat room: a wall, a floor from FLOOR down, a ruler of ticks so sliding feet show. */
41
+ export const room = () => {
42
+ const ticks = Array.from({ length: 17 }, (_, i) => `<path d="M${i * 80} ${FLOOR} v14" stroke="#b9a98f" stroke-width="3"/>`).join("");
43
+ return `<rect x="0" y="0" width="${W}" height="${FLOOR}" fill="#f3ead8"/>
44
+ <rect x="0" y="${FLOOR}" width="${W}" height="${H - FLOOR}" fill="#d8c7a6"/>
45
+ <path d="M0 ${FLOOR} H${W}" stroke="#8c7a5c" stroke-width="4"/>${ticks}`;
46
+ };
47
+
48
+ /** A scene document with the room as its only layer. */
49
+ export const sceneDoc = (duration: number, extra: Partial<SceneDoc>): SceneDoc =>
50
+ ({
51
+ format: "toon-scene", version: 1, width: W, height: H, fps: 30, duration, background: "#f3ead8",
52
+ camera: { x: W / 2, y: H / 2, zoom: 1 },
53
+ layers: [{ id: "room", art: room() }],
54
+ ...extra,
55
+ }) as SceneDoc;
56
+
57
+ /**
58
+ * Renders the frames at `times` and tiles them, labelled with their time (or `labels`), into `out/<name>.png`.
59
+ * Returns the sheet's path. Look at it: a contact sheet is the only proof the motion reads.
60
+ */
61
+ export async function contactSheet(doc: SceneDoc, characters: Record<string, ToonDoc>, times: number[], name: string, cols = 4, labels?: string[]) {
62
+ const work = join(OUT, name);
63
+ mkdirSync(work, { recursive: true });
64
+ // prepareScene = compileScene + the rigid-body bake (needed for falls with physics props, harmless otherwise).
65
+ const scene = await prepareScene(doc, { characters });
66
+ const args: string[] = [];
67
+ times.forEach((t, i) => {
68
+ const svg = join(work, `f${i}.svg`), png = join(work, `f${i}.png`);
69
+ writeFileSync(svg, frameToSVG(evaluateScene(scene, t)));
70
+ execFileSync("rsvg-convert", ["-w", String(W / 2), "-h", String(H / 2), "-o", png, svg]);
71
+ args.push("-label", labels?.[i] ?? `t=${t.toFixed(2)}s`, png);
72
+ });
73
+ const out = join(OUT, `${name}.png`);
74
+ // ImageMagick needs a font file for the labels; without one found, the sheet is tiled unlabelled.
75
+ const font = FONTS.find((f) => existsSync(f));
76
+ const tiles = font ? args : args.filter((a, i) => a !== "-label" && args[i - 1] !== "-label");
77
+ execFileSync("magick", ["montage", ...(font ? ["-font", font, "-pointsize", "18"] : []), ...tiles, "-tile", `${cols}x`, "-geometry", "+4+4", out]);
78
+ console.log(out);
79
+ return out;
80
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * A character walks in, stops, turns to the audience, waves, hears something off screen, takes a
3
+ * scared beat and runs off the other way.
4
+ *
5
+ * npx tsx skills/animestudio-animation/examples/walk-wave-run.ts
6
+ *
7
+ * Shows: idle on layer -1, walkTo with the plain walk (stride-matched), a `view` change with a
8
+ * duration (steps through the drawn angles), a gesture clip with fadeIn, emotion and lookAt as
9
+ * acting, an fx on the reaction, a run at the clip's natural speed in the travel view (q64).
10
+ */
11
+ import type { ActionDef } from "@anime-studio/core";
12
+ import { FLOOR, cast, contactSheet, sceneDoc } from "./sheet";
13
+
14
+ const characters = cast("ana");
15
+ const SCALE = 0.9;
16
+
17
+ // A run must go at its own pace: speed = stride × scale / cycle. Slower plays in slow motion,
18
+ // faster blurs the legs. (The scene's walkTo default is 220 px/s, right for a walk, wrong for a run.)
19
+ const run = characters.ana.clips!.scaredRun;
20
+ const runSpeed = (run.stride! * SCALE) / run.duration;
21
+
22
+ const T = { walk: 0.2, arrive: 2.6, turn: 2.8, wave: 3.25, noise: 5.0, flee: 5.75 };
23
+
24
+ const script: ActionDef[] = [
25
+ // Base layer: a looping idle under everything, so the body never freezes between actions.
26
+ { at: 0, actor: "ana", action: "play", clip: "idle", loop: true, layer: -1 },
27
+ // Give every changing channel a value at t = 0 (a track holds its first key before it).
28
+ { at: 0, actor: "ana", action: "pose", control: "view", value: "profile", duration: 0 },
29
+ { at: 0, actor: "ana", action: "pose", control: "emotion", value: "happy", duration: 0 },
30
+ // Walk in: the walk clip is stride-matched by walkTo (no sliding feet); it faces the way it goes.
31
+ { at: T.walk, actor: "ana", action: "walkTo", x: 520, duration: T.arrive - T.walk },
32
+ // Turn to the audience: a view change with a duration steps through every drawn angle in between.
33
+ { at: T.turn, actor: "ana", action: "pose", control: "view", value: "front", duration: 0.35 },
34
+ { at: T.turn, actor: "ana", action: "lookAt", target: null },
35
+ // One clear action: the wave, faded in over the idle; the emotion rises just before it.
36
+ { at: T.wave - 0.1, actor: "ana", action: "pose", control: "emotion", value: "joy", duration: 0.3 },
37
+ { at: T.wave, actor: "ana", action: "play", clip: "wave", duration: 1.5, fadeIn: 0.2, fadeOut: 0.25 },
38
+ // The reaction: the effect a hair before the look, the look before the body.
39
+ { at: T.noise - 0.05, actor: "ana", action: "fx", type: "surprise" },
40
+ { at: T.noise, actor: "ana", action: "lookAt", target: [1400, 360] },
41
+ { at: T.noise, actor: "ana", action: "pose", control: "emotion", value: "scared", duration: 0.12 },
42
+ { at: T.noise + 0.05, actor: "ana", action: "pose", control: "view", value: "profile", duration: 0.25 },
43
+ { at: T.noise + 0.1, actor: "ana", action: "play", clip: "scared", duration: 0.55, fadeIn: 0.08 },
44
+ { at: T.flee - 0.1, actor: "ana", action: "fx", type: "sweat" },
45
+ // Flee: the run's travel view (q64, side-on with the face still showing); walkTo reverses her
46
+ // facing and turns her through the in-between angles instead of flipping in one frame.
47
+ { at: T.flee, actor: "ana", action: "pose", control: "view", value: "q64", duration: 0.2 },
48
+ { at: T.flee, actor: "ana", action: "lookAt", target: null },
49
+ { at: T.flee, actor: "ana", action: "walkTo", x: -350, clip: "scaredRun", speed: runSpeed },
50
+ { at: T.flee + 0.1, actor: "ana", action: "fx", type: "dust", anchor: "origin" },
51
+ ];
52
+
53
+ const doc = sceneDoc(7.2, {
54
+ characters: { ana: "ana" },
55
+ actors: [{ id: "ana", character: "ana", x: -120, y: FLOOR, scale: SCALE }],
56
+ script,
57
+ });
58
+
59
+ await contactSheet(doc, characters, [0.9, 1.6, 2.7, 2.95, 3.2, 3.8, 5.05, 5.5, 5.8, 5.9, 6.0, 6.1], "walk-wave-run");
@@ -0,0 +1,103 @@
1
+ # Kit clips (`cartoonCharacter`)
2
+
3
+ Every `cartoonCharacter(look)` carries these clips (durations at the default proportions; read
4
+ `doc.clips[name].duration` for yours). "loop" clips repeat until the `play`'s `duration`; one-shot
5
+ clips play once and hold their end until faded out. `clear`: on a 2.5D rig the engine keeps the
6
+ arms off the face (wave, cheer…); the others are face-contact clips that keep their contact
7
+ (drink, facepalm, phone…). See them all on one sheet:
8
+ `npx tsx skills/animestudio-animation/examples/gestures.ts`.
9
+
10
+ Source of truth: `Object.keys(doc.clips)`, [API.md → kit](https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md#anime-studiokit).
11
+
12
+ ## Base and transitions
13
+
14
+ | Clip | s | Kind | Use |
15
+ |---|---|---|---|
16
+ | `idle` | 3.2 | loop | Breathing base under everything: `layer: -1`, `loop: true`, at `t = 0` |
17
+ | `turn` | 0.24 | once | A quick squeeze hiding a change of view (played automatically by the director) |
18
+
19
+ ## Locomotion (play through `walkTo`, not `play`)
20
+
21
+ | Clip | s / cycle | Stride px | Mood |
22
+ |---|---|---|---|
23
+ | `walk` | 0.84 | ≈ 234 | Plain walk (long legs, hips drop into each step) |
24
+ | `run` | 0.6 | ≈ 434 | Cartoon run: flights, heel kick, runner's arms |
25
+ | `sneak` | 2.0 | ≈ 404 | Big slow creeping steps, "tiptoe fingers" |
26
+ | `strut` | 0.6 | ≈ 257 | Chest out, hip sway, double bounce, fists |
27
+ | `tired` | 0.95 | ≈ 187 | Slumped, dragging feet, hanging arms |
28
+ | `march` | 0.5 | ≈ 234 | Knees up, pumping fists |
29
+ | `scaredRun` | 0.41 | ≈ 665 | Panic sprint, arms flung up and out |
30
+
31
+ Strides are per cycle at scale 1 for one build; skirts shorten runs. See [locomotion.md](locomotion.md).
32
+
33
+ ## Gestures
34
+
35
+ | Clip | s | Kind | What it does / when |
36
+ |---|---|---|---|
37
+ | `talk` | 1.6 | loop | Conversational hands while speaking |
38
+ | `wave` | 1.2 | loop | Hand up beside the head, waving: greetings, goodbyes |
39
+ | `point` | 1.0 | loop | Points forward (finger hand): "that one", "you" |
40
+ | `pointUp` | 1.2 | loop | Finger up: "I've got it", "listen" |
41
+ | `present` | 1.4 | loop | Open hand out to the side: presenting, "ta-da", "here it is" |
42
+ | `clap` | 0.5 | loop | Clapping in front of the chest |
43
+ | `cheer` | 0.8 | loop | Both arms up: victory, joy |
44
+ | `dance` | 1.2 | loop | Dancing, one arm up |
45
+ | `groove` | 0.9 | loop | Hips swaying with a bounce, hands up in turn |
46
+ | `sing` | 2.0 | loop | Singing, hand on the chest |
47
+ | `think` | 2.4 | loop | Hand to the chin (face contact) |
48
+ | `shrug` | 1.2 | once | Shoulders and palms up: "who knows" |
49
+ | `laugh` | 0.6 | loop | Laughing, hands to the belly |
50
+ | `cry` | 0.8 | loop | Hands to the eyes (face contact) |
51
+ | `scared` | 0.24 | loop | Hands up in front, shivering |
52
+ | `facepalm` | 1.6 | once | Hand to the face (face contact) |
53
+ | `jump` | 0.8 | once | A jump, arms up |
54
+ | `teeter` | 1.1 | once | Arms out, losing balance |
55
+ | `flap` | 0.28 | loop | Arms flapping (panic, or flying rigs) |
56
+ | `toss` | 0.9 | once | Throws something up, both arms up |
57
+ | `dribble` | 0.6 | loop | Bouncing a ball (sync a prop to the hand) |
58
+ | `drink` | 2.2 | once | Hand to the mouth, wrist tips, head back |
59
+ | `smoke` | 1.8 | once | Hand to the mouth for a puff and back |
60
+ | `phone` | 2.4 | loop | Phone at the ear along the jaw |
61
+ | `read` | 2.4 | loop | Holding a book/tablet (with `HOLD.book`) |
62
+ | `texting` | 2.4 | loop | Phone in one hand at the lower chest, head bent 24° (with `HOLD.phone`) |
63
+ | `textingTwo` | 1.2 | loop | Both thumbs (`also: holdBoth`) |
64
+ | `carry` | 1.6 | loop | A box between both hands in front of the belly (with `boxFit`) |
65
+ | `hold` | 2.0 | loop | Holding something up in front |
66
+ | `gamepad` | 1.0 | loop | A controller in both hands, thumbs busy |
67
+ | `cue` | 1.6 | loop | Leaning over a pool table, stroking |
68
+ | `ride` | 1.0 | loop | Leaning into a ride (bicycle), head up |
69
+ | `roll` | 0.8 | once | A roll |
70
+
71
+ ## Fighting and knock-downs
72
+
73
+ | Clip | s | Kind | Use |
74
+ |---|---|---|---|
75
+ | `stance` | 1.6 | loop | Guard up; a fight's base instead of `idle` (`layer: -1`) |
76
+ | `power` | 1.2 | loop | Powering up (pair with `fx` `aura`) |
77
+ | `punch` | 0.9 | once | The fist lands at **0.28 s**: the target's `fall from` goes there |
78
+ | `knocked` | 0.85 | once | Limbs in the air during `fall` (used by `fall` itself — do not `play`) |
79
+ | `down` | 3.6 | once | The K.O. lying pose (used by `fall`) |
80
+ | `rise` | 1.2 | once | Limbs while getting up (used by `getUp`) |
81
+
82
+ ## Emotions (`pose` control `emotion`)
83
+
84
+ `neutral`, `happy`, `joy`, `surprised`, `sad`, `smug`, `scared`, `angry`, `dead`, `determined`,
85
+ `calm`, `excited`, `annoyed`, `sleep`, `gape`. Weighted values blend:
86
+ `{ "happy": 0.5, "surprised": 0.5 }`.
87
+
88
+ ## Other controls
89
+
90
+ | Control | Values |
91
+ |---|---|
92
+ | `view` | `front half q24 profile q50 q64 q77 side q112 away q158 back` |
93
+ | `head` | the same angles, `~<angle>` mirrored, `null` follows `view` |
94
+ | `jaw` | `shut`, `gape`, weighted `{ "gape": 2 }` (unhinged) |
95
+ | `look` | aim control driven by `lookAt` |
96
+ | `mouth` | viseme control driven by `say` |
97
+
98
+ ## Reading a clip in code
99
+
100
+ ```ts
101
+ const c = doc.clips!.run; // { duration, loop, stride?, clear?, tracks }
102
+ const natural = (c.stride! * scale) / c.duration; // px/s: a gait's own speed
103
+ ```
@@ -0,0 +1,48 @@
1
+ # Director beats for motion (stagings)
2
+
3
+ In a director staging (`@anime-studio/director`, `direct(staging, lines, kit)`) beats are timed to
4
+ lines (`{ "line": 12, "word": "now", "offset": 0.1 }`) and places are marks or people, never
5
+ coordinates. The director turns them into the scene actions of this skill, plus what a person
6
+ would forget (idle loops, listeners turning to the speaker, spacing, talking hands).
7
+ Full table: [DIRECTOR.md → Beats](https://github.com/denerFernandes/animeStudio/blob/master/docs/DIRECTOR.md#beats-do).
8
+
9
+ ## Motion beats
10
+
11
+ | Beat | Fields | Notes |
12
+ |---|---|---|
13
+ | `walk`, `run` | `who`, `to`, `until?` | Speed from the cast (walk 170 px/s, a run at its clip's natural speed). Turns through the angles; a run is drawn in the travel view |
14
+ | `enter` / `exit` | `who`, `from`/`to`, `run?`, `fly?` | Invisible before entering; from the top drops in and lands |
15
+ | `face`, `view`, `look` | `who`, `direction` / `value` / `target` | `view` turns through every drawing in between, one every two frames |
16
+ | `emotion` | `who`, `value` | Emotion pose |
17
+ | `gesture` | `who`, `clip`, `until?` | A clip (looped until `until`, else once). From the front `facepalm`, `despair`, `think`, `cover`, `excited`, `shout` are IK hand positions on the face |
18
+ | `take` | `who`, `target?`, `double?` | A cartoon take: squash and lean away, eyes shut, then stretch towards it, eyes wide, `surprised` |
19
+ | `hit` | `who`, `target`, `ko?` | Dash in, `punch`, impact frame, target thrown back spinning, K.O. until `getUp` |
20
+ | `fall` | `who`, `side?` | Trips (standing), thrown clear (riding), slips off (carried); stars; until `getUp` |
21
+ | `getUp` | `who` | From a seat, a bed, the ground or a fall |
22
+ | `sit` | `who`, `on?`, `view?`, `legs?`, `hands?` | Walks there and sits: hips on the seat, feet on the floor; 2.5D rigs posed in 3D, hands on knees or lap; on the ground `legs: "straight" \| "hug"`. Crossed legs are not supported |
23
+ | `lie`, `sleep` | `who`, `on?` | Face up on the bed's `pillow`/`bed` anchor or the ground; `sleep` adds Zzz and the `sleep` emotion |
24
+ | `mount`, `ride`, `dismount` | `who`, `vehicle`, `to`, `wobble?` | Seat on the saddle, feet on the pedals, hands on the bars; `wobble` for a beginner |
25
+ | `hide`, `peek` | `who`, `behind`, `until?` | Crouches behind something lower than the head; `peek` pops up and back |
26
+ | `hold` / `release` (people) | `who` (list) | Hand in hand |
27
+ | `highFive`, `hug`, `carry` (piggyback), `cradle` | `who`, `target?` | Contact beats: the closeness is intended, no spacing warning |
28
+ | `pick`, `drop`, `give`, `throw`, `hold` (prop), `use`, `take` (prop), `putBack`, `dribble` | `who`, `prop`, … | Prop handling; the director walks over and picks the free hand |
29
+ | `press` | `who`, `at` | Presses a button/bell: walks within reach, the hand pushes in and back |
30
+ | `fly` | `who`, `to` | Rigs with wings: crouch, one arc, soft landing |
31
+
32
+ ## Rules the director enforces (stage within them)
33
+
34
+ - One walks facing where one goes; a `face` the other way while walking waits for the walk.
35
+ - A second walk while walking starts when the first arrives.
36
+ - Walking while sitting or lying stands up first.
37
+ - Arms on 2.5D rigs move as 3D reaches along arcs in front of the body, one move at a time; a held
38
+ object stays in the same hand when its holder turns round.
39
+ - `check(staging, lines, kit)` reports characters on top of each other or nose to nose for more
40
+ than 0.5 s, bodies past the set's bounds, faces covered by scenery, legs too short for pedals.
41
+ Run it (`{ strict: true }` before a render) and fix every warning.
42
+
43
+ ## Scene-level equivalents
44
+
45
+ Without the director, build sitting and riding from `mount` (`on`, `anchor: "seat"`, `point`: the
46
+ hip joint, `behind`: the far leg's parts, `facing`) and `reach` (`footF`/`footB` to pedals or floor
47
+ points, `handF`/`handB` to a handlebar). It is much more work and easy to get wrong on a 2.5D rig
48
+ (the director poses the seated legs in 3D); prefer a staging for anything seated.
@@ -0,0 +1,106 @@
1
+ # Holding and carrying props
2
+
3
+ Reference: [FORMAT.md §2.6 anchors and `fit`](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md#26-anchors),
4
+ [§3.3 `grab` / `release` / `put` / hung props](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md#33-script-actions),
5
+ [API.md → `HOLD`, `holdFit`, `holdBoth`, `boxFit`](https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md#anime-studiokit).
6
+ Worked example: [examples/hold.ts](../examples/hold.ts).
7
+
8
+ ## Actions
9
+
10
+ | Action | Fields | Effect |
11
+ |---|---|---|
12
+ | `grab` | `prop`, `anchor`, `also?`, `fit?`, `hang?` | Attaches the prop to the anchor every frame; the hand closes (`grip`) and is drawn over it |
13
+ | `release` | `prop`, `velocity?`, `keep?` | Lets go. A body prop flies with the hand's velocity; `keep: true` leaves a body-less prop where the hand put it |
14
+ | `put` | `prop`, `on` | The prop rides on another prop (cup on a tray); `null` leaves it there |
15
+ | `reach` | `chain`, `target`, `duration` | An IK chain (`handF`, `handB`, `footF`, `footB`) to an anchor, a prop point or a scene point |
16
+
17
+ `cartoonCharacter` anchors: `hand` (near), `handB` (far), `fist`, `head`, `face`, `ear`, `earB`,
18
+ `mouth`, `eye`, `top`. The head ones move with each drawn angle.
19
+
20
+ ## Draw props for the hand
21
+
22
+ - Draw the prop the way it looks in the hand at rest, in its own coordinates; the `fit` points
23
+ are in those coordinates (scaled and mirrored with the prop).
24
+ - Two-sided flat props (phone, book, card): give `art` (front) and `back` (seen from behind). With
25
+ `face`, the engine shows the back to the camera when the front faces away and foreshortens it.
26
+ - Hung props: draw them hanging straight down from the handle at `[0, 0]`.
27
+
28
+ ## Recipes
29
+
30
+ **Phone, one hand, texting**
31
+
32
+ ```ts
33
+ import { HOLD, holdFit } from "@anime-studio/kit";
34
+ props: [{ id: "phone", art: SCREEN, back: CASE, x: 0, y: 0, scale: HOLD.phone.scale * actorScale }],
35
+ { at: 3.2, actor: "ana", action: "grab", prop: "phone", anchor: "hand", fit: holdFit("phone", [0, 0], [0, -100]) },
36
+ { at: 3.2, actor: "ana", action: "play", clip: HOLD.phone.clip, loop: true, layer: 1, fadeIn: 0.35 },
37
+ ```
38
+
39
+ The phone is drawn upright, grip at `[0, 0]`, top at `[0, -100]`. Seen from the front or the side
40
+ you see the case (correct: the screen faces her eyes). Hide the prop until it is taken
41
+ (`props.<id>.opacity` track) — a prop at opacity 0 is not drawn.
42
+
43
+ **Two thumbs / a book**: `textingTwo` or `read`, `fit: holdFit("phone" | "book", grip, top)`,
44
+ `also: holdBoth` (the far hand wraps it too).
45
+
46
+ **A box in both hands**
47
+
48
+ ```ts
49
+ import { HOLD, boxFit, holdBoth } from "@anime-studio/kit";
50
+ { at: 0, actor: "ben", action: "grab", prop: "box", anchor: "hand", fit: boxFit([-55, 0], [55, 0]), also: holdBoth },
51
+ { at: 0, actor: "ben", action: "play", clip: HOLD.box.clip, loop: true, layer: 1, fadeIn: 0, duration: 3.1, fadeOut: 0.3 },
52
+ { at: 0.2, actor: "ben", action: "walkTo", x: 840, duration: 2.4 }, // carry pose on layer 1 over the walk
53
+ { at: 3.0, actor: "ben", action: "release", prop: "box", keep: true }, // put down where the hands are
54
+ ```
55
+
56
+ `boxFit(left, right)`: the box's left point on `hand`, turned so its right point is on `handB`.
57
+ Give the `carry` clip a `duration` that ends just after the release, or the arms keep carrying air.
58
+
59
+ **A bag swinging from the hand**
60
+
61
+ ```ts
62
+ { at: 0, actor: "ana", action: "grab", prop: "bag", anchor: "handB", hang: { point: [0, 0], damping: 0.25 } },
63
+ ```
64
+
65
+ `hang`: `point` (the handle), `length`, `damping` (0.25 loose … 1 no overshoot), `limit` (70°),
66
+ `gravity`. It swings back on setting off and forward on the stop; it restarts at rest on a flip.
67
+ `hang` and `fit` cannot be combined. Use the far hand for carried bags so the near hand stays free
68
+ for gestures.
69
+
70
+ **Held to the face** (phone at the ear, cigarette, bottle): `fit` with two anchors
71
+ (`[{ point: EAR_PT, anchor: "ear" }, { point: MOUTH_PT, anchor: "mouth" }]`) or a 3D `dir`, then
72
+ play `phone`, `smoke` or `drink`. In a staging, the director's `use` beat and the `phone` / `smoke`
73
+ / `drink` gestures do this when the prop kind declares its points.
74
+
75
+ ## Putting something down on a table
76
+
77
+ The hand lets go where it is; the prop does not fall unless it has a `body`. So:
78
+
79
+ 1. Stage the walk and the release.
80
+ 2. Measure: `propPlacement(compileScene(doc, assets), prop, tRelease)` → `x`, `y`.
81
+ 3. Put the table's top under the prop's bottom edge (`y + half its height`), and its body under
82
+ the prop's `x` — or move where the character stops.
83
+
84
+ `examples/hold.ts --measure` prints it.
85
+
86
+ ## Physics props
87
+
88
+ A prop with `body` (`dynamic`) follows the hand while held and leaves with the hand's velocity on
89
+ `release` (or `velocity`). Bake with `prepareScene` from `@anime-studio/rigid` (it runs the
90
+ Rapier simulation); add a static floor prop so it lands.
91
+
92
+ ## Director beats for props
93
+
94
+ `pick`, `drop`, `give`, `throw`, `hold` (a prop), `use`, `take`, `putBack`, `dribble`, `carry`
95
+ (piggyback), `cradle` (a baby): the director walks the character over, chooses the free hand and
96
+ keeps props in the same hand when the holder turns round. Prefer them in stagings.
97
+
98
+ ## Pitfalls
99
+
100
+ - A prop popping in: an object held in a scene is grabbed from `at: 0`.
101
+ - Two props in one hand: use `hand` and `handB`.
102
+ - `walkTo`, `fall` and `getUp` play their clips on layer 0. A held-prop clip (`carry`, `texting`,
103
+ `read`) on layer 0 competes with the gait: put it on layer 1. End it (a `duration`) before a
104
+ `fall`, or it overrides the falling limbs.
105
+ - `fit` without `face` on a flat prop: one side is drawn from every angle.
106
+ - Validate twice: look at the sheet and zoom into the hands (`magick f.png -crop … -resize 400%`).
@@ -0,0 +1,86 @@
1
+ # Locomotion: walks, runs and turns
2
+
3
+ Reference: [FORMAT.md §3.3 `walkTo`](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md#33-script-actions),
4
+ [AI_GUIDE.md](https://github.com/denerFernandes/animeStudio/blob/master/docs/AI_GUIDE.md) (personality walks, runs),
5
+ [DIRECTOR.md → walk/run](https://github.com/denerFernandes/animeStudio/blob/master/docs/DIRECTOR.md#beats-do).
6
+
7
+ ## `walkTo`
8
+
9
+ `x`, `y?`, `duration` **or** `speed` (px/s, default 220), `clip` (default `walk`), `ease?`.
10
+
11
+ - The body moves on an accelerate–cruise–decelerate profile; the clip plays stride-matched
12
+ (`stride × actor scale` per cycle), so the planted foot stays put. It faces the way it goes.
13
+ - It takes over a move under way from where the actor is (both axes). Do not overlap two walks of
14
+ one actor; chain them (`at` of the second ≥ end of the first).
15
+ - 2.5D rigs: in a three-quarter view the steps look shorter in the picture, so the clip plays
16
+ faster (up to 1.3× its natural rate, then the stride lengthens up to 1.8×). Past that, a little
17
+ slide shows — it means the speed is wrong for the view, not that you should key the feet.
18
+ - A walk that reverses turns through the front (or the back walking away), stepping through the
19
+ drawn angles; set the walk's `view` before the walk starts.
20
+
21
+ ## Choosing the gait
22
+
23
+ | Gait | Mood / situation | Speed tip |
24
+ |---|---|---|
25
+ | `walk` | Default | 150–250 px/s at scale 1 (director: 170) |
26
+ | `sneak` | Creeping up on someone, tiptoeing past | Slow: about half a walk |
27
+ | `strut` | Showing off, confident | Like a walk |
28
+ | `tired` | Exhausted, sad, late at night | Slower than a walk |
29
+ | `march` | Parade, determined | Like a walk, quick cadence |
30
+ | `run` | A hurry, a chase | Natural: `stride × scale / duration` (≈ 720 px/s at scale 1) |
31
+ | `scaredRun` | Fleeing in panic — not for a hurry | Natural (≈ 1600 px/s at scale 1) |
32
+
33
+ Compute a run's speed instead of guessing:
34
+
35
+ ```ts
36
+ const c = characters.ana.clips!.scaredRun;
37
+ const speed = (c.stride! * SCALE) / c.duration;
38
+ { at: 5.7, actor: "ana", action: "walkTo", x: -350, clip: "scaredRun", speed }
39
+ ```
40
+
41
+ Much slower and a run plays in slow motion; much faster and the legs blur. Give a run room: at
42
+ natural speed it crosses about two leg lengths per cycle. A character in a `skirt`/`longSkirt`
43
+ runs shorter (a long skirt shuffles) — do not expect a sprinter's stride.
44
+
45
+ ## Views for travel
46
+
47
+ | Movement | View |
48
+ |---|---|
49
+ | Walking across the frame | `profile` (three-quarter, face visible) or `q64` |
50
+ | Running across | `q64` (the rig's travel view: side-on, face still showing) or `side` |
51
+ | Walking away into depth | `back`, in-place foreshortened walk (director `cross`) |
52
+ | Walking towards camera | `front` / `half` — the steps foreshorten, keep it short |
53
+
54
+ Set the travel view with a short duration as the walk starts and turn back on arrival:
55
+
56
+ ```ts
57
+ { at: 5.7, actor: "ana", action: "pose", control: "view", value: "q64", duration: 0.2 },
58
+ { at: 5.7, actor: "ana", action: "walkTo", x: -350, clip: "scaredRun", speed },
59
+ ```
60
+
61
+ ## Turning on the spot
62
+
63
+ - `pose view` with a `duration` (0.25–0.5 s) steps through the in-between drawings. Look-at and
64
+ eyes can lead: `lookAt` first, the body 0.1 s later.
65
+ - `face` (`left`/`right`) mirrors at once. In a director staging `face` turns through the angles
66
+ automatically (and `life` blinks on the turn).
67
+ - Turning to the audience to speak: `view: "front"` plus `lookAt: null`.
68
+
69
+ ## Following and framing
70
+
71
+ - Track a walker: `{ action: "camera", follow: "ana", offset: [120, 0], deadZone: [60, 0], lookAhead: 0.3 }`.
72
+ - Two-shots: `{ action: "camera", frame: ["ana", "ben"], padding: 120 }` keeps both in during walks.
73
+
74
+ ## Entering and leaving
75
+
76
+ - Start off screen (`x` beyond the frame) and `walkTo` in; for runs add `fx` `dust` at
77
+ `anchor: "origin"` on the start and the stop.
78
+ - In a director staging use `enter` / `exit` (the actor is invisible until entering; the camera
79
+ never frames someone not there yet).
80
+
81
+ ## Checks
82
+
83
+ - Contact sheet with a floor ruler (`examples/sheet.ts` draws ticks every 80 px): a planted foot
84
+ must stay on the same tick across two frames 0.1 s apart.
85
+ - Arrival spacing: `anchorPosition(scene, id, "head", t)` after the walk; keep a step between
86
+ characters' heads.
@@ -0,0 +1,89 @@
1
+ # Timing and acting
2
+
3
+ Reference: [FORMAT.md §3.8 Cartoon timing](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md#38-cartoon-timing),
4
+ [DIRECTOR.md → Staging (`anticipation`, `life`, `arcs`)](https://github.com/denerFernandes/animeStudio/blob/master/docs/DIRECTOR.md#staging),
5
+ [API.md → `fluid`](https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md#anime-studiokit).
6
+
7
+ ## The settings
8
+
9
+ Scene `animation` (FORMAT §3.8):
10
+
11
+ | Field | Default | Effect |
12
+ |---|---|---|
13
+ | `twos` | 1 (ones) | Frames per drawing of the characters (2 = on twos); camera, layers, free props stay smooth |
14
+ | `holds` | 0 | Moving holds: a slight seeded drift so held poses never freeze (up to ±1.2 px at 1) |
15
+ | `smear` | 0 | Fast actors stretch along their path; fast limbs get faded multiples |
16
+ | `arcs` | 0 | `reach` blends travel on an arc away from the shoulder/hip |
17
+ | `boil` | 0 | Line boil: outlines wobble every two frames (costly in crowded scenes) |
18
+
19
+ Actors may override: `twos: false` (a clock, a car), `holds: 0` (furniture).
20
+
21
+ Director staging `animation` adds (staged by the director, never written into the scene):
22
+
23
+ | Field | Effect |
24
+ |---|---|
25
+ | `anticipation` (0..1) | Walks and runs lean back before setting off, into the move, past upright on arrival; landings squash; limb moves ≥ 0.25 s overshoot and settle (from 0.5). Gesture clips are untouched (already `fluid`) |
26
+ | `life` (0..1) | Blinks on every head turn, saccades while listening, head nods on stressed words |
27
+ | `arcs` (0..1) | IK moves keyed by the director get an arc |
28
+
29
+ ## House style: smooth
30
+
31
+ Render smooth: `twos`, `smear` and `boil` **off** unless the user asks for a hand-drawn look —
32
+ episodes made with these rigs read more fluid without them. `holds` (0.3–0.5), `anticipation`, `life` and `arcs` add acting without stepping the
33
+ motion; prefer them.
34
+
35
+ ```jsonc
36
+ "animation": { "holds": 0.4, "arcs": 1 } // scene
37
+ { "animation": { "holds": 0.4, "arcs": 1, "anticipation": 1, "life": 1 } } // staging
38
+ ```
39
+
40
+ ## Principles, applied
41
+
42
+ **Anticipation.** Before a big action, a small one the other way. The kit gestures carry it
43
+ (`fluid()`); for the body, the director's `anticipation`, or in a scene: a reaction `take`-style —
44
+ emotion and a short `fx` 0.05–0.1 s before the move. A punch: guard (`stance`) → `punch`.
45
+
46
+ **Timing and spacing.** Fast in, slow settle. Emotion changes 0.2–0.5 s; a shock 0.05–0.12 s.
47
+ View turns 0.25–0.5 s. Camera moves ≥ 1 s, `sineInOut`. Gesture `fadeIn` 0.15–0.25 s.
48
+
49
+ **Holds.** Let a pose read: 0.4–1 s after a gesture, at least 1.5 s on a K.O. before `getUp`.
50
+ A hold is not a freeze: keep `idle` underneath (and `holds` on).
51
+
52
+ **One clear action at a time.** A character does one readable thing per beat. Stagger secondary
53
+ changes: gaze (t), face (t + 0.05), body (t + 0.1). Two characters: let one act while the other
54
+ reacts — never both gesturing on the same frame.
55
+
56
+ **Contrast of speed.** Slow sneak → sudden `scaredRun`; long hold → quick take. Contrast is
57
+ what makes a beat land.
58
+
59
+ **Overlap and follow-through.** The kit rigs have springs on forearms, head, ponytail and big hair:
60
+ they lag and settle by themselves after a stop. Start the next action slightly before the
61
+ previous one ends (fades overlap) so motion flows.
62
+
63
+ **Arcs.** Hands travel on arcs: `animation.arcs: 1` for `reach` moves.
64
+
65
+ **Reactions.** The listener is half the scene: `lookAt` the speaker, a small emotion change on the
66
+ key word, an `fx` on the surprise. React to the cause *after* it happens (≥ 0.1 s) unless the
67
+ character anticipates it.
68
+
69
+ **Staging.** Profile/three-quarter for action between characters, front for talking to the
70
+ audience, keep screen direction (who is left of whom) across cuts, keep a step between faces.
71
+
72
+ ## A reaction beat, timed
73
+
74
+ ```ts
75
+ const T = 5.0; // the noise off screen
76
+ { at: T - 0.05, actor: "ana", action: "fx", type: "surprise" },
77
+ { at: T, actor: "ana", action: "lookAt", target: [1400, 360] },
78
+ { at: T, actor: "ana", action: "pose", control: "emotion", value: "scared", duration: 0.12 },
79
+ { at: T + 0.05, actor: "ana", action: "pose", control: "view", value: "profile", duration: 0.25 },
80
+ { at: T + 0.1, actor: "ana", action: "play", clip: "scared", duration: 0.55, fadeIn: 0.08 },
81
+ { at: T + 0.65, actor: "ana", action: "fx", type: "sweat" },
82
+ { at: T + 0.75, actor: "ana", action: "walkTo", x: -350, clip: "scaredRun", speed: runSpeed },
83
+ ```
84
+
85
+ ## Dialogue gestures
86
+
87
+ Start the gesture slightly before the line it goes with (0.1–0.2 s). Use `talk` (loop) under
88
+ speech for small hands; save big clips (`present`, `pointUp`, `shrug`) for the stressed word. In a
89
+ staging the director adds talking hands and head nods (`life`) for you.