@anime-studio/director 0.2.1 → 0.4.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/dist/describe.d.ts +1 -1
- package/dist/direct/arcs.d.ts +17 -0
- package/dist/direct/arcs.d.ts.map +1 -0
- package/dist/direct/arcs.js +76 -0
- package/dist/direct/arcs.js.map +1 -0
- package/dist/direct/arms.d.ts +46 -0
- package/dist/direct/arms.d.ts.map +1 -0
- package/dist/direct/arms.js +233 -0
- package/dist/direct/arms.js.map +1 -0
- package/dist/direct/beat.d.ts +7 -0
- package/dist/direct/beat.d.ts.map +1 -0
- package/dist/direct/beat.js +339 -0
- package/dist/direct/beat.js.map +1 -0
- package/dist/direct/build.d.ts +7 -0
- package/dist/direct/build.d.ts.map +1 -0
- package/dist/direct/build.js +152 -0
- package/dist/direct/build.js.map +1 -0
- package/dist/direct/camera.d.ts +38 -0
- package/dist/direct/camera.d.ts.map +1 -0
- package/dist/direct/camera.js +279 -0
- package/dist/direct/camera.js.map +1 -0
- package/dist/direct/cast.d.ts +45 -0
- package/dist/direct/cast.d.ts.map +1 -0
- package/dist/direct/cast.js +172 -0
- package/dist/direct/cast.js.map +1 -0
- package/dist/direct/check.d.ts +17 -0
- package/dist/direct/check.d.ts.map +1 -0
- package/dist/direct/check.js +270 -0
- package/dist/direct/check.js.map +1 -0
- package/dist/direct/contact.d.ts +28 -0
- package/dist/direct/contact.d.ts.map +1 -0
- package/dist/direct/contact.js +222 -0
- package/dist/direct/contact.js.map +1 -0
- package/dist/direct/dialogue.d.ts +19 -0
- package/dist/direct/dialogue.d.ts.map +1 -0
- package/dist/direct/dialogue.js +110 -0
- package/dist/direct/dialogue.js.map +1 -0
- package/dist/direct/episode.d.ts +10 -0
- package/dist/direct/episode.d.ts.map +1 -0
- package/dist/direct/episode.js +286 -0
- package/dist/direct/episode.js.map +1 -0
- package/dist/direct/fixtures.d.ts +29 -0
- package/dist/direct/fixtures.d.ts.map +1 -0
- package/dist/direct/fixtures.js +147 -0
- package/dist/direct/fixtures.js.map +1 -0
- package/dist/direct/flight.d.ts +23 -0
- package/dist/direct/flight.d.ts.map +1 -0
- package/dist/direct/flight.js +110 -0
- package/dist/direct/flight.js.map +1 -0
- package/dist/direct/furniture.d.ts +59 -0
- package/dist/direct/furniture.d.ts.map +1 -0
- package/dist/direct/furniture.js +149 -0
- package/dist/direct/furniture.js.map +1 -0
- package/dist/direct/gestures.d.ts +31 -0
- package/dist/direct/gestures.d.ts.map +1 -0
- package/dist/direct/gestures.js +211 -0
- package/dist/direct/gestures.js.map +1 -0
- package/dist/direct/graphics.d.ts +20 -0
- package/dist/direct/graphics.d.ts.map +1 -0
- package/dist/direct/graphics.js +282 -0
- package/dist/direct/graphics.js.map +1 -0
- package/dist/direct/hand-holding.d.ts +28 -0
- package/dist/direct/hand-holding.d.ts.map +1 -0
- package/dist/direct/hand-holding.js +187 -0
- package/dist/direct/hand-holding.js.map +1 -0
- package/dist/direct/hiding.d.ts +19 -0
- package/dist/direct/hiding.d.ts.map +1 -0
- package/dist/direct/hiding.js +173 -0
- package/dist/direct/hiding.js.map +1 -0
- package/dist/direct/life.d.ts +67 -0
- package/dist/direct/life.d.ts.map +1 -0
- package/dist/direct/life.js +275 -0
- package/dist/direct/life.js.map +1 -0
- package/dist/direct/lighting.d.ts +22 -0
- package/dist/direct/lighting.d.ts.map +1 -0
- package/dist/direct/lighting.js +86 -0
- package/dist/direct/lighting.js.map +1 -0
- package/dist/direct/lying.d.ts +24 -0
- package/dist/direct/lying.d.ts.map +1 -0
- package/dist/direct/lying.js +205 -0
- package/dist/direct/lying.js.map +1 -0
- package/dist/direct/motion.d.ts +50 -0
- package/dist/direct/motion.d.ts.map +1 -0
- package/dist/direct/motion.js +270 -0
- package/dist/direct/motion.js.map +1 -0
- package/dist/direct/pictures.d.ts +24 -0
- package/dist/direct/pictures.d.ts.map +1 -0
- package/dist/direct/pictures.js +265 -0
- package/dist/direct/pictures.js.map +1 -0
- package/dist/direct/props-in-hand.d.ts +71 -0
- package/dist/direct/props-in-hand.d.ts.map +1 -0
- package/dist/direct/props-in-hand.js +285 -0
- package/dist/direct/props-in-hand.js.map +1 -0
- package/dist/direct/props.d.ts +32 -0
- package/dist/direct/props.d.ts.map +1 -0
- package/dist/direct/props.js +118 -0
- package/dist/direct/props.js.map +1 -0
- package/dist/direct/riding.d.ts +76 -0
- package/dist/direct/riding.d.ts.map +1 -0
- package/dist/direct/riding.js +290 -0
- package/dist/direct/riding.js.map +1 -0
- package/dist/direct/scene.d.ts +322 -0
- package/dist/direct/scene.d.ts.map +1 -0
- package/dist/direct/scene.js +287 -0
- package/dist/direct/scene.js.map +1 -0
- package/dist/direct/shared.d.ts +87 -0
- package/dist/direct/shared.d.ts.map +1 -0
- package/dist/direct/shared.js +42 -0
- package/dist/direct/shared.js.map +1 -0
- package/dist/direct/sitting.d.ts +62 -0
- package/dist/direct/sitting.d.ts.map +1 -0
- package/dist/direct/sitting.js +320 -0
- package/dist/direct/sitting.js.map +1 -0
- package/dist/direct/throws.d.ts +14 -0
- package/dist/direct/throws.d.ts.map +1 -0
- package/dist/direct/throws.js +89 -0
- package/dist/direct/throws.js.map +1 -0
- package/dist/direct/timeline.d.ts +23 -0
- package/dist/direct/timeline.d.ts.map +1 -0
- package/dist/direct/timeline.js +90 -0
- package/dist/direct/timeline.js.map +1 -0
- package/dist/direct/timing.d.ts +50 -0
- package/dist/direct/timing.d.ts.map +1 -0
- package/dist/direct/timing.js +138 -0
- package/dist/direct/timing.js.map +1 -0
- package/dist/direct/vocabulary.d.ts +33 -0
- package/dist/direct/vocabulary.d.ts.map +1 -0
- package/dist/direct/vocabulary.js +56 -0
- package/dist/direct/vocabulary.js.map +1 -0
- package/dist/direct.d.ts +8 -87
- package/dist/direct.d.ts.map +1 -1
- package/dist/direct.js +8 -6052
- package/dist/direct.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cartoon timing: leans into walks, squash and stretch, settling limbs.
|
|
3
|
+
*/
|
|
4
|
+
import type { Animation } from "../types.js";
|
|
5
|
+
import type { BlockScene } from "./scene.js";
|
|
6
|
+
/** The scene's `animation`: the staging's cartoon timing without what the director stages itself. */
|
|
7
|
+
export declare function sceneAnimation(this: BlockScene): {
|
|
8
|
+
animation?: Animation;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Everything that turns or holds the whole body other than the walks' leans — rotations of the
|
|
12
|
+
* placement (lying, falls, flights, getting up), sitting, lying, riding or being carried — as
|
|
13
|
+
* [from, to] intervals (episode time).
|
|
14
|
+
*/
|
|
15
|
+
export declare function bodyHeld(this: BlockScene, actor: string): [number, number][];
|
|
16
|
+
/**
|
|
17
|
+
* Walks lean from the feet (the placement's rotation; the origin is between the feet, and a
|
|
18
|
+
* positive angle turns the top towards +x whatever the flip): a little back before setting off,
|
|
19
|
+
* into the move while going (more for a run), past upright the other way on arrival and back to
|
|
20
|
+
* upright. Walks one after the other keep leaning. Nothing of it while something else turns or
|
|
21
|
+
* holds the body; one that holds it right after the arrival gets it upright first, without the
|
|
22
|
+
* overshoot.
|
|
23
|
+
*/
|
|
24
|
+
export declare function leanWalks(this: BlockScene): void;
|
|
25
|
+
/** The actor's scale as last set by a moment (else its own), and whether it is a single number. */
|
|
26
|
+
export declare function scaleAt(this: BlockScene, actor: string, abs: number): {
|
|
27
|
+
base: [number, number];
|
|
28
|
+
single: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A landing's squash and settle (`animation.anticipation`): wider and shorter on touching the
|
|
32
|
+
* ground, a little taller after, back to the actor's own scale — about the origin, between the
|
|
33
|
+
* feet, so the feet stay on the ground. Thrown down lying (`lying`: where the body rests, as
|
|
34
|
+
* `lying()` gives it), the body flattens across instead and its `y` keeps the back on the ground.
|
|
35
|
+
* Not over another change of the scale (or, lying, of the height) under way.
|
|
36
|
+
*/
|
|
37
|
+
export declare function squash(this: BlockScene, actor: string, at: number, lying?: {
|
|
38
|
+
rotation: number;
|
|
39
|
+
contact: [number, number];
|
|
40
|
+
dir: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}): void;
|
|
43
|
+
/**
|
|
44
|
+
* Free moves of the limbs end with an overshoot that settles (`backOut`) from `anticipation` 0.5
|
|
45
|
+
* (below that they keep their ease): a move of 0.25 s or more eased in and out, not taken over
|
|
46
|
+
* within 0.1 s of its end. Not `arm3d`'s arcs (timed in-betweens), nor moves eased out into a
|
|
47
|
+
* contact (sitting, hands on the knees, hiding), nor the short holds.
|
|
48
|
+
*/
|
|
49
|
+
export declare function settleLimbs(this: BlockScene): void;
|
|
50
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/direct/timing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAM5E;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,QAoCzC;AAED,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAIjH;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,QA+BlJ;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,QAS3C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { r3, LIMB } from "./shared.js";
|
|
2
|
+
/** The scene's `animation`: the staging's cartoon timing without what the director stages itself. */
|
|
3
|
+
export function sceneAnimation() {
|
|
4
|
+
if (!this.animation)
|
|
5
|
+
return {};
|
|
6
|
+
// (`arcs` goes on to the scene too: its reach blends travel along arcs.)
|
|
7
|
+
const { anticipation, life, ...rest } = this.animation;
|
|
8
|
+
return (anticipation === undefined && life === undefined) || Object.keys(rest).length ? { animation: rest } : {};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Everything that turns or holds the whole body other than the walks' leans — rotations of the
|
|
12
|
+
* placement (lying, falls, flights, getting up), sitting, lying, riding or being carried — as
|
|
13
|
+
* [from, to] intervals (episode time).
|
|
14
|
+
*/
|
|
15
|
+
export function bodyHeld(actor) {
|
|
16
|
+
return [
|
|
17
|
+
...this.script.filter((x) => x.action === "set" && x.actor === actor && x.channel === "rotation").map((x) => [x.at + this.t0, x.at + this.t0 + (x.duration ?? 0)]),
|
|
18
|
+
...this.rests.filter((r) => r.actor === actor).map((r) => [r.t0, r.t1]),
|
|
19
|
+
...this.rides.filter((r) => r.rider === actor).map((r) => [r.t0, r.t1]),
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Walks lean from the feet (the placement's rotation; the origin is between the feet, and a
|
|
24
|
+
* positive angle turns the top towards +x whatever the flip): a little back before setting off,
|
|
25
|
+
* into the move while going (more for a run), past upright the other way on arrival and back to
|
|
26
|
+
* upright. Walks one after the other keep leaning. Nothing of it while something else turns or
|
|
27
|
+
* holds the body; one that holds it right after the arrival gets it upright first, without the
|
|
28
|
+
* overshoot.
|
|
29
|
+
*/
|
|
30
|
+
export function leanWalks() {
|
|
31
|
+
const a = this.anticipation;
|
|
32
|
+
if (!(a > 0))
|
|
33
|
+
return;
|
|
34
|
+
const PRE = 0.18, INTO = 0.25, OVER = 0.15, SETTLE = 0.3;
|
|
35
|
+
for (const actor of new Set(this.leans.map((l) => l.walk.actor))) {
|
|
36
|
+
const held = this.bodyHeld(actor);
|
|
37
|
+
// (Times are kept to the millisecond: what ends as another starts does not overlap it.)
|
|
38
|
+
const clear = (from, to) => !held.some(([p, q]) => p < to - 0.003 && q > from + 0.003);
|
|
39
|
+
const walks = this.leans
|
|
40
|
+
.filter((l) => l.walk.actor === actor && Math.abs(l.walk.x1 - l.walk.x0) > 4 && l.walk.t1 - l.walk.t0 > 0.1 && clear(l.walk.t0, l.walk.t1))
|
|
41
|
+
.sort((p, q) => p.walk.t0 - q.walk.t0);
|
|
42
|
+
// (The next walk takes the lean over when it starts before this one would have settled.)
|
|
43
|
+
const chained = (w, n) => !!n && n.t0 - w.t1 < PRE + OVER + SETTLE && clear(w.t1, n.t0);
|
|
44
|
+
walks.forEach((l, i) => {
|
|
45
|
+
const w = l.walk, prev = walks[i - 1]?.walk, next = walks[i + 1]?.walk;
|
|
46
|
+
const dir = Math.sign(w.x1 - w.x0);
|
|
47
|
+
const into = Math.min(INTO, (w.t1 - w.t0) / 2);
|
|
48
|
+
if (prev && chained(prev, w)) {
|
|
49
|
+
// Turning back the other way: from the old lean to this one's wind-up as the first ends.
|
|
50
|
+
if (Math.sign(prev.x1 - prev.x0) !== dir) {
|
|
51
|
+
const from = Math.max(prev.t0 + Math.min(INTO, (prev.t1 - prev.t0) / 2), w.t0 - PRE);
|
|
52
|
+
this.set(actor, "rotation", r3(-dir * 3 * a), from, w.t0 - from, "sineInOut");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (w.t0 - PRE >= this.t0 && clear(w.t0 - PRE, w.t0))
|
|
56
|
+
this.set(actor, "rotation", r3(-dir * 3 * a), w.t0 - PRE, PRE, "sineInOut");
|
|
57
|
+
this.set(actor, "rotation", r3(dir * 5 * a * (l.run ? 1.5 : 1)), w.t0, into, "sineInOut");
|
|
58
|
+
if (chained(w, next))
|
|
59
|
+
return;
|
|
60
|
+
const stop = held.map(([p]) => p).filter((p) => p >= w.t1 - 0.003 && p < w.t1 + OVER + SETTLE).sort((p, q) => p - q)[0];
|
|
61
|
+
if (stop === undefined) {
|
|
62
|
+
this.set(actor, "rotation", r3(-dir * 2.5 * a), w.t1, OVER, "sineInOut");
|
|
63
|
+
this.set(actor, "rotation", 0, w.t1 + OVER, SETTLE, "sineInOut");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const from = Math.max(w.t0 + into, stop - 0.25);
|
|
67
|
+
this.set(actor, "rotation", 0, from, Math.max(0, stop - from), "sineInOut");
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** The actor's scale as last set by a moment (else its own), and whether it is a single number. */
|
|
73
|
+
export function scaleAt(actor, abs) {
|
|
74
|
+
const last = this.script.filter((x) => x.action === "set" && x.actor === actor && x.channel === "scale" && x.at <= this.t(abs) + 1e-6).sort((p, q) => p.at - q.at).pop();
|
|
75
|
+
const v = (last?.value ?? this.actors.find((x) => x.id === actor)?.scale ?? 1);
|
|
76
|
+
return Array.isArray(v) ? { base: [v[0], v[1]], single: false } : { base: [v, v], single: true };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A landing's squash and settle (`animation.anticipation`): wider and shorter on touching the
|
|
80
|
+
* ground, a little taller after, back to the actor's own scale — about the origin, between the
|
|
81
|
+
* feet, so the feet stay on the ground. Thrown down lying (`lying`: where the body rests, as
|
|
82
|
+
* `lying()` gives it), the body flattens across instead and its `y` keeps the back on the ground.
|
|
83
|
+
* Not over another change of the scale (or, lying, of the height) under way.
|
|
84
|
+
*/
|
|
85
|
+
export function squash(actor, at, lying) {
|
|
86
|
+
// A landing squashes fully whenever anticipation is on (the option switches it, it does not
|
|
87
|
+
// scale it): a small value must never land softer than the plain touch-down it replaces.
|
|
88
|
+
const a = 1;
|
|
89
|
+
const END = 0.3;
|
|
90
|
+
const busy = (channel) => this.script.some((x) => x.action === "set" && x.actor === actor && x.channel === channel && x.at + this.t0 < at + END && x.at + this.t0 + (x.duration ?? 0) > at + 0.003);
|
|
91
|
+
if (busy("scale") || (lying && busy("y")))
|
|
92
|
+
return;
|
|
93
|
+
const { base, single } = this.scaleAt(actor, at);
|
|
94
|
+
const rad = ((lying?.rotation ?? 0) * Math.PI) / 180;
|
|
95
|
+
// (Lying, the body's own x is across it: the squash is on that axis.)
|
|
96
|
+
const across = Math.abs(Math.sin(rad)) > 0.7;
|
|
97
|
+
const keys = [
|
|
98
|
+
[0.06, [1 + 0.12 * a, 1 - 0.12 * a], "easeOut"],
|
|
99
|
+
[0.16, [1 - 0.03 * a, 1 + 0.04 * a], "sineInOut"],
|
|
100
|
+
[END, [1, 1], "sineInOut"],
|
|
101
|
+
];
|
|
102
|
+
// (A pair from here on: a number would step to a pair instead of easing into it.)
|
|
103
|
+
this.set(actor, "scale", base, at - 0.002, 0);
|
|
104
|
+
let t = at;
|
|
105
|
+
for (const [k, [u, v], ease] of keys) {
|
|
106
|
+
const [kx, ky] = across ? [v, u] : [u, v];
|
|
107
|
+
this.set(actor, "scale", [r3(base[0] * kx), r3(base[1] * ky)], t, at + k - t, ease);
|
|
108
|
+
if (lying) {
|
|
109
|
+
// Where the resting point lands with this scale (as `lying()` places it): kept on the ground.
|
|
110
|
+
const px = lying.contact[0] * lying.dir * base[0] * kx, py = lying.contact[1] * base[1] * ky;
|
|
111
|
+
const y = lying.y - (px * Math.sin(rad) + py * Math.cos(rad));
|
|
112
|
+
this.set(actor, "y", k === END ? Math.round(y) : r3(y), t, at + k - t, ease);
|
|
113
|
+
}
|
|
114
|
+
t = at + k;
|
|
115
|
+
}
|
|
116
|
+
if (single)
|
|
117
|
+
this.set(actor, "scale", base[0], at + END + 0.002, 0);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Free moves of the limbs end with an overshoot that settles (`backOut`) from `anticipation` 0.5
|
|
121
|
+
* (below that they keep their ease): a move of 0.25 s or more eased in and out, not taken over
|
|
122
|
+
* within 0.1 s of its end. Not `arm3d`'s arcs (timed in-betweens), nor moves eased out into a
|
|
123
|
+
* contact (sitting, hands on the knees, hiding), nor the short holds.
|
|
124
|
+
*/
|
|
125
|
+
export function settleLimbs() {
|
|
126
|
+
if (this.anticipation < 0.5)
|
|
127
|
+
return;
|
|
128
|
+
const sets = this.script.filter((x) => x.action === "set" && typeof x.channel === "string" && LIMB.test(x.channel));
|
|
129
|
+
for (const x of sets) {
|
|
130
|
+
const dur = x.duration ?? 0;
|
|
131
|
+
if (dur < 0.25 || this.arcKeys.has(x) || !(x.ease === undefined || x.ease === "sineInOut" || x.ease === "easeInOut"))
|
|
132
|
+
continue;
|
|
133
|
+
if (sets.some((y) => y !== x && y.actor === x.actor && y.channel === x.channel && y.at >= x.at - 1e-6 && y.at <= x.at + dur + 0.1 + 1e-6))
|
|
134
|
+
continue;
|
|
135
|
+
x.ease = "backOut";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=timing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.js","sourceRoot":"","sources":["../../src/direct/timing.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,EAAE,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE/C,qGAAqG;AACrG,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC/B,yEAAyE;IACzE,MAAM,EAAE,YAA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C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACpH,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,GAAG,GAAI,CAAC,CAAC,QAA+B,IAAI,CAAC,CAAC;QACpD,IAAI,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC;YAAE,SAAS;QAC/H,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;YAAE,SAAS;QACpJ,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** "unknown x" messages name the closest valid id. */
|
|
2
|
+
/** Controls with their own actions, never worn. */
|
|
3
|
+
export declare const NOT_WORN: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Wardrobe controls of a rig (outfits, accessories): the pose controls listed in `meta.wardrobe`,
|
|
6
|
+
* or, without that list, every pose control except `view` and `emotion`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function wardrobeOf(doc: unknown): Record<string, string[]>;
|
|
9
|
+
export declare function closest(word: string, options: string[]): string;
|
|
10
|
+
/** Lighting presets for `light { mood }`: grade colour/opacity and the sun's height. */
|
|
11
|
+
export declare const MOODS: Record<string, {
|
|
12
|
+
grade: string;
|
|
13
|
+
opacity: number;
|
|
14
|
+
ambient?: {
|
|
15
|
+
color: string;
|
|
16
|
+
opacity: number;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
/** Every beat action (`do`). */
|
|
20
|
+
export declare const ACTIONS: string[];
|
|
21
|
+
/** Camera shot types. */
|
|
22
|
+
/** Camera types. */
|
|
23
|
+
export declare const CAMERAS: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Gestures that read from the front as hand positions, not arm swings: where the near hand goes,
|
|
26
|
+
* relative to the face centre (in face heights: +x towards the near side, +y down).
|
|
27
|
+
*/
|
|
28
|
+
export declare const FRONT_GESTURES: Record<string, {
|
|
29
|
+
hand: [number, number];
|
|
30
|
+
both?: boolean;
|
|
31
|
+
hold: number;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/direct/vocabulary.ts"],"names":[],"mappings":"AAKA,sDAAsD;AACtD,mDAAmD;AACnD,eAAO,MAAM,QAAQ,UAAsB,CAAC;AAC5C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAKjE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAS/D;AAED,wFAAwF;AACxF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAMlH,CAAC;AAEF,gCAAgC;AAChC,eAAO,MAAM,OAAO,UAAwa,CAAC;AAC7b,yBAAyB;AACzB,oBAAoB;AACpB,eAAO,MAAM,OAAO,UAAwF,CAAC;AAC7G;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAOnG,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The director's vocabulary: actions, camera moves, moods, front gestures, wardrobe and name matching.
|
|
3
|
+
*/
|
|
4
|
+
import { norm } from "./shared.js";
|
|
5
|
+
/** "unknown x" messages name the closest valid id. */
|
|
6
|
+
/** Controls with their own actions, never worn. */
|
|
7
|
+
export const NOT_WORN = ["view", "emotion"];
|
|
8
|
+
/**
|
|
9
|
+
* Wardrobe controls of a rig (outfits, accessories): the pose controls listed in `meta.wardrobe`,
|
|
10
|
+
* or, without that list, every pose control except `view` and `emotion`.
|
|
11
|
+
*/
|
|
12
|
+
export function wardrobeOf(doc) {
|
|
13
|
+
const d = doc;
|
|
14
|
+
const pose = Object.entries(d?.controls ?? {}).filter(([id, c]) => c.type === "pose" && !NOT_WORN.includes(id));
|
|
15
|
+
const listed = d?.meta?.wardrobe;
|
|
16
|
+
return Object.fromEntries(pose.filter(([id]) => !listed || listed.includes(id)).map(([id, c]) => [id, Object.keys(c.poses ?? {})]));
|
|
17
|
+
}
|
|
18
|
+
export function closest(word, options) {
|
|
19
|
+
const d = (a, b) => {
|
|
20
|
+
const m = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]);
|
|
21
|
+
for (let j = 1; j <= b.length; j++)
|
|
22
|
+
m[0][j] = j;
|
|
23
|
+
for (let i = 1; i <= a.length; i++)
|
|
24
|
+
for (let j = 1; j <= b.length; j++)
|
|
25
|
+
m[i][j] = Math.min(m[i - 1][j] + 1, m[i][j - 1] + 1, m[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
26
|
+
return m[a.length][b.length];
|
|
27
|
+
};
|
|
28
|
+
const best = [...options].sort((a, b) => d(norm(word), norm(a)) - d(norm(word), norm(b)))[0];
|
|
29
|
+
return best ? ` (did you mean "${best}"? valid: ${options.join(", ")})` : "";
|
|
30
|
+
}
|
|
31
|
+
/** Lighting presets for `light { mood }`: grade colour/opacity and the sun's height. */
|
|
32
|
+
export const MOODS = {
|
|
33
|
+
morning: { grade: "#fff0b8", opacity: 0.1 },
|
|
34
|
+
day: { grade: "#ffcf8a", opacity: 0.08 },
|
|
35
|
+
afternoon: { grade: "#ff9d5c", opacity: 0.22 },
|
|
36
|
+
evening: { grade: "#ff6f6f", opacity: 0.3, ambient: { color: "#4a3a8a", opacity: 0.25 } },
|
|
37
|
+
night: { grade: "#3a4aa0", opacity: 0.35, ambient: { color: "#1c1f4a", opacity: 0.55 } },
|
|
38
|
+
};
|
|
39
|
+
/** Every beat action (`do`). */
|
|
40
|
+
export const ACTIONS = ["walk", "run", "enter", "exit", "face", "look", "emotion", "wear", "gesture", "fx", "view", "hold", "release", "cross", "pick", "drop", "throw", "roll", "dribble", "vehicle", "fixture", "camera", "light", "mount", "dismount", "ride", "fall", "sit", "lie", "sleep", "getUp", "fly", "hands", "hit", "sound", "give", "highFive", "hug", "carry", "hide", "peek", "use", "take", "putBack", "snap", "dropOn", "cradle", "press"];
|
|
41
|
+
/** Camera shot types. */
|
|
42
|
+
/** Camera types. */
|
|
43
|
+
export const CAMERAS = ["wide", "group", "medium", "two-shot", "close", "crash", "whip", "follow", "reveal"];
|
|
44
|
+
/**
|
|
45
|
+
* Gestures that read from the front as hand positions, not arm swings: where the near hand goes,
|
|
46
|
+
* relative to the face centre (in face heights: +x towards the near side, +y down).
|
|
47
|
+
*/
|
|
48
|
+
export const FRONT_GESTURES = {
|
|
49
|
+
facepalm: { hand: [0.1, -0.45], hold: 1.4 },
|
|
50
|
+
despair: { hand: [0.55, 0.35], hold: 1.4 },
|
|
51
|
+
think: { hand: [0.25, 0.8], hold: 1.8 },
|
|
52
|
+
cover: { hand: [0, 0.55], hold: 1.2 },
|
|
53
|
+
excited: { hand: [0.55, 1.3], both: true, hold: 1.4 },
|
|
54
|
+
shout: { hand: [0.5, 0.5], both: true, hold: 1.2 },
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/direct/vocabulary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,sDAAsD;AACtD,mDAAmD;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC5C;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,MAAM,CAAC,GAAG,GAAmI,CAAC;IAC9I,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAChH,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC;IACjC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAA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AAE,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;CACnD,CAAC"}
|
package/dist/direct.d.ts
CHANGED
|
@@ -1,90 +1,11 @@
|
|
|
1
|
-
import { type MouthCue } from "@anime-studio/core";
|
|
2
|
-
import type { Block, Directed, Issue, Kit, Line, Staging, When } from "./types.js";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* across the chord by `arcs × 0.3 × |chord|` away from the chain's root (unknown, or on the chord's
|
|
7
|
-
* line: upwards; a vertical chord there: forwards), as the scene's reach blends do. The two halves
|
|
8
|
-
* keep the move's sineInOut along the chord and meet at the midpoint at its speed (cubic-bezier
|
|
9
|
-
* eases per axis), so the hand flows through it. `joints` gives the chain's root and rest tip
|
|
10
|
-
* (character space). A pair taking over a move still under way, or taken over itself, is left straight.
|
|
2
|
+
* The director: a staging, timed lines and a kit to a sequence of scenes. The code lives in the
|
|
3
|
+
* modules of `./direct/` (one per responsibility); this file keeps the import path and the exports.
|
|
11
4
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} | undefined): A[];
|
|
19
|
-
/**
|
|
20
|
-
* Wardrobe controls of a rig (outfits, accessories): the pose controls listed in `meta.wardrobe`,
|
|
21
|
-
* or, without that list, every pose control except `view` and `emotion`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function wardrobeOf(doc: unknown): Record<string, string[]>;
|
|
24
|
-
export declare function closest(word: string, options: string[]): string;
|
|
25
|
-
/** Lighting presets for `light { mood }`: grade colour/opacity and the sun's height. */
|
|
26
|
-
export declare const MOODS: Record<string, {
|
|
27
|
-
grade: string;
|
|
28
|
-
opacity: number;
|
|
29
|
-
ambient?: {
|
|
30
|
-
color: string;
|
|
31
|
-
opacity: number;
|
|
32
|
-
};
|
|
33
|
-
}>;
|
|
34
|
-
export declare class Timeline {
|
|
35
|
-
readonly lines: Line[];
|
|
36
|
-
constructor(lines: Line[]);
|
|
37
|
-
start(i: number): number;
|
|
38
|
-
get end(): number;
|
|
39
|
-
/**
|
|
40
|
-
* Episode time of a `When`. An unknown line throws; a word the line does not have (or a line
|
|
41
|
-
* without word timings) falls back to the line's start (or end) and is reported to `miss`.
|
|
42
|
-
*/
|
|
43
|
-
at(w: When, miss?: (message: string) => void): number;
|
|
44
|
-
blockStart(b: Block): number;
|
|
45
|
-
blockEnd(b: Block): number;
|
|
46
|
-
}
|
|
47
|
-
/** Volume of a music envelope at a time (linear between its keys). */
|
|
48
|
-
export declare function volumeAt(keys: [number, number][], t: number): number;
|
|
49
|
-
/** Mouth cues of a line from its word timings (relative to the line start). */
|
|
50
|
-
export declare function lineCues(l: Line): MouthCue[];
|
|
51
|
-
/** Every beat action (`do`). */
|
|
52
|
-
export declare const ACTIONS: string[];
|
|
53
|
-
/** Camera shot types. */
|
|
54
|
-
/** Camera types. */
|
|
55
|
-
export declare const CAMERAS: string[];
|
|
56
|
-
/**
|
|
57
|
-
* Gestures that read from the front as hand positions, not arm swings: where the near hand goes,
|
|
58
|
-
* relative to the face centre (in face heights: +x towards the near side, +y down).
|
|
59
|
-
*/
|
|
60
|
-
export declare const FRONT_GESTURES: Record<string, {
|
|
61
|
-
hand: [number, number];
|
|
62
|
-
both?: boolean;
|
|
63
|
-
hold: number;
|
|
64
|
-
}>;
|
|
65
|
-
/**
|
|
66
|
-
* Turns a staging (blocks of continuous action, beats timed to lines and words, cuts and texts)
|
|
67
|
-
* into a toon-sequence with one scene per block. Pure: runs in the browser and in node.
|
|
68
|
-
*/
|
|
69
|
-
export declare function direct(staging: Staging, lines: Line[], kit: Kit): Directed;
|
|
70
|
-
/** direct() + document validation + continuity checks. */
|
|
71
|
-
/**
|
|
72
|
-
* `strict`: the motion checks sample every frame instead of every tenth of a second (slower; run it
|
|
73
|
-
* before a render).
|
|
74
|
-
*/
|
|
75
|
-
export interface CheckOptions {
|
|
76
|
-
strict?: boolean;
|
|
77
|
-
}
|
|
78
|
-
export declare function check(staging: Staging, lines: Line[], kit: Kit, opts?: CheckOptions): Issue[];
|
|
79
|
-
/** A 2D affine matrix [a, b, c, d, e, f] (SVG's: x' = a·x + c·y + e, y' = b·x + d·y + f). */
|
|
80
|
-
type Affine = [number, number, number, number, number, number];
|
|
81
|
-
/** An SVG `transform` attribute as one matrix (translate, scale, rotate(a[, cx, cy]), matrix, skewX, skewY; applied left to right). */
|
|
82
|
-
export declare function parseTransform(src: string | undefined): Affine;
|
|
83
|
-
/**
|
|
84
|
-
* Rough boxes of the shapes of an SVG drawing (absolute paths, polygons, rects, circles, ellipses)
|
|
85
|
-
* in its own coordinates, after the `transform`s of the groups they are in and their own (a gate
|
|
86
|
-
* drawn moved by a `<g transform>` is measured where it is drawn).
|
|
87
|
-
*/
|
|
88
|
-
export declare function markupBoxes(svg: string): [number, number, number, number][];
|
|
89
|
-
export {};
|
|
5
|
+
export { arcIk } from "./direct/arcs.js";
|
|
6
|
+
export { ACTIONS, CAMERAS, FRONT_GESTURES, MOODS, closest, wardrobeOf } from "./direct/vocabulary.js";
|
|
7
|
+
export { Timeline, lineCues, volumeAt } from "./direct/timeline.js";
|
|
8
|
+
export { direct } from "./direct/episode.js";
|
|
9
|
+
export { check, type CheckOptions } from "./direct/check.js";
|
|
10
|
+
export { markupBoxes, parseTransform } from "./direct/pictures.js";
|
|
90
11
|
//# sourceMappingURL=direct.d.ts.map
|
package/dist/direct.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.d.ts","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"direct.d.ts","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|