@algorisys/tinyfly 0.107.1 → 0.108.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 +17 -12
- package/docs/character-appearance.md +148 -0
- package/docs/editor-guide.md +1 -1
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +35 -0
- package/docs/maps.md +2 -2
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +5469 -4932
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +6742 -6205
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/types/characters/body/organic-body.d.ts +56 -0
- package/lib/types/characters/body/organic-draw.d.ts +5 -0
- package/lib/types/characters/body/organic-geometry.d.ts +25 -0
- package/lib/types/characters/capabilities.d.ts +2 -0
- package/lib/types/characters/character.d.ts +15 -2
- package/lib/types/characters/hands/draw-cartoon-hand.d.ts +4 -0
- package/lib/types/characters/head/face.d.ts +6 -4
- package/lib/types/characters/head/facial-hair.d.ts +2 -0
- package/lib/types/characters/head/glasses.d.ts +2 -0
- package/lib/types/characters/head/head-look.d.ts +4 -2
- package/lib/types/characters/head/head-shape.d.ts +4 -0
- package/lib/types/characters/index.d.ts +5 -0
- package/lib/types/characters/look/pen.d.ts +1 -0
- package/lib/types/characters/look/skin-shading.d.ts +4 -0
- package/lib/types/characters/rig/skeleton.d.ts +2 -0
- package/lib/types/characters/soft-cartoon-cast.d.ts +166 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +5 -1
- package/lib/types/characters/wardrobe/leaf-outfit.d.ts +18 -0
- package/lib/types/characters/wardrobe/outfit-preset.d.ts +6 -0
- package/llms-full.txt +199 -9
- package/llms.txt +29 -29
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +30 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** A contour's half-width as a share of character height, at 0..1 along it. */
|
|
2
|
+
export interface BodyProfilePoint {
|
|
3
|
+
at: number;
|
|
4
|
+
width: number;
|
|
5
|
+
}
|
|
6
|
+
/** Screen-space light; geometry and shading stay deterministic at any time. */
|
|
7
|
+
export interface SkinShading {
|
|
8
|
+
mode: 'none' | 'cel';
|
|
9
|
+
light: [number, number];
|
|
10
|
+
shadow: string;
|
|
11
|
+
opacity: number;
|
|
12
|
+
highlight: number;
|
|
13
|
+
}
|
|
14
|
+
export interface OrganicBodyOptions {
|
|
15
|
+
/** Hip to neck: hips, waist, chest and shoulders. */
|
|
16
|
+
torso?: BodyProfilePoint[];
|
|
17
|
+
/** Shoulder to wrist: upper arm, elbow, forearm and wrist. */
|
|
18
|
+
arm?: BodyProfilePoint[];
|
|
19
|
+
/** Hip to ankle: thigh, knee, calf and ankle. */
|
|
20
|
+
leg?: BodyProfilePoint[];
|
|
21
|
+
neck?: BodyProfilePoint[];
|
|
22
|
+
/** Side thickness relative to front width, 0.2..1 (default 0.55). */
|
|
23
|
+
depth?: number;
|
|
24
|
+
/** Shared exposed skin colour, including face and hands. Defaults to `skin`. */
|
|
25
|
+
fill?: string;
|
|
26
|
+
/** Independent contour settings. Defaults to the character's ink/lineWidth. */
|
|
27
|
+
outline?: {
|
|
28
|
+
color?: string;
|
|
29
|
+
width?: number;
|
|
30
|
+
};
|
|
31
|
+
shading?: Partial<SkinShading>;
|
|
32
|
+
}
|
|
33
|
+
/** Resolved, owned JSON data. Profiles are copied once when making a character. */
|
|
34
|
+
export interface OrganicBody {
|
|
35
|
+
torso: BodyProfilePoint[];
|
|
36
|
+
arm: BodyProfilePoint[];
|
|
37
|
+
leg: BodyProfilePoint[];
|
|
38
|
+
neck: BodyProfilePoint[];
|
|
39
|
+
depth: number;
|
|
40
|
+
fill: string;
|
|
41
|
+
outline: {
|
|
42
|
+
color: string;
|
|
43
|
+
width: number;
|
|
44
|
+
};
|
|
45
|
+
shading: SkinShading;
|
|
46
|
+
}
|
|
47
|
+
/** Resolve body data without a canvas, UI, clock or mutable global state. */
|
|
48
|
+
export declare function resolveOrganicBody(options: OrganicBodyOptions, defaults: {
|
|
49
|
+
skin: string;
|
|
50
|
+
ink: string;
|
|
51
|
+
lineWidth: number;
|
|
52
|
+
shoulderWidth: number;
|
|
53
|
+
hipWidth: number;
|
|
54
|
+
}): OrganicBody;
|
|
55
|
+
/** Smooth bounded width interpolation; anatomy never depends on outline width. */
|
|
56
|
+
export declare function bodyProfileWidth(profile: BodyProfilePoint[], at: number): number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CharacterJoints } from '../character';
|
|
2
|
+
import { type Pen } from '../look/pen';
|
|
3
|
+
import type { OrganicBody } from './organic-body';
|
|
4
|
+
/** One part at its native depth; no foreground whole-body overlay. */
|
|
5
|
+
export declare function drawOrganicPart(ctx: CanvasRenderingContext2D, pen: Pen, body: OrganicBody, joints: CharacterJoints, id: string): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
|
+
import type { CharacterJoints } from '../character';
|
|
3
|
+
import type { BodyPlan } from '../rig/body-plan';
|
|
4
|
+
import { type OrganicBody } from './organic-body';
|
|
5
|
+
export interface OrganicSample {
|
|
6
|
+
center: Point;
|
|
7
|
+
left: Point;
|
|
8
|
+
right: Point;
|
|
9
|
+
width: number;
|
|
10
|
+
at: number;
|
|
11
|
+
}
|
|
12
|
+
export interface OrganicContour {
|
|
13
|
+
outline: Point[];
|
|
14
|
+
samples: OrganicSample[];
|
|
15
|
+
/** Normalized position for each outline vertex, for attachment seam removal. */
|
|
16
|
+
positions: number[];
|
|
17
|
+
}
|
|
18
|
+
export type OrganicBodyContours = Record<string, OrganicContour>;
|
|
19
|
+
/** Cubic centerlines pass through the actual joints with a continuous tangent. */
|
|
20
|
+
export declare function organicCenterLine(points: Point[], steps?: number): Point[];
|
|
21
|
+
/** Pose-dependent plain geometry, shared by rendering, layers and exporters. */
|
|
22
|
+
export declare function organicBodyContours(body: OrganicBody, joints: CharacterJoints, plan: BodyPlan): OrganicBodyContours;
|
|
23
|
+
export declare function insideBodyContour(point: Point, outline: Point[]): boolean;
|
|
24
|
+
/** Cloth follows the same curved anatomy, with room independent of its ink. */
|
|
25
|
+
export declare function organicContourSection(shape: OrganicContour, from: number, to: number, padding?: number): Point[];
|
|
@@ -5,11 +5,14 @@ import type { FrameInfo } from '../headless/video-scene';
|
|
|
5
5
|
import type { BodyPlan, Pose, Vec3 } from './rig/body-plan';
|
|
6
6
|
import { type SolvedHead, type ViewProjection } from './rig/skeleton';
|
|
7
7
|
import { type Look, type Pen, type PencilOptions } from './look/pen';
|
|
8
|
+
import { type OrganicBody, type OrganicBodyOptions } from './body/organic-body';
|
|
9
|
+
import { type OrganicBodyContours } from './body/organic-geometry';
|
|
8
10
|
import { type FaceOptions } from './head/face';
|
|
9
11
|
import { type HeadLook, type HeadLookOptions } from './head/head-look';
|
|
10
12
|
import { type HumanBuildName, type HumanPoseName, type FootShape } from './species/human';
|
|
11
13
|
import type { Gait } from './gaits';
|
|
12
14
|
import { type BasicOutfitOptions } from './wardrobe/basic-outfit';
|
|
15
|
+
import { type LeafOutfitOptions } from './wardrobe/leaf-outfit';
|
|
13
16
|
import { type Holding, type HoldingSpec } from './hands/held-items';
|
|
14
17
|
import { type HandPose } from './hands/hand-rig';
|
|
15
18
|
/**
|
|
@@ -19,8 +22,8 @@ import { type HandPose } from './hands/hand-rig';
|
|
|
19
22
|
* The v1 stick figure (`stickFigureTarget`, `drawStickFigure`) is separate
|
|
20
23
|
* and unchanged. See docs/character-system-m1.md.
|
|
21
24
|
*/
|
|
22
|
-
/** `stick`:
|
|
23
|
-
export type FigureStyle = 'fluid' | 'stick';
|
|
25
|
+
/** `stick`: traditional stick figure; `fluid`: tapered limbs; `organic`: filled cartoon anatomy. */
|
|
26
|
+
export type FigureStyle = 'fluid' | 'stick' | 'organic';
|
|
24
27
|
/**
|
|
25
28
|
* Draws part of a character: clothes, hair, a prop. The context is in the
|
|
26
29
|
* character's drawing space (feet at 0, 0), saved and restored around the
|
|
@@ -52,9 +55,13 @@ export interface CharacterOptions extends HeadLookOptions {
|
|
|
52
55
|
armLength?: number;
|
|
53
56
|
/** A T-shirt and trousers in these colours (see basicOutfit), as data; drawn under any `layers` */
|
|
54
57
|
outfit?: BasicOutfitOptions | null;
|
|
58
|
+
/** Rounded leaf top/skirt, as JSON data; requires `figure: 'organic'`. */
|
|
59
|
+
leafOutfit?: LeafOutfitOptions | null;
|
|
55
60
|
/** What each hand holds (`{ right: 'mug' }`, `{ both: 'parcel' }`); a pose field `held.<side>` below 0.5 lets go */
|
|
56
61
|
holding?: HoldingSpec | null;
|
|
57
62
|
figure?: FigureStyle;
|
|
63
|
+
/** Opt-in organic contours, skin material and independent outline settings. */
|
|
64
|
+
body?: OrganicBodyOptions;
|
|
58
65
|
look?: Look;
|
|
59
66
|
/** Feet to top of head, px (default 300) */
|
|
60
67
|
height?: number;
|
|
@@ -102,6 +109,7 @@ export interface CharacterOptions extends HeadLookOptions {
|
|
|
102
109
|
export interface Character {
|
|
103
110
|
plan: BodyPlan;
|
|
104
111
|
figure: FigureStyle;
|
|
112
|
+
body?: OrganicBody;
|
|
105
113
|
look: Look;
|
|
106
114
|
height: number;
|
|
107
115
|
lineWidth: number;
|
|
@@ -127,9 +135,13 @@ export interface Character {
|
|
|
127
135
|
export declare function character(options?: CharacterOptions): Character;
|
|
128
136
|
/** Where every part of a character is, as drawn, in its drawing space (feet at 0, 0; up is -y). */
|
|
129
137
|
export interface CharacterJoints {
|
|
138
|
+
/** Organic pose geometry, in drawing coordinates; omitted for existing modes. */
|
|
139
|
+
bodyContours?: OrganicBodyContours;
|
|
130
140
|
height: number;
|
|
131
141
|
lineWidth: number;
|
|
132
142
|
turn: number;
|
|
143
|
+
/** Body forward axis in camera view space, independent of head turns; omitted in flat drawings. */
|
|
144
|
+
bodyForward?: Vec3;
|
|
133
145
|
/** Named points: `hip`, `neck`, `shoulder.left`, `hand.right`, `knee.left`, `toe.right`… */
|
|
134
146
|
points: Record<string, Point>;
|
|
135
147
|
/** Every chain's joints */
|
|
@@ -191,6 +203,7 @@ export interface CharacterPartInView {
|
|
|
191
203
|
part: string;
|
|
192
204
|
/** Its depth in the view, in the projection's units, nearer is larger (metres in a 3D scene) */
|
|
193
205
|
depth: number;
|
|
206
|
+
sortDepth?: number;
|
|
194
207
|
/** Draws it; `time` (ms) is the pencil's boil frame and the layer hooks' time */
|
|
195
208
|
draw(ctx: CanvasRenderingContext2D, time?: number): void;
|
|
196
209
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
2
|
import { type Look, type Pen, type PencilOptions } from '../look/pen';
|
|
3
3
|
import { type HandJoints, type HandPose, type HandRigStyle } from './hand-rig';
|
|
4
|
+
import type { SkinShading } from '../body/organic-body';
|
|
4
5
|
/**
|
|
5
6
|
* Drawing a posed hand: the palm and each finger are parts, drawn far to near
|
|
6
7
|
* through a {@link Pen}, so a hand matches any look (clean, pencil,
|
|
7
8
|
* silhouette) and boils with a pencil figure.
|
|
8
9
|
*/
|
|
9
10
|
export interface CartoonHandStyle extends HandRigStyle {
|
|
11
|
+
/** Join a native forearm without outlining the wrist's interior edge. */
|
|
12
|
+
connected?: boolean;
|
|
13
|
+
shading?: SkinShading;
|
|
10
14
|
/** Skin fill (default a warm tan); a glove is just another colour */
|
|
11
15
|
skin?: string;
|
|
12
16
|
/** Outline colour (default graphite) */
|
|
@@ -6,11 +6,11 @@ import type { Pen } from '../look/pen';
|
|
|
6
6
|
* Face coordinates to the screen. Cartoon faces slide less than a sphere
|
|
7
7
|
* would: the whole face shifts toward the side the head faces, the spacing of
|
|
8
8
|
* features narrows (to a minimum) and each feature's own shape narrows less, so
|
|
9
|
-
* a profile still shows an eye and a mouth inside the head.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* a profile still shows an eye and a mouth inside the head. Volume projection
|
|
10
|
+
* carries centres around the head and keeps the far eye through three-quarter
|
|
11
|
+
* views. Surface facing hides rear features; the far eye narrows to profile.
|
|
12
12
|
*/
|
|
13
|
-
export declare function faceToScreen(head: SolvedHead, points: Point[], centre: Point): {
|
|
13
|
+
export declare function faceToScreen(head: SolvedHead, points: Point[], centre: Point, projection?: FaceOptions['projection']): {
|
|
14
14
|
points: Point[];
|
|
15
15
|
facing: number;
|
|
16
16
|
};
|
|
@@ -23,6 +23,8 @@ 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
|
+
/** `cartoon` keeps the classic face slide; `volume` follows the head's 3D axes (organic default). */
|
|
27
|
+
projection?: 'cartoon' | 'volume';
|
|
26
28
|
/** `simple` (default) or colour anime eyes with irises, highlights and expressive lids. Uses the same pose fields. */
|
|
27
29
|
style?: 'simple' | 'anime';
|
|
28
30
|
/** Anime iris colour (default blue); plain data, including in scene JSON. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
2
|
import type { SolvedHead } from '../rig/skeleton';
|
|
3
3
|
import type { Pen } from '../look/pen';
|
|
4
|
+
import { type FaceOptions } from './face';
|
|
4
5
|
import { type ShellRegion } from './shell';
|
|
5
6
|
/**
|
|
6
7
|
* Facial hair: a moustache and a beard, chosen separately. A beard is a
|
|
@@ -108,6 +109,7 @@ export type FacialHairStyleName = keyof typeof FACIAL_HAIR_STYLES;
|
|
|
108
109
|
export declare function resolveFacialHair(spec: FacialHairSpec | FacialHairStyleName, hairColor?: string): FacialHair;
|
|
109
110
|
export declare function beardRegion(style: BeardStyle, pad: number): ShellRegion | null;
|
|
110
111
|
export interface FacialHairDrawOptions {
|
|
112
|
+
face?: FaceOptions;
|
|
111
113
|
headOutline?: Point[];
|
|
112
114
|
lineWidth: number;
|
|
113
115
|
skin: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SolvedHead } from '../rig/skeleton';
|
|
2
2
|
import type { Pen } from '../look/pen';
|
|
3
|
+
import { type FaceOptions } from './face';
|
|
3
4
|
/**
|
|
4
5
|
* Glasses: a lens round each eye, a bridge between them, and the arms back
|
|
5
6
|
* to the ears. Lenses are placed like the eyes (they slide round with the
|
|
@@ -19,6 +20,7 @@ export declare const GLASSES_STYLES: {
|
|
|
19
20
|
};
|
|
20
21
|
export declare function resolveGlasses(spec: GlassesSpec | GlassesStyle): Glasses;
|
|
21
22
|
export interface GlassesDrawOptions {
|
|
23
|
+
face?: FaceOptions;
|
|
22
24
|
lineWidth: number;
|
|
23
25
|
}
|
|
24
26
|
export declare function drawGlasses(pen: Pen, head: SolvedHead, glasses: Glasses, options: GlassesDrawOptions): void;
|
|
@@ -19,8 +19,8 @@ import { type Hat, type HatSpec, type HatStyle } from './hats';
|
|
|
19
19
|
* - over: after the whole body, the hair and hat when the head is turned
|
|
20
20
|
* away, since they are then the nearest things to the viewer.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* Classic eyes and brows draw over a fringe; filled organic heads draw
|
|
23
|
+
* their face under opaque hair instead. The mouth draws over a beard (which leaves an
|
|
24
24
|
* opening for it), a moustache over the mouth's top, and a hat over the hair.
|
|
25
25
|
*
|
|
26
26
|
* Hanging hair lags behind the head by the pose's `hair.swing`, `hair.trail`
|
|
@@ -48,6 +48,8 @@ export interface HeadLook {
|
|
|
48
48
|
export declare function resolveHeadLook(options: HeadLookOptions): HeadLook;
|
|
49
49
|
export interface HeadDrawOptions {
|
|
50
50
|
face?: FaceOptions;
|
|
51
|
+
/** Filled cartoon heads let opaque bangs and side locks cover the face. */
|
|
52
|
+
faceUnderHair?: boolean;
|
|
51
53
|
lineWidth: number;
|
|
52
54
|
skin: string;
|
|
53
55
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
2
|
import { type SolvedHead } from '../rig/skeleton';
|
|
3
3
|
import type { FaceOptions } from './face';
|
|
4
|
+
/** A bridge, forward tip and lower return anchored above the mouth. */
|
|
5
|
+
export declare function nosePoints(head: SolvedHead): Point[];
|
|
6
|
+
/** Filled cartoon heads have a small forward nose in their turned silhouette. */
|
|
7
|
+
export declare function headOutline(head: SolvedHead, face: FaceOptions): Point[];
|
|
4
8
|
/** Project a tapered 3D head, then take its silhouette: the jaw follows turn, nod and roll. */
|
|
5
9
|
export declare function angularHeadOutline(head: SolvedHead, face: FaceOptions): Point[];
|
|
6
10
|
/** Monotone chain. Dropping interior points preserves sharp jaw corners at any view. */
|
|
@@ -27,6 +27,10 @@ export * from './surface';
|
|
|
27
27
|
export * from '../adapters/canvas/polyline';
|
|
28
28
|
export * from './hand';
|
|
29
29
|
export * from './character';
|
|
30
|
+
export { leafOutfit, leafOutfitContours, type LeafOutfitOptions, type LeafOutfitContours } from './wardrobe/leaf-outfit';
|
|
31
|
+
export { softCartoonCharacter, SOFT_CARTOON_CAST, type SoftCartoonName } from './soft-cartoon-cast';
|
|
32
|
+
export { resolveOrganicBody, bodyProfileWidth, type OrganicBody, type OrganicBodyOptions, type BodyProfilePoint, type SkinShading } from './body/organic-body';
|
|
33
|
+
export { organicBodyContours, organicCenterLine, type OrganicBodyContours, type OrganicContour, type OrganicSample } from './body/organic-geometry';
|
|
30
34
|
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';
|
|
31
35
|
export { CHARACTER_CAST, ANIME_CAST, MANGA_CAST, castMember, type CastMember, type CastName, type AnimeCastName, type MangaCastName } from './cast';
|
|
32
36
|
export type { FaceOptions, PupilCircle } from './head/face';
|
|
@@ -35,6 +39,7 @@ export * from './species/human-motion';
|
|
|
35
39
|
export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
|
|
36
40
|
export { createPen, ellipsePoints, type Pen, type Look, type PencilOptions, type PenOptions } from './look/pen';
|
|
37
41
|
export { basicOutfit, type BasicOutfitOptions } from './wardrobe/basic-outfit';
|
|
42
|
+
export { outfitPreset, OUTFIT_PRESETS, type OutfitCategory } from './wardrobe/outfit-preset';
|
|
38
43
|
export * from './head';
|
|
39
44
|
export { hairFollow, hairFollowTracks, hairMotionAt, type HairFollowSample, type HairFollowOptions, type HairFollowKey, type HairFollowTrackOptions } from './hair-follow';
|
|
40
45
|
export * from './hands';
|
|
@@ -57,3 +57,4 @@ export interface PenOptions {
|
|
|
57
57
|
/** Points around an ellipse, from `start` radians, `turns` of a full turn. */
|
|
58
58
|
export declare function ellipsePoints(cx: number, cy: number, rx: number, ry: number, angle: number, start?: number, turns?: number, samples?: number): Point[];
|
|
59
59
|
export declare function createPen(ctx: CanvasRenderingContext2D, options: PenOptions): Pen;
|
|
60
|
+
export declare function unfilledPen(ctx: CanvasRenderingContext2D, pen: Pen): Pen;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
|
+
import type { SkinShading } from '../body/organic-body';
|
|
3
|
+
/** A deterministic cel band clipped to the moving face/palm contour. */
|
|
4
|
+
export declare function shadeSkinOutline(ctx: CanvasRenderingContext2D, outline: Point[], center: Point, material: SkinShading): void;
|
|
@@ -42,6 +42,8 @@ export interface Skeleton {
|
|
|
42
42
|
height: number;
|
|
43
43
|
/** View angle, radians: turn × 90° */
|
|
44
44
|
view: number;
|
|
45
|
+
/** Body forward axis in camera view space; independent of head yaw. */
|
|
46
|
+
bodyForward?: Vec3;
|
|
45
47
|
chains: Record<string, SolvedChain>;
|
|
46
48
|
head: SolvedHead;
|
|
47
49
|
/** The hips on screen */
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { type Character, type CharacterOptions } from './character';
|
|
2
|
+
/** Original actors for story scenes. Options, profiles and materials are JSON. */
|
|
3
|
+
export declare const SOFT_CARTOON_CAST: {
|
|
4
|
+
youngMan: {
|
|
5
|
+
figure: "organic";
|
|
6
|
+
skin: string;
|
|
7
|
+
ink: string;
|
|
8
|
+
headSize: number;
|
|
9
|
+
shoulderWidth: number;
|
|
10
|
+
hipWidth: number;
|
|
11
|
+
handSize: number;
|
|
12
|
+
hair: {
|
|
13
|
+
style: "softSweep";
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
ears: true;
|
|
17
|
+
face: {
|
|
18
|
+
style: "anime";
|
|
19
|
+
shape: "angular";
|
|
20
|
+
jawWidth: number;
|
|
21
|
+
chinWidth: number;
|
|
22
|
+
jawRoundness: number;
|
|
23
|
+
eyeScale: number;
|
|
24
|
+
eyeAspect: number;
|
|
25
|
+
nose: true;
|
|
26
|
+
iris: string;
|
|
27
|
+
};
|
|
28
|
+
outfit: {
|
|
29
|
+
shirt: string;
|
|
30
|
+
trousers: string;
|
|
31
|
+
sleeves: "short";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
youngWoman: {
|
|
35
|
+
figure: "organic";
|
|
36
|
+
skin: string;
|
|
37
|
+
ink: string;
|
|
38
|
+
headSize: number;
|
|
39
|
+
shoulderWidth: number;
|
|
40
|
+
hipWidth: number;
|
|
41
|
+
handSize: number;
|
|
42
|
+
body: {
|
|
43
|
+
torso: {
|
|
44
|
+
at: number;
|
|
45
|
+
width: number;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
hair: {
|
|
49
|
+
style: "flowingBob";
|
|
50
|
+
color: string;
|
|
51
|
+
};
|
|
52
|
+
ears: true;
|
|
53
|
+
face: {
|
|
54
|
+
style: "anime";
|
|
55
|
+
shape: "angular";
|
|
56
|
+
jawWidth: number;
|
|
57
|
+
chinWidth: number;
|
|
58
|
+
jawRoundness: number;
|
|
59
|
+
eyeScale: number;
|
|
60
|
+
eyeAspect: number;
|
|
61
|
+
nose: true;
|
|
62
|
+
iris: string;
|
|
63
|
+
lashes: true;
|
|
64
|
+
};
|
|
65
|
+
outfit: {
|
|
66
|
+
shirt: string;
|
|
67
|
+
trousers: string;
|
|
68
|
+
sleeves: "short";
|
|
69
|
+
bottom: "skirt";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
childBoy: {
|
|
73
|
+
figure: "organic";
|
|
74
|
+
height: number;
|
|
75
|
+
skin: string;
|
|
76
|
+
ink: string;
|
|
77
|
+
headSize: number;
|
|
78
|
+
shoulderWidth: number;
|
|
79
|
+
hipWidth: number;
|
|
80
|
+
legLength: number;
|
|
81
|
+
armLength: number;
|
|
82
|
+
handSize: number;
|
|
83
|
+
body: {
|
|
84
|
+
torso: {
|
|
85
|
+
at: number;
|
|
86
|
+
width: number;
|
|
87
|
+
}[];
|
|
88
|
+
arm: {
|
|
89
|
+
at: number;
|
|
90
|
+
width: number;
|
|
91
|
+
}[];
|
|
92
|
+
leg: {
|
|
93
|
+
at: number;
|
|
94
|
+
width: number;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
hair: {
|
|
98
|
+
style: "softSweep";
|
|
99
|
+
color: string;
|
|
100
|
+
};
|
|
101
|
+
ears: true;
|
|
102
|
+
face: {
|
|
103
|
+
style: "anime";
|
|
104
|
+
shape: "round";
|
|
105
|
+
eyeScale: number;
|
|
106
|
+
eyeAspect: number;
|
|
107
|
+
nose: true;
|
|
108
|
+
iris: string;
|
|
109
|
+
};
|
|
110
|
+
outfit: {
|
|
111
|
+
shirt: string;
|
|
112
|
+
trousers: string;
|
|
113
|
+
sleeves: "short";
|
|
114
|
+
bottom: "shorts";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
childGirl: {
|
|
118
|
+
figure: "organic";
|
|
119
|
+
height: number;
|
|
120
|
+
skin: string;
|
|
121
|
+
ink: string;
|
|
122
|
+
headSize: number;
|
|
123
|
+
shoulderWidth: number;
|
|
124
|
+
hipWidth: number;
|
|
125
|
+
legLength: number;
|
|
126
|
+
armLength: number;
|
|
127
|
+
handSize: number;
|
|
128
|
+
body: {
|
|
129
|
+
torso: {
|
|
130
|
+
at: number;
|
|
131
|
+
width: number;
|
|
132
|
+
}[];
|
|
133
|
+
arm: {
|
|
134
|
+
at: number;
|
|
135
|
+
width: number;
|
|
136
|
+
}[];
|
|
137
|
+
leg: {
|
|
138
|
+
at: number;
|
|
139
|
+
width: number;
|
|
140
|
+
}[];
|
|
141
|
+
};
|
|
142
|
+
hair: {
|
|
143
|
+
style: "flowingBob";
|
|
144
|
+
color: string;
|
|
145
|
+
};
|
|
146
|
+
ears: true;
|
|
147
|
+
face: {
|
|
148
|
+
style: "anime";
|
|
149
|
+
shape: "round";
|
|
150
|
+
eyeScale: number;
|
|
151
|
+
eyeAspect: number;
|
|
152
|
+
nose: true;
|
|
153
|
+
iris: string;
|
|
154
|
+
lashes: true;
|
|
155
|
+
};
|
|
156
|
+
outfit: {
|
|
157
|
+
shirt: string;
|
|
158
|
+
trousers: string;
|
|
159
|
+
sleeves: "short";
|
|
160
|
+
bottom: "skirt";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export type SoftCartoonName = keyof typeof SOFT_CARTOON_CAST;
|
|
165
|
+
/** Preset choices can be overridden without changing the source actor. */
|
|
166
|
+
export declare function softCartoonCharacter(name: SoftCartoonName, options?: CharacterOptions): Character;
|
|
@@ -9,7 +9,11 @@ import type { CharacterLayers } from '../character';
|
|
|
9
9
|
* are the original T-shirt and trousers, unchanged.
|
|
10
10
|
*/
|
|
11
11
|
export interface BasicOutfitOptions {
|
|
12
|
-
/**
|
|
12
|
+
/** Top cut. Omitted retains the original plain T-shirt. */
|
|
13
|
+
top?: 'tshirt' | 'shirt' | 'blouse' | 'dress';
|
|
14
|
+
/** Details on trousers/shorts (default plain); the colour remains editable. */
|
|
15
|
+
trouserStyle?: 'plain' | 'jeans' | 'cargo';
|
|
16
|
+
/** Shirt colour (default red); also colours the skirt of a dress. */
|
|
13
17
|
shirt?: string;
|
|
14
18
|
/** Trouser (or shorts, or skirt) colour (default navy) */
|
|
15
19
|
trousers?: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Point } from '../../adapters/canvas/sketch';
|
|
2
|
+
import type { CharacterJoints, CharacterLayers } from '../character';
|
|
3
|
+
/** Plain garment data; the leaf cloth follows the native torso and thighs. */
|
|
4
|
+
export interface LeafOutfitOptions {
|
|
5
|
+
top?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
accent?: string;
|
|
8
|
+
/** Hip-to-ankle fraction, 0.2..0.45 (default 0.32, above the knee). */
|
|
9
|
+
length?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface LeafOutfitContours {
|
|
12
|
+
top?: Point[];
|
|
13
|
+
skirt: Point[];
|
|
14
|
+
}
|
|
15
|
+
/** Coverage geometry is available to headless renderers and pixel checks. */
|
|
16
|
+
export declare function leafOutfitContours(j: CharacterJoints, options?: LeafOutfitOptions): LeafOutfitContours;
|
|
17
|
+
/** At the body's own part depths: foreground hands can cross the garments. */
|
|
18
|
+
export declare function leafOutfit(options?: LeafOutfitOptions): CharacterLayers;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BasicOutfitOptions } from './basic-outfit';
|
|
2
|
+
export type OutfitCategory = 'everyday' | 'formal' | 'casual';
|
|
3
|
+
/** Plain JSON starting points. Garment choices are available for any actor. */
|
|
4
|
+
export declare const OUTFIT_PRESETS: Readonly<Record<OutfitCategory, Readonly<BasicOutfitOptions>>>;
|
|
5
|
+
/** Returns fresh, serializable wardrobe options for character({ outfit }). */
|
|
6
|
+
export declare function outfitPreset(category: OutfitCategory, overrides?: BasicOutfitOptions): BasicOutfitOptions;
|