@anime-studio/kit 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -2
  3. package/dist/cartoon.d.ts +368 -0
  4. package/dist/cartoon.d.ts.map +1 -0
  5. package/dist/cartoon.js +2815 -0
  6. package/dist/cartoon.js.map +1 -0
  7. package/dist/human.d.ts +165 -0
  8. package/dist/human.d.ts.map +1 -0
  9. package/dist/human.js +433 -0
  10. package/dist/human.js.map +1 -0
  11. package/dist/humanFront.d.ts +18 -0
  12. package/dist/humanFront.d.ts.map +1 -0
  13. package/dist/humanFront.js +137 -0
  14. package/dist/humanFront.js.map +1 -0
  15. package/dist/index.d.ts +9 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +9 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/info.d.ts +96 -0
  20. package/dist/info.d.ts.map +1 -0
  21. package/dist/info.js +277 -0
  22. package/dist/info.js.map +1 -0
  23. package/dist/proportions.d.ts +37 -0
  24. package/dist/proportions.d.ts.map +1 -0
  25. package/dist/proportions.js +115 -0
  26. package/dist/proportions.js.map +1 -0
  27. package/dist/rig.d.ts +538 -0
  28. package/dist/rig.d.ts.map +1 -0
  29. package/dist/rig.js +1381 -0
  30. package/dist/rig.js.map +1 -0
  31. package/dist/room.d.ts +124 -0
  32. package/dist/room.d.ts.map +1 -0
  33. package/dist/room.js +217 -0
  34. package/dist/room.js.map +1 -0
  35. package/dist/util.d.ts +27 -0
  36. package/dist/util.d.ts.map +1 -0
  37. package/dist/util.js +29 -0
  38. package/dist/util.js.map +1 -0
  39. package/dist/views.d.ts +68 -0
  40. package/dist/views.d.ts.map +1 -0
  41. package/dist/views.js +92 -0
  42. package/dist/views.js.map +1 -0
  43. package/dist/volume.d.ts +105 -0
  44. package/dist/volume.d.ts.map +1 -0
  45. package/dist/volume.js +234 -0
  46. package/dist/volume.js.map +1 -0
  47. package/package.json +45 -3
