ara3d 0.3.2 → 0.5.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 +9 -1
- package/dist/cli.js +22 -8
- package/dist/embed.js +1788 -1693
- package/dist/index.js +15 -3
- package/dist/types/packages/cli/src/embed.d.ts +18 -2
- package/dist/types/packages/cli/src/index.d.ts +2 -2
- package/dist/types/packages/cli/src/library/generate.d.ts +6 -0
- package/dist/types/packages/cli/src/library/sequence.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,17 +6,19 @@ export declare class AraCharacterElement extends HTMLElement {
|
|
|
6
6
|
private view?;
|
|
7
7
|
private status;
|
|
8
8
|
private figure;
|
|
9
|
-
private bar;
|
|
10
9
|
private label;
|
|
11
10
|
private building;
|
|
12
11
|
private queued;
|
|
13
12
|
private visible;
|
|
14
13
|
private sequence?;
|
|
14
|
+
/** The clip playing on the character, for playClip()'s blends. */
|
|
15
|
+
private active?;
|
|
16
|
+
private extentFor?;
|
|
15
17
|
constructor();
|
|
16
18
|
connectedCallback(): void;
|
|
17
19
|
disconnectedCallback(): void;
|
|
18
20
|
attributeChangedCallback(name: string, before: string | null, after: string | null): void;
|
|
19
|
-
/** What plays: the animation attribute (one clip, or a sequence such as "walk 3s,
|
|
21
|
+
/** What plays: the animation attribute (one clip, or a sequence such as "walk 3s, look_around"), a vehicle's riding clip, or idle. */
|
|
20
22
|
get animation(): string;
|
|
21
23
|
/** The clips the animation uses, each once. */
|
|
22
24
|
private clipIds;
|
|
@@ -25,8 +27,22 @@ export declare class AraCharacterElement extends HTMLElement {
|
|
|
25
27
|
private applyExpression;
|
|
26
28
|
private fit;
|
|
27
29
|
/** Frames the character and any vehicle from the front-right. */
|
|
30
|
+
/**
|
|
31
|
+
* The space the character fills while its animations play: each clip is posed at its start, middle and end, so a
|
|
32
|
+
* swim or a crouch is framed as well as standing. Props count as they stand.
|
|
33
|
+
*/
|
|
34
|
+
private extent;
|
|
28
35
|
private frame;
|
|
36
|
+
/** The current frame as a 2D canvas, for thumbnails and transitions; transparent where there's no background. */
|
|
37
|
+
snapshot(): HTMLCanvasElement | undefined;
|
|
38
|
+
/** Starts the animation again from the beginning. */
|
|
39
|
+
restart(): void;
|
|
29
40
|
private play;
|
|
41
|
+
/**
|
|
42
|
+
* Blends to a loaded clip (from animation or clips) without rebuilding or reframing, for games and controls:
|
|
43
|
+
* el.playClip('run'). Returns false if the clip isn't loaded.
|
|
44
|
+
*/
|
|
45
|
+
playClip(id: string, fade?: number): boolean;
|
|
30
46
|
private draw;
|
|
31
47
|
/** What to build, from the attributes. */
|
|
32
48
|
private input;
|
|
@@ -90,8 +90,8 @@ export interface AraCharacter {
|
|
|
90
90
|
/** Natural blinking, on by default; call update() every frame for it to run. */
|
|
91
91
|
blinking: boolean;
|
|
92
92
|
/**
|
|
93
|
-
* Plays clips one after another on `mixer`, blending each into the next, such as "
|
|
94
|
-
* that loops (walk, idle) plays one cycle unless given a length; others (
|
|
93
|
+
* Plays clips one after another on `mixer`, blending each into the next, such as "run 2s, vault_over, ledge_climb_up". A step
|
|
94
|
+
* that loops (walk, idle) plays one cycle unless given a length; others (vault_over, jump) play once, or a number of times.
|
|
95
95
|
* It moves on as you call mixer.update(), and takes over the mixer's other actions.
|
|
96
96
|
*/
|
|
97
97
|
playSequence(mixer: AnimationMixer, steps: string | readonly SequenceStep[], options?: SequenceOptions): Sequence;
|
|
@@ -37,4 +37,10 @@ export interface Generated {
|
|
|
37
37
|
}
|
|
38
38
|
/** The character data at `assetsUrl`, loaded once and shared by every character built from it. */
|
|
39
39
|
export declare function libraryAt(assetsUrl: string): Promise<AssetLibrary>;
|
|
40
|
+
export declare function clipIds(choice: GenerateOptions['animations']): string[];
|
|
41
|
+
/**
|
|
42
|
+
* The character settings for an input: a preset name, a share link from the builder, { random: seed }, an
|
|
43
|
+
* "ara-character" object or character settings. Used by the library and the ara3d MCP server.
|
|
44
|
+
*/
|
|
45
|
+
export declare function characterParams(lib: AssetLibrary, input: CharacterInput): HumanParams;
|
|
40
46
|
export declare function generate(lib: AssetLibrary, input: CharacterInput, options?: GenerateOptions, onProgress?: (label: string, fraction: number) => void): Promise<Generated>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Animation sequences, such as "
|
|
1
|
+
/** Animation sequences, such as "run 2s, vault_over, ledge_climb_up": the steps the library's playSequence() and the embed play. */
|
|
2
2
|
/** One step: a clip ID, with an optional length in seconds or a number of times to play it. */
|
|
3
3
|
export type SequenceStep = string | {
|
|
4
4
|
clip: string;
|
|
@@ -10,5 +10,5 @@ export interface ParsedStep {
|
|
|
10
10
|
seconds?: number;
|
|
11
11
|
times?: number;
|
|
12
12
|
}
|
|
13
|
-
/** Reads "
|
|
13
|
+
/** Reads "run 2s, vault_over, ledge_climb_up" (or an array of steps) into clip IDs with their lengths or counts. */
|
|
14
14
|
export declare function parseSteps(steps: string | readonly SequenceStep[]): ParsedStep[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ara3d",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Realistic, rigged and animated 3D characters: a three.js library, an <ara-character> embed for any web page, and a command-line tool (GLB, FBX, OBJ). Free and open source.",
|
|
5
5
|
"keywords": ["web-component", "embed", "3d", "character", "avatar", "glb", "gltf", "fbx", "three", "threejs", "rigged", "animation", "makehuman", "cli", "gamedev"],
|
|
6
6
|
"homepage": "https://ara3dgen.com/docs/library/",
|