@algorisys/tinyfly 0.102.0 → 0.104.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/README.md +22 -5
- package/docs/DEPLOYMENT.md +2 -0
- package/docs/api-reference.md +61 -0
- package/docs/character-appearance.md +38 -1
- package/docs/dance.md +150 -1
- package/docs/editor-guide.md +16 -4
- package/docs/examples.md +31 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +37 -2
- package/docs/maps.md +2 -2
- package/docs/scene-3d.md +21 -1
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +4546 -4146
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +6004 -5604
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/types/characters/capabilities.d.ts +3 -0
- package/lib/types/characters/cast.d.ts +536 -2
- package/lib/types/characters/character-script-3d.d.ts +14 -4
- package/lib/types/characters/dance-circle.d.ts +59 -0
- package/lib/types/characters/dance-contact.d.ts +52 -0
- package/lib/types/characters/head/face.d.ts +8 -0
- package/lib/types/characters/human-dance.d.ts +86 -0
- package/lib/types/characters/index.d.ts +5 -1
- package/lib/types/characters/rig/reach.d.ts +6 -3
- package/llms-full.txt +366 -18
- package/llms.txt +29 -29
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +35 -1
- package/lib/types/characters/polyline.d.ts +0 -12
- package/lib/types/characters/sketch.d.ts +0 -54
- package/lib/types/compat/gsap/playhead-crossings.d.ts +0 -47
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Character } from './character';
|
|
2
|
+
import type { Pose, Vec3 } from './rig/body-plan';
|
|
3
|
+
/** Position and height use the same units (pixels in 2D, metres in a 3D scene). */
|
|
4
|
+
export interface DancePartner {
|
|
5
|
+
character: Character;
|
|
6
|
+
pose: Pose;
|
|
7
|
+
position: Vec3;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A joint in world space, with pose.turn (quarter-turns), roll, ground contact
|
|
11
|
+
* and position applied. Scene object rotations are not read. Index 2 is the
|
|
12
|
+
* wrist/ankle, and leg index 3 is the toe.
|
|
13
|
+
*/
|
|
14
|
+
export declare function danceJoint(partner: DancePartner, chain: string, joint: number): Vec3;
|
|
15
|
+
export interface DanceFootPlant extends DancePartner {
|
|
16
|
+
/** Joint error is less than 0.002 times the character height. */
|
|
17
|
+
reached: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Keep one ankle or toe at a world point while the body travels or turns.
|
|
21
|
+
* Apply the returned position as well as the pose: its y correction carries
|
|
22
|
+
* weight onto the supporting leg. An unreachable target is reported, never
|
|
23
|
+
* hidden by translating the body sideways.
|
|
24
|
+
*/
|
|
25
|
+
export declare function plantDanceFoot(partner: DancePartner, side: 'left' | 'right', target: Vec3, point?: 'ankle' | 'toe'): DanceFootPlant;
|
|
26
|
+
export interface DandiyaStick {
|
|
27
|
+
grip: Vec3;
|
|
28
|
+
tip: Vec3;
|
|
29
|
+
}
|
|
30
|
+
export interface DandiyaMeeting {
|
|
31
|
+
/** Solved poses for the two partners; positions are unchanged. */
|
|
32
|
+
a: Pose;
|
|
33
|
+
b: Pose;
|
|
34
|
+
sticks: [DandiyaStick, DandiyaStick];
|
|
35
|
+
point: Vec3;
|
|
36
|
+
/** Both tips are within 0.002 times the shorter height of point. */
|
|
37
|
+
reached: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Both sticks reach one shared 3D strike point. Stick length defaults to
|
|
41
|
+
* 0.22 of the shorter dancer's height; the point defaults to chest height
|
|
42
|
+
* between them. Draw the returned grip→tip segments with each arm's depth.
|
|
43
|
+
* Call on strike frames, or blend its poses with recovery poses between hits.
|
|
44
|
+
* Both selected hands default to right and use the hold shape. Inspect
|
|
45
|
+
* reached before applying a solve: unreachable tips are not snapped to point.
|
|
46
|
+
*/
|
|
47
|
+
export declare function meetDandiya(a: DancePartner, b: DancePartner, options?: {
|
|
48
|
+
sideA?: 'left' | 'right';
|
|
49
|
+
sideB?: 'left' | 'right';
|
|
50
|
+
point?: Vec3;
|
|
51
|
+
length?: number;
|
|
52
|
+
}): DandiyaMeeting;
|
|
@@ -23,6 +23,14 @@ export interface PupilCircle {
|
|
|
23
23
|
}
|
|
24
24
|
/** What an open mouth shows: a row of upper teeth, and a tongue (default neither, as the plain face); a nose; what is in the pupils. */
|
|
25
25
|
export interface FaceOptions {
|
|
26
|
+
/** `simple` (default) or colour anime eyes with irises, highlights and expressive lids. Uses the same pose fields. */
|
|
27
|
+
style?: 'simple' | 'anime';
|
|
28
|
+
/** Anime iris colour (default blue); plain data, including in scene JSON. */
|
|
29
|
+
iris?: string;
|
|
30
|
+
/** Anime outer lashes (default true). */
|
|
31
|
+
lashes?: boolean;
|
|
32
|
+
/** Subtle eye and smile creases, 0..1 (default 0); independent of expression and posture. */
|
|
33
|
+
ageLines?: number;
|
|
26
34
|
teeth?: boolean;
|
|
27
35
|
tongue?: boolean;
|
|
28
36
|
/** A small nose between the eyes and the mouth (default none) */
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Pose } from './rig/body-plan';
|
|
2
|
+
import type { Track } from '../engine/types';
|
|
3
|
+
/**
|
|
4
|
+
* Native, body-local dance keys. Heading belongs to the caller, not the clip.
|
|
5
|
+
* Foot plants assume left/right alternation each integer beat, starting left,
|
|
6
|
+
* with stance through 0.6 of the beat. Custom footwork that changes that
|
|
7
|
+
* pattern should use danceCircleAt with plantFeet: false and supply its own contacts.
|
|
8
|
+
*/
|
|
9
|
+
export interface HumanDanceStyle {
|
|
10
|
+
label: string;
|
|
11
|
+
bpm: number;
|
|
12
|
+
beats: number;
|
|
13
|
+
keys: Array<{
|
|
14
|
+
beat: number;
|
|
15
|
+
pose: Pose;
|
|
16
|
+
}>;
|
|
17
|
+
/** Claps or stick strikes, in beats from the start of the loop. */
|
|
18
|
+
strikes: number[];
|
|
19
|
+
}
|
|
20
|
+
export interface HumanDanceFrame {
|
|
21
|
+
pose: Pose;
|
|
22
|
+
/** Alternating support side and absolute integer planting beat; weight is 1 through phase 0.6, then fades to 0. */
|
|
23
|
+
contact: {
|
|
24
|
+
side: 'left' | 'right';
|
|
25
|
+
start: number;
|
|
26
|
+
weight: number;
|
|
27
|
+
};
|
|
28
|
+
/** 1 on a strike, fading to 0 a quarter beat either side. */
|
|
29
|
+
strike: number;
|
|
30
|
+
}
|
|
31
|
+
/** Simple stylised routines, editable as JSON; not a motion-capture recording. */
|
|
32
|
+
export declare const HUMAN_DANCES: {
|
|
33
|
+
garba: {
|
|
34
|
+
label: string;
|
|
35
|
+
bpm: number;
|
|
36
|
+
beats: number;
|
|
37
|
+
strikes: number[];
|
|
38
|
+
keys: {
|
|
39
|
+
beat: number;
|
|
40
|
+
pose: Pose;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
garbaThreeClap: {
|
|
44
|
+
label: string;
|
|
45
|
+
bpm: number;
|
|
46
|
+
beats: number;
|
|
47
|
+
strikes: number[];
|
|
48
|
+
keys: {
|
|
49
|
+
beat: number;
|
|
50
|
+
pose: Pose;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
dandiya: {
|
|
54
|
+
label: string;
|
|
55
|
+
bpm: number;
|
|
56
|
+
beats: number;
|
|
57
|
+
strikes: number[];
|
|
58
|
+
keys: {
|
|
59
|
+
beat: number;
|
|
60
|
+
pose: Pose;
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type HumanDanceName = keyof typeof HUMAN_DANCES;
|
|
65
|
+
/** Random-access evaluation: turning never changes the authored local limb motion. */
|
|
66
|
+
export declare function humanDanceFrame(style: HumanDanceName | HumanDanceStyle, beat: number, base?: Pose): HumanDanceFrame;
|
|
67
|
+
export interface HumanDanceTrackOptions {
|
|
68
|
+
/** A native name or custom JSON routine. */
|
|
69
|
+
style: HumanDanceName | HumanDanceStyle;
|
|
70
|
+
/** Beats per minute; default the style's tempo. Positive and finite. */
|
|
71
|
+
bpm?: number;
|
|
72
|
+
/** Length from beat 0; default one routine. Positive and finite. */
|
|
73
|
+
beats?: number;
|
|
74
|
+
/** Start time in milliseconds, default 0; finite. */
|
|
75
|
+
start?: number;
|
|
76
|
+
/** Base pose, default HUMAN_REST; use the same pose on the rendered target. */
|
|
77
|
+
pose?: Pose;
|
|
78
|
+
/** Sampling density, default 16; positive and finite. */
|
|
79
|
+
samplesPerBeat?: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Ordinary linear JSON pose tracks, including hands; view/roll remain
|
|
83
|
+
* independently animated. Unchanged base/rest fields are omitted. Between
|
|
84
|
+
* samples, linear playback approximates the smoothly evaluated frame.
|
|
85
|
+
*/
|
|
86
|
+
export declare function humanDanceTracks(target: string, options: HumanDanceTrackOptions): Track[];
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export * from './stick-figure';
|
|
8
8
|
export * from './dance';
|
|
9
|
+
export * from './human-dance';
|
|
10
|
+
export * from './dance-circle';
|
|
11
|
+
export * from './dance-contact';
|
|
9
12
|
export * from './gaits';
|
|
10
13
|
export * from './acrobatics';
|
|
11
14
|
export { stickToHuman } from './stick-to-human';
|
|
@@ -25,7 +28,8 @@ export * from '../adapters/canvas/polyline';
|
|
|
25
28
|
export * from './hand';
|
|
26
29
|
export * from './character';
|
|
27
30
|
export { humanPlan, humanPose, mirrorHumanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, HUMAN_BUILDS, FOOT_SHAPES, type FootShape, type HumanBuild, type HumanBuildName, type HumanPoseName, type HumanExpressionName } from './species/human';
|
|
28
|
-
export { CHARACTER_CAST, castMember, type CastMember, type CastName } from './cast';
|
|
31
|
+
export { CHARACTER_CAST, ANIME_CAST, castMember, type CastMember, type CastName, type AnimeCastName } from './cast';
|
|
32
|
+
export type { FaceOptions, PupilCircle } from './head/face';
|
|
29
33
|
export { meetHands, meetingSpacing, HAND_MEETINGS, embrace, embraceSpacing, EMBRACE, helpUp, helpUpSpacing, HELP_UP, type HandMeeting, type HandsMeet, type MeetingPartner, type MeetHandsOptions, type Embrace, type EmbraceOptions, type HelpUp, type HelpUpOptions } from './interactions';
|
|
30
34
|
export * from './species/human-motion';
|
|
31
35
|
export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { BodyPlan, Pose, Vec3 } from './body-plan';
|
|
2
2
|
export interface ReachOptions {
|
|
3
|
-
/**
|
|
3
|
+
/** Character height in the same units as target (pixels or scene metres). */
|
|
4
4
|
height: number;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* The pose with chain `chainId` reaching for `target`, a point in the
|
|
8
|
-
* character's 3D space in
|
|
9
|
-
*
|
|
8
|
+
* character's unplaced 3D space, in the same units as height (+x its left,
|
|
9
|
+
* +y up, +z forward). Body turn, roll, lift and grounding are excluded from
|
|
10
|
+
* the solve. The chain must hang down at rest (arms, legs). Authored bone
|
|
11
|
+
* yaw, including human hip turn-out, is retained; reaching the existing
|
|
12
|
+
* endpoint returns the original pose, including a straight limb at full reach.
|
|
10
13
|
*/
|
|
11
14
|
export declare function reachPose(plan: BodyPlan, pose: Pose, chainId: string, target: Vec3, options: ReachOptions): Pose;
|