mesh-avatar 0.1.1 → 0.2.1
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 +7 -0
- package/dist/engine/sprites.d.ts +6 -2
- package/dist/index.js +1200 -1194
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
A WebGL runtime for 2D mesh avatars created with [Mesh Avatar Studio](https://github.com/shinshin86/mesh-avatar-studio). Load a `.mavatar` archive or an avatar folder into a canvas, then control its motion, voice level and expressions.
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://raw.githubusercontent.com/shinshin86/mesh-avatar-studio/main/docs/images/face-tracking.gif" width="400" alt="A Mesh Avatar Studio avatar following a face through a webcam">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
To move an avatar with your own face and voice without installing anything, open the
|
|
10
|
+
[Player](https://shinshin86.github.io/mesh-avatar-studio/play/) in Chrome or Edge.
|
|
11
|
+
|
|
5
12
|
## Install
|
|
6
13
|
|
|
7
14
|
```sh
|
package/dist/engine/sprites.d.ts
CHANGED
|
@@ -5,12 +5,16 @@ export function createSpriteModule(engine: ReturnType<typeof import("./rig.js").
|
|
|
5
5
|
/**
|
|
6
6
|
* Show / hide and deform the sprites for this frame.
|
|
7
7
|
* Returns which eyes are covered by a sprite, so the layered eye parts can be hidden.
|
|
8
|
+
* `mood` (angry / sad / surprise) picks drawn expression eyes (sad, surprise) and closed
|
|
9
|
+
* mouths (angry, sad) when the avatar has them.
|
|
8
10
|
*/
|
|
9
|
-
update(P: any, phys: any, dt?: number): {
|
|
11
|
+
update(P: any, phys: any, dt?: number, mood?: null): {
|
|
10
12
|
eyes: boolean[];
|
|
11
13
|
mouth: any;
|
|
12
14
|
};
|
|
13
15
|
};
|
|
14
16
|
mouthShape: (open: any, form: any, prev?: null) => any;
|
|
15
|
-
eyeSprite: (open: any, smile: any) => "eyes_smile" | "eyes_closed" | "eyes_half" | null;
|
|
17
|
+
eyeSprite: (open: any, smile: any, mood?: null) => "eyes_smile" | "eyes_closed" | "eyes_half" | null;
|
|
16
18
|
};
|
|
19
|
+
/** The drawn-eye / mouth mood for the live expression, else for the motion expression (if it is applied). */
|
|
20
|
+
export function eyeMood(overlay: any, expression: any): any;
|