package/dist/rig.d.ts ADDED
@@ -0,0 +1,538 @@
1
+ /**
2
+ * Building blocks for storybook cartoon characters (profile view, facing right, feet at y = 0).
3
+ *
4
+ * Characters built with the kit share bone names — root, ground, hips, body, head, pupils,
5
+ * armF1/armF2/handF (near arm), armB1/armB2/handB (far arm), legF1/legF2/footF and
6
+ * legB1/legB2/footB — so one set of gesture clips (`characterClips`), emotion poses and the
7
+ * director's staging work for every character. Colours use palette tokens; `palette(ink)` is the
8
+ * outline colour.
9
+ */
10
+ export type P = [number, number];
11
+ export type Tracks = Record<string, (number | string)[][]>;
12
+ export declare const r: (n: number) => number;
13
+ /**
14
+ * Mouth as one closed path (morph-compatible): corners L/R, top and bottom lips. By default the far
15
+ * corner (R) lifts more in a smile (a profile); `symmetric` lifts both alike (a face seen from the
16
+ * front); `lift` scales how high the corners go.
17
+ */
18
+ export interface MouthStyle {
19
+ symmetric?: boolean;
20
+ lift?: number;
21
+ }
22
+ export declare function mouthPath(L: P, R: P, open: number, smile: number, round: number, o?: MouthStyle): string;
23
+ /** Viseme mouths + expression shapes for a mouth with corners L/R. */
24
+ export declare function mouthShapes(L: P, R: P, scale?: number, style?: MouthStyle): {
25
+ base: string;
26
+ shapes: {
27
+ A: string;
28
+ B: string;
29
+ C: string;
30
+ D: string;
31
+ E: string;
32
+ F: string;
33
+ G: string;
34
+ H: string;
35
+ smile: string;
36
+ frown: string;
37
+ grin: string;
38
+ };
39
+ };
40
+ /** A round storybook eye (white + outline). */
41
+ export declare const eyeWhite: (c: P, rad: number, extra?: string) => string;
42
+ export declare const eyeArc: (c: P, rad: number, up: boolean) => string;
43
+ /** Eye with the top covered by a lid of the skin colour (half-closed / sleepy). */
44
+ export declare const eyeLid: (c: P, rad: number, k: number, skin: string, id: string) => string;
45
+ export interface EyeSpec {
46
+ eyes: [P, P];
47
+ rad: number;
48
+ skin: string;
49
+ /** Pupil radius. */
50
+ pupil: number;
51
+ /** Always draw a resting lid at this height (0..1), e.g. sleepy or elderly characters. */
52
+ restLid?: number;
53
+ }
54
+ export declare function eyeArt(e: EyeSpec): {
55
+ open: string;
56
+ wide: string;
57
+ closed: string;
58
+ happy: string;
59
+ half: string;
60
+ lids: string;
61
+ halfLids: string;
62
+ pupils: string;
63
+ };
64
+ /** Brows as one morph path (two strokes), with raised / sad / cross / smug shapes. */
65
+ export declare function browShapes(eyes: [P, P], rad: number, lift?: number): {
66
+ base: string;
67
+ shapes: {
68
+ up: string;
69
+ sad: string;
70
+ cross: string;
71
+ smug: string;
72
+ };
73
+ };
74
+ /** Bones every cast member has (near/far arm and leg chains, feet that stay flat). */
75
+ export declare function limbBones(o: {
76
+ shoulderF: P;
77
+ elbowF: P;
78
+ handF: P;
79
+ shoulderB: P;
80
+ elbowB: P;
81
+ handB: P;
82
+ hipF: P;
83
+ kneeF: P;
84
+ footF: P;
85
+ toeF: number;
86
+ hipB: P;
87
+ kneeB: P;
88
+ footB: P;
89
+ toeB: number;
90
+ }): ({
91
+ id: string;
92
+ parent: string;
93
+ from: P;
94
+ to: P;
95
+ mass: number;
96
+ inheritRotation?: undefined;
97
+ } | {
98
+ mass?: undefined;
99
+ id: string;
100
+ parent: string;
101
+ from: P;
102
+ to?: undefined;
103
+ inheritRotation?: undefined;
104
+ } | {
105
+ mass?: undefined;
106
+ id: string;
107
+ parent: string;
108
+ from: P;
109
+ to: number[];
110
+ inheritRotation: boolean;
111
+ })[];
112
+ export declare const limbIk: ({
113
+ id: string;
114
+ bones: string[];
115
+ bend: number;
116
+ mix?: undefined;
117
+ } | {
118
+ id: string;
119
+ bones: string[];
120
+ bend: number;
121
+ mix: number;
122
+ })[];
123
+ export interface Gait {
124
+ /** Half step amplitude (px): the foot travels ±a while planted. */
125
+ a: number;
126
+ /** How high the swinging foot rises (px; in a run, the ankle's height at the knee drive before `knee`). */
127
+ lift: number;
128
+ /** One cycle — two steps — in seconds. */
129
+ dur: number;
130
+ /** Up-and-down of the hips (px, half the range). */
131
+ bob: number;
132
+ /** Forward lean of the torso (degrees). */
133
+ lean: number;
134
+ /** Arm swing (degrees). */
135
+ armSwing: number;
136
+ /**
137
+ * Extra knee lift (0..1): the swinging foot rises up to a quarter of the leg higher, ahead of the
138
+ * hips (a march, a sneak). In a run, the knee drive: the thigh driven forward and up before the
139
+ * foot reaches out (1: the thigh about level, a sprint's knee pump).
140
+ */
141
+ knee?: number;
142
+ /** Hips lowered by this fraction of the leg length (0..0.3): knees bent all through the cycle. */
143
+ crouch?: number;
144
+ /** Heels up: the feet planted on the balls of the feet, the foot turned toe down (walk cycle). */
145
+ tiptoe?: boolean;
146
+ /** Side sway of the hips (degrees, `spread`): the hip over the planted foot rises, the torso stays upright. */
147
+ sway?: number;
148
+ /** The head's bob comes this fraction of the cycle late (overlapping action, 0..0.25). */
149
+ headLag?: number;
150
+ /**
151
+ * Arms: `swing` (counter-swing, default), `pump` (bent at the elbow, pumping), `hang` (limp), `up`
152
+ * (flailing overhead), `run` (a runner's arms: elbows near a right angle, each arm against its own
153
+ * leg, the hand from beside the hip behind to in front of the chest — short of the body's middle,
154
+ * never up at the face — the elbow out and the forearm turned in as it comes forward, so the bent
155
+ * elbow shows from the front too; late on the legs by `armLag`, the far arm a little less) or
156
+ * `reach` (panic: both arms flung up and out ahead, each to its own side, elbows low and bent
157
+ * 56–76°, the forearms rising to open hands about shoulder height, fluttering up and down twice a
158
+ * cycle out of step with each other — never overhead, never across the chest, the crotch or the
159
+ * face) or `sneak` (the cartoon sneak's: elbows out, the hands raised in front of the chest ahead
160
+ * of the shoulders, below the chin, the wrists bent down — "tiptoe fingers" — creeping up and down
161
+ * a little each step). `run`, `reach` and `sneak` are designed in 3D (see `flat`), so they read in
162
+ * every view: seen from the front each hand stays on its own side of the body (the panic hands out
163
+ * past the shoulders).
164
+ */
165
+ armStyle?: "swing" | "pump" | "hang" | "up" | "run" | "reach" | "sneak";
166
+ /** How late the `run` and `reach` arms come on the legs (fraction of the cycle, default 0.05: a frame or so). */
167
+ armLag?: number;
168
+ /**
169
+ * The rig is 2D (no `rig3d`): the `run`, `reach` and `sneak` arms are keyed as they look from the side
170
+ * (`rotation` only). On a 2.5D rig (the default) they also get the upper arm's `spread` and the
171
+ * forearm's `turn`, which carry them out of the side plane as designed.
172
+ */
173
+ flat?: boolean;
174
+ /** Torso bent forward (degrees; negative: chest out, leaning back); the head mostly follows. */
175
+ slump?: number;
176
+ /** Feet dragged (0..1): lower lift, the swinging foot trailing low with the toe scuffing (walk cycle). */
177
+ drag?: number;
178
+ /** Two bobs per step (four per cycle): the bouncy cartoon walk (walk cycle). */
179
+ doubleBounce?: boolean;
180
+ /** Leg length (px, hip to ankle) for `crouch`, `knee` and `heel`; default 7 × `a`. */
181
+ leg?: number;
182
+ /** Foot length (px, ankle to toe) for `tiptoe`, the creep's roll and the run's push-off; default 0.9 × `a`. */
183
+ foot?: number;
184
+ /**
185
+ * The run (0..0.6): the fraction of the cycle with both feet off the ground (a run about 0.3, a
186
+ * sprint 0.45). Each foot is then planted for (1 − flight)/2 of the cycle. Setting it, `heel` or
187
+ * `paw` makes the cycle a run's: the hips lowest at mid-stance (the down) and highest in mid-air,
188
+ * both feet lifted between the steps, the swinging foot kicked up behind (`heel`), driven through
189
+ * by the knee (`knee`), reaching past its landing point and pawing back into it (`paw`), the foot
190
+ * landing heel first, flat while planted and rolling onto its ball to push off (`toeOff`).
191
+ */
192
+ flight?: number;
193
+ /** Run: how high the swinging heel kicks up behind, as a fraction of the leg (0..0.85, default 0.4; 0.7: heel to the buttocks). */
194
+ heel?: number;
195
+ /** Run: the swinging foot reaches this fraction of `a` past its landing point, then paws back into it (default 0.15). */
196
+ paw?: number;
197
+ /** Run: how far the foot rolls onto its ball to push off (degrees, default 35): the ankle rises as the heel does, the ball stays put. */
198
+ toeOff?: number;
199
+ /**
200
+ * The creep (a cartoon sneak's cycle; `crouch`, `knee`, `toeOff` shape it): each foot planted for
201
+ * `CREEP_PLANT` of the cycle (both feet down a moment as the weight moves over), set down toe
202
+ * first and rolled flat about the ball, flat, then rolled onto the ball to lift; the swing peels
203
+ * the foot up behind, raises the knee high and holds it there a moment, then reaches out and sets
204
+ * it down ahead. The hips rise as the knee does and settle as the foot lands.
205
+ */
206
+ creep?: boolean;
207
+ }
208
+ /**
209
+ * Locomotion cycle: feet glide linearly while planted (no sliding), body bobs twice per cycle.
210
+ * In the walk cycle the near foot is planted for the first half (its x from +a to −a), the far foot
211
+ * for the second, and the hips are lowest as a foot lands. With `flight` (or `heel`, `paw`) it is
212
+ * a run's cycle instead: each foot planted for (1 − flight)/2 of it with both feet in the air
213
+ * between the steps, the hips lowest at mid-stance and highest in mid-air, the swinging foot kicked
214
+ * up behind, driven through by the knee and reaching out (see `Gait`). `stride` is the body's travel
215
+ * per cycle — the planted foot's speed × the cycle (2a ÷ the planted fraction; the planted travel
216
+ * itself when a foot is planted half the cycle) — what a `walkTo` and the director match the actor's
217
+ * speed to, so the planted feet stay put. The optional fields make personality walks (a sneak, a
218
+ * strut, a tired shuffle, a march, a scared run) from the same cycle.
219
+ */
220
+ export declare function gait(g: Gait, arms?: boolean): {
221
+ duration: number;
222
+ loop: boolean;
223
+ stride: number;
224
+ tracks: Tracks;
225
+ };
226
+ export interface ClipOptions {
227
+ walk: Gait;
228
+ run: Gait;
229
+ /** The far hand is busy (e.g. holding a walking stick): gestures leave it alone. */
230
+ busyFarHand?: boolean;
231
+ /** Scale of gesture energy (< 1 for calmer characters). */
232
+ energy?: number;
233
+ jump: number;
234
+ /** How far the forearm swings up in gestures (< 1 keeps a held object away from the face). */
235
+ forearmLift?: number;
236
+ /**
237
+ * The hands are switch parts `handF` / `handB` with the variants of `handShapes` (open, fist,
238
+ * point, grip): gestures then shape them (a fist to punch, a finger to point).
239
+ */
240
+ hands?: boolean;
241
+ /** Leg length (px, hip to ankle): how low the personality walks crouch. Default 7 × `walk.a`. */
242
+ leg?: number;
243
+ /** Foot length (px, ankle to toe): how high a tiptoe lifts the ankle, where a foot rolls onto its ball. Default 0.9 × `walk.a`. */
244
+ foot?: number;
245
+ /** The legs are in a skirt (`short`: to the knees; `long`: to the ankles): the runs are cut to it (`skirtRun`). */
246
+ skirt?: "short" | "long";
247
+ }
248
+ /**
249
+ * A run cut to a skirt. A skirt is one cloth spanning the legs (at the thighs, the knees and, long,
250
+ * the hem): a run's knee drive, heel kick and long flight would stretch it into a sack between them.
251
+ * To the knees, the shins are free (the heel still kicks up behind) but the thighs part less: half
252
+ * the knee drive, shorter steps, a little less flight. To the ankles, a shuffle: short steps under
253
+ * the body, the shins near plumb (a small heel kick, no knee drive), a short hop of flight, a smaller
254
+ * bob. Not a run (no `flight`, `heel` or `paw`): unchanged.
255
+ */
256
+ export declare function skirtRun(g: Gait, skirt: "short" | "long" | undefined): Gait;
257
+ /**
258
+ * Personality walks built from a character's walk and run (looping, with their own `stride`, so the
259
+ * director's stride matching keeps the feet planted): `sneak` (a classic cartoon creep, `creep`:
260
+ * crouched and leaning in, big slow steps set down toe first and rolled flat, the knee held high at
261
+ * the top of each step, the hands raised in front of the chest with the wrists bent: `sneak` arms), `strut` (chest out, hips swaying, bouncing twice a step, fists pumping), `tired` (slumped,
262
+ * feet dragging, arms hanging), `march` (knees high, upright, fists pumping) and `scaredRun` (a panic
263
+ * sprint: its own run cycle, not the run's — leaning hard in, crouched deep, the heels kicked high
264
+ * behind and the knees pumping, long flights at a faster cadence (never under 0.3 s a cycle:
265
+ * nine frames at 30 fps), the arms flung up and out ahead with bent elbows and open hands, fluttering out
266
+ * of step: `reach`). With `skirt`, cut to it (`skirtRun`).
267
+ */
268
+ export declare function personalityGaits(walk: Gait, run: Gait, o?: {
269
+ leg?: number;
270
+ foot?: number;
271
+ skirt?: "short" | "long";
272
+ }): Record<"sneak" | "strut" | "tired" | "march" | "scaredRun", Gait>;
273
+ /**
274
+ * Hand shapes drawn in setup space around the wrist position `at`: `open`, `fist`, `point` (index
275
+ * finger out) and `grip` (curled around something), as switch variants for a `handF` / `handB`
276
+ * part. The fingers follow the forearm (`dir`, degrees in setup space: 90 = down, a hanging arm),
277
+ * so a pointing finger points wherever the arm points. `r` is the palm radius, `fill` its colour.
278
+ */
279
+ export declare function handShapes(at: P, o: {
280
+ r: number;
281
+ fill: string;
282
+ ink?: string;
283
+ stroke?: number;
284
+ dir?: number;
285
+ }): {
286
+ open: string;
287
+ fist: string;
288
+ point: string;
289
+ grip: string;
290
+ };
291
+ export declare function characterClips(o: ClipOptions): Record<string, unknown>;
292
+ /**
293
+ * The knock-down clips, timed for the scene's `fall` action (which moves and turns the whole body —
294
+ * thrown back, the hips landing first, the shoulders slapping down — these only pose the limbs):
295
+ *
296
+ * - `knocked` (0.85 s, from the hit to the hips touching down; the fall plays it at the speed that
297
+ * lands it with the body, its end pose held): no anticipation — a hit is a surprise. The head
298
+ * whips back first, the chest a few frames later (whiplash), then the body folds at the hips
299
+ * (a jackknife: thighs forward and up, knees bent) as it flies; the arms lag behind the torso
300
+ * snapping back, so they fling forward and up with soft elbows, opening out (`turn`) so they
301
+ * never cross the face from the front; the far arm and leg a few frames behind the near ones.
302
+ * The foot IK lets go at once (planted feet would hold the body up) and the feet flex, toes up.
303
+ * - `down` (from the hips touching down, played once and held: the K.O. lying pose): the shoulders
304
+ * slap down, the legs keep rising for two frames and drop back with gravity — the near one
305
+ * straight, a bounce of the heel, then the far one into a knee up (staggered) — the far arm
306
+ * flops overhead and out along the floor, the near one out to the side, the head rolls towards
307
+ * the camera; then a slow breath and a twitch of the foot. Posed in 3D for the body lying on its
308
+ * back: the arms go out along the floor (`spread`), never across the face or into the floor, in
309
+ * every view (the far arm overhead is behind the head from the side).
310
+ */
311
+ export declare function knockDownClips(o?: {
312
+ busyFarHand?: boolean;
313
+ hands?: boolean;
314
+ }): {
315
+ knocked: {
316
+ duration: number;
317
+ tracks: {
318
+ "ik.footF.mix": number[][];
319
+ "ik.footB.mix": number[][];
320
+ "bones.hips.y": number[][];
321
+ "bones.head.rotation": (string | number)[][];
322
+ "bones.body.rotation": (string | number)[][];
323
+ "bones.armF1.rotation": number[][];
324
+ "bones.armF1.turn": number[][];
325
+ "bones.armF1.spread": number[][];
326
+ "bones.armF2.rotation": number[][];
327
+ "bones.legF1.rotation": number[][];
328
+ "bones.legF2.rotation": number[][];
329
+ "bones.legB1.rotation": number[][];
330
+ "bones.legB2.rotation": number[][];
331
+ "bones.footF.rotation": number[][];
332
+ "bones.footB.rotation": number[][];
333
+ };
334
+ };
335
+ down: {
336
+ duration: number;
337
+ tracks: {
338
+ "ik.footF.mix": number[][];
339
+ "ik.footB.mix": number[][];
340
+ "bones.hips.y": number[][];
341
+ "bones.body.rotation": (string | number)[][];
342
+ "bones.head.rotation": (string | number)[][];
343
+ "bones.head.turn": number[][];
344
+ "bones.armF1.rotation": (string | number)[][];
345
+ "bones.armF1.turn": number[][];
346
+ "bones.armF1.spread": number[][];
347
+ "bones.armF2.rotation": number[][];
348
+ "bones.legF1.rotation": (string | number)[][];
349
+ "bones.legF2.rotation": number[][];
350
+ "bones.legB1.rotation": (string | number)[][];
351
+ "bones.legB2.rotation": number[][];
352
+ "bones.footF.rotation": number[][];
353
+ "bones.footB.rotation": number[][];
354
+ };
355
+ };
356
+ rise: {
357
+ duration: number;
358
+ tracks: {
359
+ "ik.footF.mix": number[][];
360
+ "ik.footB.mix": number[][];
361
+ "bones.body.rotation": number[][];
362
+ "bones.head.rotation": number[][];
363
+ "bones.head.turn": number[][];
364
+ "bones.armF1.rotation": number[][];
365
+ "bones.armF2.rotation": number[][];
366
+ "bones.legF1.rotation": number[][];
367
+ "bones.legF2.rotation": number[][];
368
+ "bones.legB1.rotation": number[][];
369
+ "bones.legB2.rotation": number[][];
370
+ "bones.footF.rotation": number[][];
371
+ "bones.footB.rotation": number[][];
372
+ };
373
+ };
374
+ };
375
+ export declare const blinkAndBreathe: (period?: number) => ({
376
+ type: string;
377
+ id: string;
378
+ part: string;
379
+ open: string;
380
+ closed: string;
381
+ interval: number[];
382
+ duration: number;
383
+ bone?: undefined;
384
+ amount?: undefined;
385
+ period?: undefined;
386
+ } | {
387
+ part?: undefined;
388
+ open?: undefined;
389
+ closed?: undefined;
390
+ interval?: undefined;
391
+ duration?: undefined;
392
+ type: string;
393
+ id: string;
394
+ bone: string;
395
+ amount: number;
396
+ period: number;
397
+ })[];
398
+ /** Emotion poses shared by the cast (mouth/brow morph weights, eye variants, head tilt). */
399
+ export declare const emotions: (extra?: Record<string, Record<string, unknown>>) => {
400
+ type: "pose";
401
+ poses: {
402
+ neutral: {
403
+ "parts.eyes.variant": string;
404
+ };
405
+ sleep: {
406
+ "parts.eyes.variant": string;
407
+ "parts.mouth.morph.smile": number;
408
+ "bones.head.rotation": number;
409
+ };
410
+ happy: {
411
+ "parts.eyes.variant": string;
412
+ "parts.mouth.morph.smile": number;
413
+ "parts.brows.morph.up": number;
414
+ "bones.head.rotation": number;
415
+ };
416
+ joy: {
417
+ "parts.eyes.variant": string;
418
+ "parts.mouth.morph.grin": number;
419
+ "parts.brows.morph.up": number;
420
+ "bones.head.rotation": number;
421
+ };
422
+ surprised: {
423
+ "parts.eyes.variant": string;
424
+ "parts.mouth.morph.E": number;
425
+ "parts.brows.morph.up": number;
426
+ "bones.head.rotation": number;
427
+ };
428
+ sad: {
429
+ "parts.eyes.variant": string;
430
+ "parts.mouth.morph.frown": number;
431
+ "parts.brows.morph.sad": number;
432
+ "bones.head.rotation": number;
433
+ };
434
+ smug: {
435
+ "parts.eyes.variant": string;
436
+ "parts.mouth.morph.smile": number;
437
+ "parts.brows.morph.smug": number;
438
+ "bones.head.rotation": number;
439
+ };
440
+ scared: {
441
+ "parts.eyes.variant": string;
442
+ "parts.mouth.morph.frown": number;
443
+ "parts.brows.morph.sad": number;
444
+ };
445
+ angry: {
446
+ "parts.eyes.variant": string;
447
+ "parts.mouth.morph.frown": number;
448
+ "parts.brows.morph.cross": number;
449
+ "bones.head.rotation": number;
450
+ };
451
+ };
452
+ };
453
+ export declare const eyeSwitch: (bone: string) => {
454
+ id: string;
455
+ type: string;
456
+ bone: string;
457
+ variants: {
458
+ open: string;
459
+ wide: string;
460
+ closed: string;
461
+ happy: string;
462
+ half: string;
463
+ };
464
+ default: string;
465
+ };
466
+ /**
467
+ * Hand-drawn timing for gesture clips (traditional animation): **anticipation** — a small move the
468
+ * other way before a big one — and **overshoot** — past the pose, then settling back. Applied to
469
+ * bone rotations that change by at least `min` degrees; loops (walk, run, idle, talk…), the
470
+ * `turn` squeeze and the knock-down clips (`knockDownClips`: a hit is a surprise, and their motion is
471
+ * timed by the fall's physics, not acted) are left alone. The splines through the keys keep
472
+ * everything smooth.
473
+ */
474
+ export declare function fluid<T extends Record<string, unknown>>(clips: T, o?: {
475
+ anticipation?: number;
476
+ overshoot?: number;
477
+ min?: number;
478
+ }): T;
479
+ /**
480
+ * Inside of a `mouthShapes` mouth, with the same shape names (they morph together): the upper
481
+ * `teeth` (a white band under the top lip) and the `tongue` (at the bottom). Hidden when closed.
482
+ */
483
+ export declare function mouthInside(L: P, R: P, scale?: number, style?: MouthStyle): {
484
+ teeth: {
485
+ base: string;
486
+ shapes: {
487
+ [k: string]: string;
488
+ };
489
+ };
490
+ tongue: {
491
+ base: string;
492
+ shapes: {
493
+ [k: string]: string;
494
+ };
495
+ };
496
+ };
497
+ /**
498
+ * A cartoon **gape** (a jaw dropped to swallow something whole, a scream, a big yawn) as the three
499
+ * paths of a mouth wide open, in the same commands as `mouthShapes`/`mouthInside` (two curves: they
500
+ * morph with them): the `mouth` from corner `l` over the top lip (its middle at height `top`) to
501
+ * corner `rr`, back under a round lower edge (its lowest point at `bottom`, bulging `out` past the
502
+ * corners); the upper `teeth`, a row along the top lip (`teeth` deep in the middle); the `tongue`
503
+ * low, a mound on the bottom. Draw the inside dark (the mouth's fill); the lower teeth stay hidden.
504
+ */
505
+ export declare function gapeMouth(l: P, rr: P, top: number, bottom: number, o?: {
506
+ out?: number;
507
+ teeth?: number;
508
+ }): {
509
+ mouth: string;
510
+ teeth: string;
511
+ tongue: string;
512
+ };
513
+ /**
514
+ * A morph shape that reaches `target` at weight `at` (default 2) from `base` — a morph is linear
515
+ * (`base + w·(shape − base)`), so the shape is the point `1/at` of the way: weight 1 is a gape,
516
+ * weight 2 the unhinged jaw, every weight in between a shape between them. Both paths must have the
517
+ * same segments once made cubic (the same commands, or `Q` against `C`).
518
+ */
519
+ export declare function morphTowards(base: string, target: string, at?: number): string;
520
+ export declare function cartoonHands(at: P, o: {
521
+ r: number;
522
+ fill: string;
523
+ line?: string;
524
+ stroke?: number;
525
+ dir?: number;
526
+ shade?: string;
527
+ detail?: number;
528
+ merged?: boolean;
529
+ wrist?: number;
530
+ cuff?: boolean;
531
+ mirror?: boolean;
532
+ }): {
533
+ open: string;
534
+ fist: string;
535
+ point: string;
536
+ grip: string;
537
+ };
538
+ //# sourceMappingURL=rig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rig.d.ts","sourceRoot":"","sources":["../src/rig.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3D,eAAO,MAAM,CAAC,MAAO,MAAM,WAA8B,CAAC;AAI1D;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAAG,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;AAClE,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAE,UAAe,GAAG,MAAM,CAS5G;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,SAAI,EAAE,KAAK,GAAE,UAAe;IAGrE,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