@davi-ai/react-bodyengine-three 1.0.37 → 1.0.38
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/dist/contexts/characterStore.d.ts +4 -1
- package/dist/contexts/emotionStore.d.ts +10 -1
- package/dist/contexts/speechStore.d.ts +14 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +317 -288
- package/dist/models/types.d.ts +4 -2
- package/dist/stats.html +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Character, GlobalManager, LipSyncManager, EyeBlinkManager, AnimationManager, FACSManager, HeadPoseManager, GazeManager, BmlManager, CharacterState } from '@davi-ai/bodyengine-three';
|
|
1
|
+
import { Character, GlobalManager, LipSyncManager, BlendshapeManager, EyeBlinkManager, AnimationManager, FACSManager, HeadPoseManager, GazeManager, BmlManager, CharacterState } from '@davi-ai/bodyengine-three';
|
|
2
2
|
interface Managers {
|
|
3
3
|
lipSyncManager?: LipSyncManager | null;
|
|
4
|
+
blendshapeManager?: BlendshapeManager | null;
|
|
4
5
|
eyeBlinkManager?: EyeBlinkManager | null;
|
|
5
6
|
animationManager?: AnimationManager | null;
|
|
6
7
|
FACSManager?: FACSManager | null;
|
|
@@ -13,6 +14,7 @@ interface CharacterStore {
|
|
|
13
14
|
globalManager: GlobalManager;
|
|
14
15
|
managers: Managers;
|
|
15
16
|
lipSyncManager: LipSyncManager | null;
|
|
17
|
+
blendshapeManager: BlendshapeManager | null;
|
|
16
18
|
eyeBlinkManager: EyeBlinkManager | null;
|
|
17
19
|
animationManager?: AnimationManager | null;
|
|
18
20
|
FACSManager?: FACSManager | null;
|
|
@@ -30,6 +32,7 @@ export declare const setCharacter: (value: Character | null) => void;
|
|
|
30
32
|
export declare const setManagers: (value: Managers) => void;
|
|
31
33
|
export declare const setGlobalSyncManager: (value: GlobalManager | null) => void;
|
|
32
34
|
export declare const setLipSyncManager: (value: LipSyncManager | null) => void;
|
|
35
|
+
export declare const setBlendshapeManager: (value: BlendshapeManager | null) => void;
|
|
33
36
|
export declare const setEyeBlinkManager: (value: EyeBlinkManager | null) => void;
|
|
34
37
|
export declare const setAnimationManager: (value: AnimationManager | null) => void;
|
|
35
38
|
export declare const setFACSManager: (value: FACSManager | null) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Emotions } from '../models/enums';
|
|
2
2
|
import { EmotionData } from '../models/types';
|
|
3
|
-
import { FacialAnimationData } from '@davi-ai/bodyengine-three';
|
|
3
|
+
import { FacialAnimationData, BlendshapeFrame } from '@davi-ai/bodyengine-three';
|
|
4
4
|
interface EmotionStore {
|
|
5
5
|
emotions: Array<EmotionData>;
|
|
6
6
|
currentTopEmotion: Emotions;
|
|
@@ -12,5 +12,14 @@ export declare const setEmotions: (value: Array<EmotionData> | undefined | null)
|
|
|
12
12
|
export declare const setUseTopEmotionOnly: (value: boolean) => void;
|
|
13
13
|
export declare const setAutoDecay: (value: boolean) => void;
|
|
14
14
|
export declare const playFacialAnimation: (value: FacialAnimationData) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Play ARKit blendshape frames right away, outside any speech: facial expressions or a live stream
|
|
17
|
+
* (face tracking...), given one frame at a time as they arrive or as a whole sequence. Timestamps count
|
|
18
|
+
* from the first frame of the sequence; a timestamp going back starts a new one. While the character
|
|
19
|
+
* speaks, the mouth stays the speech's.
|
|
20
|
+
*/
|
|
21
|
+
export declare const playLiveBlendshapes: (frames: BlendshapeFrame | Array<BlendshapeFrame>) => void;
|
|
22
|
+
/** Stop the frames of playLiveBlendshapes. */
|
|
23
|
+
export declare const stopLiveBlendshapes: () => void;
|
|
15
24
|
export declare const resetEmotionStore: () => void;
|
|
16
25
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpeechSynthesisCredentials } from '../models/types';
|
|
1
|
+
import { SpeechSynthesisCredentials, BlendShapesData } from '../models/types';
|
|
2
2
|
import { SpeechSynthesisUtterance, SpeechSynthesisEventProps } from '@davi-ai/web-speech-cognitive-services-davi';
|
|
3
3
|
interface speechStore {
|
|
4
4
|
credentials?: SpeechSynthesisCredentials;
|
|
@@ -7,6 +7,10 @@ interface speechStore {
|
|
|
7
7
|
visemes: Array<SpeechSynthesisEventProps>;
|
|
8
8
|
/** Number of leading visemes already handed to the LipSyncManager. */
|
|
9
9
|
playedVisemeCount: number;
|
|
10
|
+
/** ARKit blendshape frames of the current speech: while there are some, they drive the mouth instead of the visemes. */
|
|
11
|
+
blendshapes: Array<BlendShapesData>;
|
|
12
|
+
/** Number of leading blendshape frames already handed to the BlendshapeManager. */
|
|
13
|
+
playedBlendshapeCount: number;
|
|
10
14
|
voice: SpeechSynthesisVoice | null;
|
|
11
15
|
voices: Array<SpeechSynthesisVoice>;
|
|
12
16
|
textToSpeak: string | null;
|
|
@@ -20,6 +24,13 @@ export declare const setCurrentUtterance: (value: SpeechSynthesisUtterance | nul
|
|
|
20
24
|
export declare const setBoundaries: (value: Array<SpeechSynthesisEventProps>) => void;
|
|
21
25
|
export declare const setVisemes: (value: Array<SpeechSynthesisEventProps>) => void;
|
|
22
26
|
export declare const addViseme: (value: SpeechSynthesisEventProps) => void;
|
|
27
|
+
/** Replace the ARKit blendshape frames of the current speech (see addBlendshape). */
|
|
28
|
+
export declare const setBlendshapes: (value: Array<BlendShapesData>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Add an ARKit blendshape frame (e.g. from Audio2Face) to the current speech, played while the character speaks.
|
|
31
|
+
* While there are some, they drive the mouth instead of the visemes; the lip-sync takes over again once they are played.
|
|
32
|
+
*/
|
|
33
|
+
export declare const addBlendshape: (value: BlendShapesData) => void;
|
|
23
34
|
/**
|
|
24
35
|
* Add viseme data extracted in SPPAS format that will be converted to ArKit viseme and played at the right moment.
|
|
25
36
|
* @param {SpeechSynthesisEventProps} value viseme data (id, elapsedTime = time at which the viseme shall begin, duration can be set to 0 because we override it later).
|
|
@@ -28,6 +39,8 @@ export declare const addViseme: (value: SpeechSynthesisEventProps) => void;
|
|
|
28
39
|
export declare const addSPPASViseme: (value: SpeechSynthesisEventProps, factorToTenthOfMicroSecond?: number) => void;
|
|
29
40
|
export declare const setPlayedVisemeCount: (value: number) => void;
|
|
30
41
|
export declare const flushLipSyncData: () => void;
|
|
42
|
+
export declare const setPlayedBlendshapeCount: (value: number) => void;
|
|
43
|
+
export declare const flushBlendshapeData: () => void;
|
|
31
44
|
export declare const setVoice: (value: SpeechSynthesisVoice | null) => void;
|
|
32
45
|
export declare const setVoices: (value: Array<SpeechSynthesisVoice>) => void;
|
|
33
46
|
export declare const setTextToSpeak: (value: string | null) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { default as Character } from './components/Character';
|
|
2
2
|
export { useCharacterStore, setCharacterState, getCharacterHeight } from './contexts/characterStore';
|
|
3
|
-
export { setTextToSpeak, setCurrentUtterance, setVisemes, addViseme, addSPPASViseme, flushLipSyncData, setVoice, getVoices, setVisemeIntensity, setLipSyncFromAudio } from './contexts/speechStore';
|
|
3
|
+
export { setTextToSpeak, setCurrentUtterance, setVisemes, setBlendshapes, addViseme, addBlendshape, addSPPASViseme, flushLipSyncData, flushBlendshapeData, setVoice, getVoices, setVisemeIntensity, setLipSyncFromAudio } from './contexts/speechStore';
|
|
4
4
|
export { getCameraPosition, getLookAt, setCameraPosition, setMovable } from './contexts/cameraStore';
|
|
5
5
|
export { setCurrentAUs, setCurrentGaze, setCurrentHeadPose, setLookAtCamera, lookAtAndKeep, releaseLookAt, setShowFirstTarget } from './contexts/headStore';
|
|
6
|
-
export { setEmotions, setUseTopEmotionOnly, setAutoDecay, playFacialAnimation } from './contexts/emotionStore';
|
|
6
|
+
export { setEmotions, setUseTopEmotionOnly, setAutoDecay, playFacialAnimation, playLiveBlendshapes, stopLiveBlendshapes } from './contexts/emotionStore';
|
|
7
7
|
export { setAutoPlay, getAnimationsMap, playAnimationByName } from './contexts/animationStore';
|
|
8
8
|
export { emotionList, CharacterState, CreationTool, bmlTags } from '@davi-ai/bodyengine-three';
|
|
9
9
|
export type { FacialAnimationData } from '@davi-ai/bodyengine-three';
|
|
10
10
|
export { Positions, Distances, Rotations } from './models/enums';
|
|
11
11
|
export { cameraPresets as presets } from '@davi-ai/bodyengine-three';
|
|
12
|
-
export type { EnvironmentPreset } from './models/types';
|
|
12
|
+
export type { EnvironmentPreset, BlendShapesData } from './models/types';
|
|
13
13
|
export { Object3D } from 'three/webgpu';
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import i, { useState as A, useMemo as _, useEffect as l, useRef as X, useCallback as
|
|
2
|
-
import * as
|
|
1
|
+
import i, { useState as A, useMemo as _, useEffect as l, useRef as X, useCallback as Se, Suspense as fe } from "react";
|
|
2
|
+
import * as T from "three/webgpu";
|
|
3
3
|
import { Vector3 as ye } from "three/webgpu";
|
|
4
|
-
import { Object3D as
|
|
5
|
-
import { CharacterState as
|
|
6
|
-
import { CharacterState as
|
|
7
|
-
import { useDetectGPU as Ve, PerformanceMonitor as
|
|
4
|
+
import { Object3D as _t } from "three/webgpu";
|
|
5
|
+
import { CharacterState as I, convertSPPASViseme as Ae, speechAudioClock as be, playPendingVisemes as Ce, playPendingBlendshapes as ke, connectSpeechAudio as we, createHighPipeline as Me, createTraaPipeline as Pe, Emotions as ue, emotionsToActionUnits as Ee, getCameraPositionVector as Te, computeBodyFraming as Re, CreationTool as $, AvaturnLoader as Be, BodyMesh as ne, AvatarSDKLoader as xe, CC3Loader as De, Character as ae } from "@davi-ai/bodyengine-three";
|
|
6
|
+
import { CharacterState as tn, CreationTool as nn, Distances as an, Positions as sn, Rotations as on, bmlTags as rn, emotionList as cn, cameraPresets as ln } from "@davi-ai/bodyengine-three";
|
|
7
|
+
import { useDetectGPU as Ve, PerformanceMonitor as ve, PerspectiveCamera as Fe, CameraControls as Le, Environment as Ie } from "@react-three/drei";
|
|
8
8
|
import { vec4 as oe, vec3 as ze } from "three/tsl";
|
|
9
|
-
import { Canvas as
|
|
10
|
-
import { createSpeechSynthesisPonyfill as
|
|
9
|
+
import { Canvas as Ue, useThree as Ge, useFrame as ge } from "@react-three/fiber";
|
|
10
|
+
import { createSpeechSynthesisPonyfill as Oe, SpeechSynthesisUtterance as Ne } from "@davi-ai/web-speech-cognitive-services-davi";
|
|
11
11
|
const re = (e) => {
|
|
12
12
|
let t;
|
|
13
|
-
const n = /* @__PURE__ */ new Set(), r = (
|
|
14
|
-
const
|
|
15
|
-
if (!Object.is(
|
|
16
|
-
const
|
|
17
|
-
t =
|
|
13
|
+
const n = /* @__PURE__ */ new Set(), r = (d, k) => {
|
|
14
|
+
const E = typeof d == "function" ? d(t) : d;
|
|
15
|
+
if (!Object.is(E, t)) {
|
|
16
|
+
const w = t;
|
|
17
|
+
t = k ?? (typeof E != "object" || E === null) ? E : Object.assign({}, t, E), n.forEach((R) => R(t, w));
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
function
|
|
19
|
+
}, g = () => t, b = { setState: r, getState: g, getInitialState: () => C, subscribe: (d) => (n.add(d), () => n.delete(d)) }, C = t = e(r, g, b);
|
|
20
|
+
return b;
|
|
21
|
+
}, He = (e) => e ? re(e) : re, Ke = (e) => e;
|
|
22
|
+
function je(e, t = Ke) {
|
|
23
23
|
const n = i.useSyncExternalStore(
|
|
24
24
|
e.subscribe,
|
|
25
25
|
i.useCallback(() => t(e.getState()), [e, t]),
|
|
@@ -27,14 +27,15 @@ function Ke(e, t = He) {
|
|
|
27
27
|
);
|
|
28
28
|
return i.useDebugValue(n), n;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
const t =
|
|
30
|
+
const We = (e) => {
|
|
31
|
+
const t = He(e), n = (r) => je(t, r);
|
|
32
32
|
return Object.assign(n, t), n;
|
|
33
|
-
}, J = (e) =>
|
|
33
|
+
}, J = (e) => We, c = J()(() => ({
|
|
34
34
|
character: null,
|
|
35
35
|
managers: [],
|
|
36
36
|
globalManager: null,
|
|
37
37
|
lipSyncManager: null,
|
|
38
|
+
blendshapeManager: null,
|
|
38
39
|
eyeBlinkManager: null,
|
|
39
40
|
animationManager: null,
|
|
40
41
|
FACSManager: null,
|
|
@@ -45,20 +46,21 @@ const je = (e) => {
|
|
|
45
46
|
characterWidth: 0,
|
|
46
47
|
characterHeight: 0,
|
|
47
48
|
characterDepth: 0,
|
|
48
|
-
characterState:
|
|
49
|
-
})),
|
|
50
|
-
|
|
49
|
+
characterState: I.idle
|
|
50
|
+
})), $e = (e) => {
|
|
51
|
+
c.setState({ character: e }), c.setState({ managers: {
|
|
51
52
|
lipSyncManager: (e == null ? void 0 : e.lipSyncManager) || null,
|
|
53
|
+
blendshapeManager: (e == null ? void 0 : e.blendshapeManager) || null,
|
|
52
54
|
eyeBlinkManager: (e == null ? void 0 : e.eyeBlinkManager) || null,
|
|
53
55
|
animationManager: (e == null ? void 0 : e.animationManager) || null
|
|
54
|
-
} }),
|
|
56
|
+
} }), c.setState({ globalManager: (e == null ? void 0 : e.globalManager) || null }), c.setState({ lipSyncManager: (e == null ? void 0 : e.lipSyncManager) || null }), c.setState({ blendshapeManager: (e == null ? void 0 : e.blendshapeManager) || null }), c.setState({ eyeBlinkManager: (e == null ? void 0 : e.eyeBlinkManager) || null }), c.setState({ animationManager: (e == null ? void 0 : e.animationManager) || null }), c.setState({ FACSManager: (e == null ? void 0 : e.FACSManager) || null }), c.setState({ headPoseManager: (e == null ? void 0 : e.headPoseManager) || null }), c.setState({ gazeManager: (e == null ? void 0 : e.gazeManager) || null }), c.setState({ bmlManager: (e == null ? void 0 : e.bmlManager) || null });
|
|
55
57
|
}, ie = (e) => {
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
58
|
+
c.setState({ animationsLoaded: e });
|
|
59
|
+
}, Xe = (e) => {
|
|
60
|
+
c.setState({ characterWidth: e.x }), c.setState({ characterHeight: e.y }), c.setState({ characterDepth: e.z });
|
|
61
|
+
}, Rt = () => c.getState().characterHeight, ce = (e) => {
|
|
62
|
+
c.setState({ characterState: e });
|
|
63
|
+
}, P = J()(() => ({
|
|
62
64
|
cameraRef: null,
|
|
63
65
|
cameraPosition: new ye(0, 0, 5),
|
|
64
66
|
bodyCenter: null,
|
|
@@ -66,481 +68,508 @@ const je = (e) => {
|
|
|
66
68
|
defaultDistances: null,
|
|
67
69
|
lookAt: null,
|
|
68
70
|
movable: !0
|
|
69
|
-
})),
|
|
70
|
-
|
|
71
|
+
})), qe = (e) => {
|
|
72
|
+
P.setState({ cameraRef: e });
|
|
71
73
|
}, le = (e) => {
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
}, Je = (e) => {
|
|
76
|
-
M.setState({ defaultPositions: e });
|
|
74
|
+
P.setState({ cameraPosition: e });
|
|
75
|
+
}, Bt = () => P.getState().cameraPosition, Je = (e) => {
|
|
76
|
+
P.setState({ bodyCenter: e });
|
|
77
77
|
}, Qe = (e) => {
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
},
|
|
78
|
+
P.setState({ defaultPositions: e });
|
|
79
|
+
}, Ye = (e) => {
|
|
80
|
+
P.setState({ defaultDistances: e });
|
|
81
|
+
}, de = (e) => {
|
|
82
|
+
P.setState({ lookAt: e });
|
|
83
|
+
}, xt = () => P.getState().lookAt, Ze = (e) => {
|
|
84
|
+
P.setState({ movable: e });
|
|
85
|
+
}, V = J()(() => ({
|
|
84
86
|
currentAUs: null,
|
|
85
87
|
currentGaze: null,
|
|
86
88
|
currentHeadPose: null,
|
|
87
89
|
lookAtCamera: !1,
|
|
88
90
|
targets: [],
|
|
89
91
|
showFirstTarget: !1
|
|
90
|
-
})),
|
|
91
|
-
|
|
92
|
-
}, _e = (e) => {
|
|
93
|
-
F.setState({ currentAUs: e });
|
|
94
|
-
}, Rt = (e) => {
|
|
95
|
-
F.setState({ currentGaze: e });
|
|
96
|
-
}, vt = (e) => {
|
|
97
|
-
F.setState({ currentHeadPose: e });
|
|
98
|
-
}, se = (e) => {
|
|
99
|
-
F.setState({ lookAtCamera: e }), e ? et() : tt();
|
|
92
|
+
})), _e = (e) => {
|
|
93
|
+
V.setState({ targets: e });
|
|
100
94
|
}, et = (e) => {
|
|
101
|
-
|
|
95
|
+
V.setState({ currentAUs: e });
|
|
96
|
+
}, Dt = (e) => {
|
|
97
|
+
V.setState({ currentGaze: e });
|
|
98
|
+
}, Vt = (e) => {
|
|
99
|
+
V.setState({ currentHeadPose: e });
|
|
100
|
+
}, se = (e) => {
|
|
101
|
+
V.setState({ lookAtCamera: e }), e ? tt() : nt();
|
|
102
|
+
}, tt = (e) => {
|
|
103
|
+
const t = c.getState().globalManager;
|
|
102
104
|
if (e)
|
|
103
105
|
t == null || t.lookAtAndKeep(e);
|
|
104
106
|
else {
|
|
105
|
-
const n =
|
|
107
|
+
const n = P.getState().cameraRef;
|
|
106
108
|
t == null || t.lookAtAndKeep(n);
|
|
107
109
|
}
|
|
108
|
-
},
|
|
110
|
+
}, nt = () => {
|
|
109
111
|
var e;
|
|
110
|
-
(e =
|
|
111
|
-
},
|
|
112
|
-
|
|
112
|
+
(e = c.getState().globalManager) == null || e.releaseLookAt();
|
|
113
|
+
}, vt = (e) => {
|
|
114
|
+
V.setState({ showFirstTarget: e });
|
|
113
115
|
}, q = J()(() => ({
|
|
114
116
|
animationsNames: [],
|
|
115
117
|
animations: /* @__PURE__ */ new Map(),
|
|
116
118
|
currentAnimation: null,
|
|
117
119
|
autoPlay: !0
|
|
118
|
-
})),
|
|
120
|
+
})), at = (e) => {
|
|
119
121
|
q.setState({ animationsNames: e });
|
|
120
|
-
},
|
|
122
|
+
}, st = (e) => {
|
|
121
123
|
q.setState({ animations: e });
|
|
122
|
-
},
|
|
124
|
+
}, Ft = () => q.getState().animations, Lt = (e) => {
|
|
123
125
|
q.setState({ autoPlay: e });
|
|
124
|
-
},
|
|
126
|
+
}, It = (e) => {
|
|
125
127
|
if (q.setState({ autoPlay: !1 }), q.getState().animationsNames.includes(e)) {
|
|
126
|
-
const n =
|
|
128
|
+
const n = c.getState().animationManager;
|
|
127
129
|
n == null || n.playAnimation(e);
|
|
128
130
|
}
|
|
129
|
-
},
|
|
131
|
+
}, m = J()(() => ({
|
|
130
132
|
credentials: void 0,
|
|
131
133
|
currentUtterance: null,
|
|
132
134
|
boundaries: [],
|
|
133
135
|
visemes: [],
|
|
134
136
|
playedVisemeCount: 0,
|
|
137
|
+
blendshapes: [],
|
|
138
|
+
playedBlendshapeCount: 0,
|
|
135
139
|
voice: null,
|
|
136
140
|
voices: [],
|
|
137
141
|
textToSpeak: null,
|
|
138
142
|
visemeIntensity: 1,
|
|
139
143
|
lipSyncFromAudio: !1
|
|
140
|
-
})),
|
|
141
|
-
|
|
142
|
-
},
|
|
144
|
+
})), ot = (e) => {
|
|
145
|
+
m.setState({ credentials: e });
|
|
146
|
+
}, rt = (e) => {
|
|
143
147
|
if (e) {
|
|
144
|
-
const t =
|
|
148
|
+
const t = m.getState().voice;
|
|
145
149
|
t && (e.voice = t);
|
|
146
150
|
}
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
|
|
151
|
+
m.setState({ currentUtterance: e }), m.setState({ textToSpeak: null });
|
|
152
|
+
}, zt = (e) => {
|
|
153
|
+
m.setState({ visemes: e });
|
|
150
154
|
}, he = (e) => {
|
|
151
|
-
|
|
152
|
-
},
|
|
155
|
+
m.setState({ visemes: [...m.getState().visemes, e] });
|
|
156
|
+
}, Ut = (e) => {
|
|
157
|
+
m.setState({ blendshapes: e });
|
|
158
|
+
}, Gt = (e) => {
|
|
159
|
+
m.setState({ blendshapes: [...m.getState().blendshapes, e] });
|
|
160
|
+
}, Ot = (e, t) => {
|
|
153
161
|
const n = Ae(e, t);
|
|
154
162
|
n && he(n);
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
},
|
|
163
|
+
}, it = (e) => {
|
|
164
|
+
m.setState({ playedVisemeCount: e });
|
|
165
|
+
}, ct = () => {
|
|
158
166
|
var e;
|
|
159
|
-
|
|
167
|
+
m.setState({
|
|
160
168
|
visemes: [],
|
|
161
169
|
playedVisemeCount: 0
|
|
162
|
-
}), (e =
|
|
163
|
-
}, ct = (e) => {
|
|
164
|
-
p.setState({ voice: e });
|
|
165
|
-
}, ue = (e) => {
|
|
166
|
-
p.setState({ voices: e });
|
|
167
|
-
}, zt = (e) => {
|
|
168
|
-
p.setState({ textToSpeak: e });
|
|
169
|
-
}, Bt = () => p.getState().voices, Ut = (e) => {
|
|
170
|
-
p.setState({ visemeIntensity: e });
|
|
170
|
+
}), (e = c.getState().lipSyncManager) == null || e.stop();
|
|
171
171
|
}, lt = (e) => {
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
172
|
+
m.setState({ playedBlendshapeCount: e });
|
|
173
|
+
}, dt = () => {
|
|
174
|
+
var e;
|
|
175
|
+
m.setState({
|
|
176
|
+
blendshapes: [],
|
|
177
|
+
playedBlendshapeCount: 0
|
|
178
|
+
}), (e = c.getState().blendshapeManager) == null || e.stop();
|
|
179
|
+
}, mt = (e) => {
|
|
180
|
+
m.setState({ voice: e });
|
|
181
|
+
}, me = (e) => {
|
|
182
|
+
m.setState({ voices: e });
|
|
183
|
+
}, Nt = (e) => {
|
|
184
|
+
m.setState({ textToSpeak: e });
|
|
185
|
+
}, Ht = () => m.getState().voices, Kt = (e) => {
|
|
186
|
+
m.setState({ visemeIntensity: e });
|
|
187
|
+
}, ut = (e) => {
|
|
188
|
+
m.setState({ lipSyncFromAudio: e });
|
|
189
|
+
}, gt = () => {
|
|
190
|
+
const e = c((o) => o.animationsLoaded), t = c((o) => o.characterState), n = c((o) => o.lipSyncManager), r = c((o) => o.blendshapeManager), g = m((o) => o.credentials), s = m((o) => o.currentUtterance), u = m((o) => o.textToSpeak), b = m((o) => o.visemes), C = m((o) => o.visemeIntensity), d = m((o) => o.playedVisemeCount), k = m((o) => o.blendshapes), E = m((o) => o.playedBlendshapeCount), w = m((o) => o.lipSyncFromAudio), [R, v] = A(!1), [O, F] = A(!1), h = _(() => g != null && g.region && (g.subscriptionKey || g.token) ? Oe({
|
|
175
191
|
credentials: {
|
|
176
|
-
region:
|
|
177
|
-
authorizationToken:
|
|
178
|
-
subscriptionKey:
|
|
192
|
+
region: g.region,
|
|
193
|
+
authorizationToken: g.token,
|
|
194
|
+
subscriptionKey: g.subscriptionKey
|
|
179
195
|
}
|
|
180
|
-
}) : null, [
|
|
196
|
+
}) : null, [g]), y = _(() => be(() => h), [h]);
|
|
181
197
|
return l(() => {
|
|
182
198
|
if (h) {
|
|
183
199
|
const o = h.speechSynthesis.getVoices();
|
|
184
|
-
o && Array.isArray(o) && o.length ? (
|
|
185
|
-
|
|
200
|
+
o && Array.isArray(o) && o.length ? (me(o), v(!0)) : h.speechSynthesis.onvoiceschanged = () => {
|
|
201
|
+
me(h.speechSynthesis.getVoices()), v(!0);
|
|
186
202
|
};
|
|
187
203
|
}
|
|
188
204
|
}, [h]), l(() => {
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
-
if (
|
|
192
|
-
const o = new
|
|
193
|
-
|
|
205
|
+
R && n && e && F(!0);
|
|
206
|
+
}, [R, n, e]), l(() => {
|
|
207
|
+
if (u) {
|
|
208
|
+
const o = new Ne(u);
|
|
209
|
+
rt(o);
|
|
194
210
|
}
|
|
211
|
+
}, [u]), l(() => {
|
|
212
|
+
var o, z;
|
|
213
|
+
s && O ? (s.onstart = () => {
|
|
214
|
+
console.log("Start"), ce(I.speaking);
|
|
215
|
+
}, s.onend = () => {
|
|
216
|
+
console.log("End"), ce(I.idle);
|
|
217
|
+
}, s.onboundary = () => {
|
|
218
|
+
}, s.onviseme = (U) => {
|
|
219
|
+
he(U);
|
|
220
|
+
}, n == null || n.setSpeechText(s.text), r == null || r.setSpeechText(s.text), (o = h == null ? void 0 : h.speechSynthesis) == null || o.speak(s, null)) : (z = h == null ? void 0 : h.speechSynthesis) == null || z.cancel();
|
|
195
221
|
}, [s]), l(() => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
he(y);
|
|
204
|
-
}, n == null || n.setSpeechText(d.text), (o = h == null ? void 0 : h.speechSynthesis) == null || o.speak(d, null)) : (T = h == null ? void 0 : h.speechSynthesis) == null || T.cancel();
|
|
205
|
-
}, [d]), l(() => {
|
|
206
|
-
n && (n.visemeIntensity = k);
|
|
207
|
-
}, [k]), l(() => {
|
|
208
|
-
c || n && t === z.speaking && rt(be(n, m, C, U));
|
|
209
|
-
}, [t, m, n, c]), l(() => {
|
|
210
|
-
n && (t === z.speaking ? c && Ce(n, h) : n.disconnectAudio());
|
|
222
|
+
n && (n.visemeIntensity = C);
|
|
223
|
+
}, [C]), l(() => {
|
|
224
|
+
w || n && t === I.speaking && it(Ce(n, b, d, y));
|
|
225
|
+
}, [t, b, n, w]), l(() => {
|
|
226
|
+
r && k.length && t === I.speaking && lt(ke(r, k, E, y));
|
|
227
|
+
}, [t, k, r]), l(() => {
|
|
228
|
+
n && (t === I.speaking ? w && we(n, h) : n.disconnectAudio());
|
|
211
229
|
}, [t, n]), l(() => {
|
|
212
|
-
t !==
|
|
230
|
+
t !== I.speaking && (ct(), dt());
|
|
213
231
|
}, [t]), null;
|
|
214
|
-
},
|
|
232
|
+
}, ht = ({ points: e, color: t = "red" }) => {
|
|
215
233
|
const n = _(() => {
|
|
216
|
-
const r = new
|
|
217
|
-
return new
|
|
234
|
+
const r = new T.BufferGeometry().setFromPoints(e), g = new T.LineBasicMaterial({ color: t, toneMapped: !1 });
|
|
235
|
+
return new T.Line(r, g);
|
|
218
236
|
}, [e, t]);
|
|
219
237
|
return /* @__PURE__ */ i.createElement("primitive", { object: n });
|
|
220
|
-
},
|
|
221
|
-
const t = new
|
|
238
|
+
}, pt = async (e) => {
|
|
239
|
+
const t = new T.WebGPURenderer({
|
|
222
240
|
canvas: e,
|
|
223
241
|
antialias: !1,
|
|
224
242
|
alpha: !0,
|
|
225
243
|
powerPreference: "high-performance"
|
|
226
244
|
});
|
|
227
|
-
return t.setClearColor(new
|
|
245
|
+
return t.setClearColor(new T.Color("#000000"), 0), t.setPixelRatio(Math.min(devicePixelRatio, 1.5)), t.shadowMap.type = T.PCFShadowMap, t.forceContextLoss = () => {
|
|
228
246
|
t.dispose();
|
|
229
247
|
}, await t.init(), t;
|
|
230
|
-
},
|
|
231
|
-
const s =
|
|
248
|
+
}, St = ({ parentGpuTier: e, setIsGpuAvailable: t, children: n, tonemapping: r, inspector: g = !1 }) => {
|
|
249
|
+
const s = P((a) => a.cameraPosition), u = P((a) => a.lookAt), b = P((a) => a.movable), C = V((a) => a.targets), d = V((a) => a.showFirstTarget), [k, E] = A(e || Ve()), [w, R] = A(
|
|
232
250
|
"low"
|
|
233
251
|
/* low */
|
|
234
|
-
), [
|
|
252
|
+
), [v, O] = A(null), [F, h] = A(void 0), y = X(null), [o, z] = A(null), U = X(null), M = (a) => {
|
|
235
253
|
a.preventDefault(), a.stopPropagation();
|
|
236
254
|
};
|
|
237
255
|
l(() => {
|
|
238
|
-
var a,
|
|
239
|
-
if (
|
|
240
|
-
|
|
256
|
+
var a, B, x, p;
|
|
257
|
+
if (b)
|
|
258
|
+
v == null || v.abort(), O(null);
|
|
241
259
|
else {
|
|
242
|
-
const
|
|
243
|
-
|
|
260
|
+
const D = new AbortController();
|
|
261
|
+
O(D), (a = y.current) == null || a.addEventListener("wheel", M, { passive: !1, signal: D.signal }), (B = y.current) == null || B.addEventListener("pointerdown", M, { passive: !1, signal: D.signal }), (x = y.current) == null || x.addEventListener("pointermove", M, { passive: !1, signal: D.signal }), (p = y.current) == null || p.addEventListener("click", M, { passive: !1, signal: D.signal });
|
|
244
262
|
}
|
|
245
|
-
}, [
|
|
246
|
-
if (
|
|
247
|
-
const a =
|
|
248
|
-
|
|
263
|
+
}, [b]), l(() => {
|
|
264
|
+
if (o && u && s) {
|
|
265
|
+
const a = U.current === o;
|
|
266
|
+
o.setLookAt(s.x, s.y, s.z, u.x, u.y, u.z, a), U.current = o;
|
|
249
267
|
}
|
|
250
|
-
}, [
|
|
251
|
-
e &&
|
|
268
|
+
}, [o, s, u]), l(() => {
|
|
269
|
+
e && E(e);
|
|
252
270
|
}, [e]), l(() => {
|
|
253
|
-
if (
|
|
254
|
-
if (
|
|
271
|
+
if (k)
|
|
272
|
+
if (k.type === "FALLBACK") {
|
|
255
273
|
const a = typeof navigator < "u" && /Macintosh|Mac OS X/.test(navigator.userAgent);
|
|
256
|
-
|
|
274
|
+
R(
|
|
257
275
|
a ? "medium" : "low"
|
|
258
276
|
/* low */
|
|
259
277
|
);
|
|
260
278
|
} else
|
|
261
|
-
switch (
|
|
279
|
+
switch (k.tier) {
|
|
262
280
|
case 0:
|
|
263
281
|
case 1:
|
|
264
|
-
|
|
282
|
+
R(
|
|
265
283
|
"low"
|
|
266
284
|
/* low */
|
|
267
285
|
);
|
|
268
286
|
break;
|
|
269
287
|
case 2:
|
|
270
|
-
|
|
288
|
+
R(
|
|
271
289
|
"medium"
|
|
272
290
|
/* medium */
|
|
273
291
|
);
|
|
274
292
|
break;
|
|
275
293
|
case 3:
|
|
276
|
-
|
|
294
|
+
R(
|
|
277
295
|
"high"
|
|
278
296
|
/* high */
|
|
279
297
|
);
|
|
280
298
|
break;
|
|
281
299
|
default:
|
|
282
|
-
|
|
300
|
+
R(
|
|
283
301
|
"low"
|
|
284
302
|
/* low */
|
|
285
303
|
);
|
|
286
304
|
break;
|
|
287
305
|
}
|
|
288
|
-
}, [
|
|
289
|
-
switch (
|
|
306
|
+
}, [k]), l(() => {
|
|
307
|
+
switch (w && (f.current = w), w) {
|
|
290
308
|
case "low":
|
|
291
309
|
console.warn("Retorik React-Bodyengine-Three > GPU tier too low, no rendering available"), t(!1);
|
|
292
310
|
break;
|
|
293
311
|
case "medium":
|
|
294
|
-
|
|
312
|
+
h([0.8, 1]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${w}`), t(!0);
|
|
295
313
|
break;
|
|
296
314
|
case "high":
|
|
297
|
-
|
|
315
|
+
h([1, 1.5]), console.log(`Retorik React-Bodyengine-Three > GPU tier detected : ${w}`), t(!0);
|
|
298
316
|
break;
|
|
299
317
|
}
|
|
300
|
-
}, [
|
|
301
|
-
const f = X(void 0), L = X(null),
|
|
318
|
+
}, [w]);
|
|
319
|
+
const f = X(void 0), L = X(null), N = Se((a) => ((!L.current || L.current.canvas !== a.canvas) && (L.current = { canvas: a.canvas, renderer: pt(a.canvas) }), L.current.renderer), []), W = _(() => {
|
|
302
320
|
if (C.length) {
|
|
303
|
-
const a = C[0],
|
|
304
|
-
return [
|
|
321
|
+
const a = C[0], B = new T.Vector3(a.position.x - 0.5, a.position.y, a.position.z - 0.1), x = new T.Vector3(a.position.x + 0.5, a.position.y, a.position.z - 0.1);
|
|
322
|
+
return [B, x];
|
|
305
323
|
} else if (s) {
|
|
306
|
-
const a = new
|
|
307
|
-
return [a,
|
|
324
|
+
const a = new T.Vector3(s.x - 0.5, s.y, s.z - 0.1), B = new T.Vector3(s.x + 0.5, s.y, s.z - 0.1);
|
|
325
|
+
return [a, B];
|
|
308
326
|
}
|
|
309
327
|
return [];
|
|
310
328
|
}, [C, s]);
|
|
311
|
-
return
|
|
329
|
+
return F ? (
|
|
312
330
|
// "percentage" = PCFShadowMap; shadows={true} would make R3F set the removed PCFSoftShadowMap
|
|
313
|
-
/* @__PURE__ */ i.createElement(
|
|
331
|
+
/* @__PURE__ */ i.createElement(Ue, { gl: N, dpr: F, ref: y, shadows: "percentage" }, /* @__PURE__ */ i.createElement(ve, { iterations: 5, ms: 100, threshold: 0.75 }, /* @__PURE__ */ i.createElement(ft, { tonemapping: r, processedTier: w, inspector: g }), /* @__PURE__ */ i.createElement(gt, null), /* @__PURE__ */ i.createElement(Fe, { ref: qe, makeDefault: !0, fov: 28 }), /* @__PURE__ */ i.createElement(Le, { ref: z }), d && W.length && /* @__PURE__ */ i.createElement(ht, { points: W, color: "red" }), /* @__PURE__ */ i.createElement(fe, { fallback: null }, n)))
|
|
314
332
|
) : /* @__PURE__ */ i.createElement(i.Fragment, null);
|
|
315
|
-
},
|
|
316
|
-
const [r,
|
|
333
|
+
}, ft = ({ tonemapping: e, processedTier: t, inspector: n = !1 }) => {
|
|
334
|
+
const [r, g] = A(!1), { gl: s, scene: u, camera: b, size: C } = Ge(), [d] = A(new T.Vector3(-3, 2, 2)), [k] = A(new T.Vector3(0, 1, 0)), [E] = A(3.5), [w] = A(-2e-4), [R] = A(0.57), [v] = A(0.25), O = X(null), F = X(null);
|
|
317
335
|
return l(() => {
|
|
318
|
-
s && (s.shadowMap.type =
|
|
336
|
+
s && (s.shadowMap.type = T.PCFShadowMap, s.toneMapping = e, t !== "low" ? u.environmentIntensity = v : u.environmentIntensity = 1);
|
|
319
337
|
}, [s, e]), l(() => {
|
|
320
|
-
|
|
321
|
-
}, [
|
|
338
|
+
u.environmentIntensity = v;
|
|
339
|
+
}, [v]), l(() => {
|
|
322
340
|
if (!n || !s || r) return;
|
|
323
|
-
let
|
|
341
|
+
let h = !1;
|
|
324
342
|
return import("three/addons/inspector/Inspector.js").then(({ Inspector: y }) => {
|
|
325
|
-
|
|
343
|
+
h || (s.inspector = new y(), g(!0));
|
|
326
344
|
}).catch((y) => console.warn("Scene: could not load three's Inspector", y)), () => {
|
|
327
|
-
|
|
345
|
+
h = !0;
|
|
328
346
|
};
|
|
329
347
|
}, [n, s, r]), l(() => {
|
|
330
|
-
if (!s || !
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
|
|
348
|
+
if (!s || !u || !b || !t) return;
|
|
349
|
+
u.background = null;
|
|
350
|
+
const h = t === "high", y = { skinSSS: !1, inspector: n && r && !!s.inspector }, o = h ? Me(u, b, y) : Pe(u, b, y), { outputNode: z, scenePassColor: U, traaPass: M, giPass: f, ao: L, gi: N, hairAO: W, eyeAO: a } = o, B = new T.RenderPipeline(s);
|
|
351
|
+
if (B.outputNode = z, F.current = B, n && r && s.inspector) {
|
|
352
|
+
const x = () => {
|
|
353
|
+
B.needsUpdate = !0;
|
|
354
|
+
}, p = s.inspector.createParameters(h ? "SSGI + TRAA" : "TRAA");
|
|
355
|
+
if (h) {
|
|
356
|
+
const D = { output: 0, feedback: !1 }, ee = { Combined: 0, AO: 1, GI: 2, Direct: 3 };
|
|
357
|
+
p.add(D, "output", ee).name("output").onChange((Q) => {
|
|
340
358
|
const Y = Number(Q);
|
|
341
|
-
|
|
342
|
-
}),
|
|
343
|
-
f.beautyNode = Q ?
|
|
359
|
+
B.outputNode = Y === 1 ? oe(ze(L.r), 1) : Y === 2 ? oe(N.rgb, 1) : Y === 3 ? U : z, x();
|
|
360
|
+
}), p.add(f.sliceCount, "value", 1, 4, 1).name("slice count"), p.add(f.stepCount, "value", 1, 32, 1).name("step count"), p.add(f.radius, "value", 0.1, 2).name("radius"), p.add(f.expFactor, "value", 1e-3, 10).name("exp factor"), p.add(f.thickness, "value", 1e-3, 0.1).name("thickness"), p.add(f.backfaceLighting, "value", 0, 1).name("backface lighting"), p.add(f.aoIntensity, "value", 0, 4).name("AO intensity"), p.add(f.giIntensity, "value", 0, 20).name("GI intensity"), p.add(f, "resolutionScale", 0.25, 1).name("SSGI resolution scale"), p.add(W, "value", 0, 1).name("SSGI AO on hair"), p.add(a, "value", 0, 1).name("SSGI AO on eyes"), p.add(D, "feedback").name("SSGI 2nd bounce (TRAA history)").onChange((Q) => {
|
|
361
|
+
f.beautyNode = Q ? M.getHistoryTextureNode() : U, x();
|
|
344
362
|
});
|
|
345
363
|
}
|
|
346
|
-
|
|
364
|
+
p.add(M, "maxVelocityLength", 4, 128, 1).name("TRAA max velocity").onChange(x), p.add(M, "depthThreshold", 1e-4, 0.01).name("TRAA depth threshold").onChange(x), p.add(M, "edgeDepthDiff", 1e-4, 0.01).name("TRAA edge depth diff").onChange(x), p.add(M, "useSubpixelCorrection").name("TRAA subpixel correction").onChange(x), p.add(M.maskedMotionWeight, "value", 0, 1, 0.01).name("TRAA hair motion weight"), p.add(M.maskedClipWidening, "value", 0, 2, 0.05).name("TRAA hair clip widening (still)"), p.add(M.maskedClipFadeVelocity, "value", 0.05, 4, 0.05).name("TRAA hair clip fade (px/frame)");
|
|
347
365
|
}
|
|
348
366
|
return () => {
|
|
349
|
-
|
|
367
|
+
B.dispose(), F.current = null;
|
|
350
368
|
};
|
|
351
|
-
}, [s,
|
|
369
|
+
}, [s, u, b, t, n, r]), l(() => {
|
|
352
370
|
!s || !C || s.setSize(C.width, C.height);
|
|
353
|
-
}, [C]), ge(({ gl:
|
|
354
|
-
|
|
355
|
-
}, 1), /* @__PURE__ */ i.createElement(i.Fragment, null, t !== "low" && s && /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("directionalLight", { ref:
|
|
356
|
-
},
|
|
357
|
-
const n =
|
|
358
|
-
return ge((
|
|
359
|
-
const
|
|
360
|
-
deltaTime:
|
|
361
|
-
timestamp:
|
|
371
|
+
}, [C]), ge(({ gl: h, scene: y, camera: o }) => {
|
|
372
|
+
F.current && F.current.render();
|
|
373
|
+
}, 1), /* @__PURE__ */ i.createElement(i.Fragment, null, t !== "low" && s && /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("directionalLight", { ref: O, color: "white", position: d.toArray(), "target-position": k.toArray(), intensity: E, castShadow: !0, "shadow-mapSize-width": 1024, "shadow-mapSize-height": 1024, "shadow-bias": w, "shadow-normalBias": 3e-3, "shadow-intensity": 0.6, "shadow-radius": 2.5 }, /* @__PURE__ */ i.createElement("orthographicCamera", { attach: "shadow-camera", args: [-1, 1, 2, -0.5, 2, 5] })), t === "high" && /* @__PURE__ */ i.createElement("directionalLight", { name: "RimLight", color: "#fff4e8", position: [0.9, 2.3, -3.2], "target-position": [0, 1.6, 0], intensity: R })));
|
|
374
|
+
}, yt = ({ character: e, autoLookAt: t }) => {
|
|
375
|
+
const n = c((d) => d.characterState), r = V((d) => d.currentAUs), g = V((d) => d.currentGaze), s = V((d) => d.currentHeadPose), u = V((d) => d.lookAtCamera), b = P((d) => d.cameraPosition), C = V((d) => d.targets);
|
|
376
|
+
return ge((d, k) => {
|
|
377
|
+
const E = {
|
|
378
|
+
deltaTime: k,
|
|
379
|
+
timestamp: d.clock.oldTime,
|
|
362
380
|
AU: r,
|
|
363
|
-
gaze:
|
|
381
|
+
gaze: g,
|
|
364
382
|
headPose: s,
|
|
365
383
|
characterState: n,
|
|
366
|
-
lookAt:
|
|
384
|
+
lookAt: u ? b : void 0,
|
|
367
385
|
targets: C
|
|
368
386
|
};
|
|
369
|
-
e.update(
|
|
387
|
+
e.update(E);
|
|
370
388
|
}), l(() => {
|
|
371
389
|
if (t)
|
|
372
390
|
switch (n) {
|
|
373
|
-
case
|
|
374
|
-
case
|
|
391
|
+
case I.idle:
|
|
392
|
+
case I.waiting:
|
|
375
393
|
se(!1);
|
|
376
394
|
break;
|
|
377
|
-
case
|
|
378
|
-
case
|
|
395
|
+
case I.listening:
|
|
396
|
+
case I.speaking:
|
|
379
397
|
se(!0);
|
|
380
398
|
break;
|
|
381
399
|
}
|
|
382
400
|
else
|
|
383
401
|
se(!1);
|
|
384
402
|
}, [n, t]), l(() => {
|
|
385
|
-
|
|
403
|
+
$e(e);
|
|
386
404
|
}, [e]), null;
|
|
387
|
-
},
|
|
405
|
+
}, At = {
|
|
388
406
|
emotions: [],
|
|
389
|
-
currentTopEmotion:
|
|
407
|
+
currentTopEmotion: ue.Neutral,
|
|
390
408
|
useTopEmotionOnly: !0,
|
|
391
409
|
autoDecay: !1
|
|
392
|
-
}, j = J()(() =>
|
|
410
|
+
}, j = J()(() => At), jt = (e) => {
|
|
393
411
|
if (j.setState({ emotions: e || [] }), e != null && e.length) {
|
|
394
412
|
const t = e.reduce((n, r) => n.value > r.value ? n : r);
|
|
395
413
|
j.setState({ currentTopEmotion: t.emotion });
|
|
396
414
|
} else
|
|
397
|
-
j.setState({ currentTopEmotion:
|
|
398
|
-
},
|
|
415
|
+
j.setState({ currentTopEmotion: ue.Neutral });
|
|
416
|
+
}, Wt = (e) => {
|
|
399
417
|
j.setState({ useTopEmotionOnly: e });
|
|
400
|
-
},
|
|
418
|
+
}, $t = (e) => {
|
|
401
419
|
j.setState({ autoDecay: e });
|
|
402
|
-
},
|
|
403
|
-
const t =
|
|
420
|
+
}, Xt = (e) => {
|
|
421
|
+
const t = c.getState().FACSManager;
|
|
404
422
|
t == null || t.playFacialAnimation({ ...e });
|
|
405
|
-
},
|
|
423
|
+
}, qt = (e) => {
|
|
424
|
+
var t;
|
|
425
|
+
(t = c.getState().character) == null || t.liveBlendshapeManager.playLive(e);
|
|
426
|
+
}, Jt = () => {
|
|
427
|
+
var e;
|
|
428
|
+
(e = c.getState().character) == null || e.liveBlendshapeManager.stop();
|
|
429
|
+
}, bt = ({ animationsLoaded: e }) => {
|
|
406
430
|
const t = j((r) => r.emotions), n = j((r) => r.useTopEmotionOnly);
|
|
407
431
|
return l(() => {
|
|
408
|
-
e &&
|
|
432
|
+
e && et(Ee(t, { topOnly: n }));
|
|
409
433
|
}, [t, n, e]), null;
|
|
410
|
-
},
|
|
411
|
-
const
|
|
412
|
-
let
|
|
434
|
+
}, Qt = ({ url: e, type: t, animationsUrl: n, gender: r, speechSynthesis: g, camera: s, onLoadingCompleted: u, autoLookAt: b, breathing: C, disableAnimations: d, debug: k, inspector: E, enableBml: w, animationWeights: R, license: v, detectGpuData: O, environmentPreset: F = "apartment", tonemapping: h = T.NeutralToneMapping, targets: y, lipSyncFromAudio: o = !1, lipSyncAudio: z, lipSyncAudioContext: U }) => {
|
|
435
|
+
const M = c((S) => S.animationsLoaded), f = P((S) => S.defaultPositions), L = P((S) => S.defaultDistances), [N, W] = A(), [a, B] = A(null), [x, p] = A(), [D, ee] = A(!1), Q = async (S, K) => {
|
|
436
|
+
let H = null;
|
|
413
437
|
switch (t) {
|
|
414
438
|
case $.cc3:
|
|
415
|
-
|
|
439
|
+
H = new De(), p(ne.cc3);
|
|
416
440
|
break;
|
|
417
441
|
case $.avatarsdk:
|
|
418
|
-
|
|
442
|
+
H = new xe(), p(ne.avatarsdk);
|
|
419
443
|
break;
|
|
420
444
|
case $.avaturn:
|
|
421
|
-
|
|
445
|
+
H = new Be(), p(ne.avaturn);
|
|
422
446
|
break;
|
|
423
447
|
}
|
|
424
|
-
const Z = await
|
|
448
|
+
const Z = await H.loadAsync(S).catch((G) => console.warn("Error loading character : ", G));
|
|
425
449
|
if (Z && !K()) {
|
|
426
|
-
let
|
|
450
|
+
let G = null;
|
|
427
451
|
const te = {
|
|
428
452
|
mesh: Z,
|
|
429
453
|
onAnimationsLoaded: Y,
|
|
430
454
|
animationsUrl: n,
|
|
431
455
|
gender: r || "male",
|
|
432
456
|
type: t,
|
|
433
|
-
debug:
|
|
434
|
-
enableBmlManager: !!
|
|
435
|
-
animationWeights:
|
|
436
|
-
license:
|
|
457
|
+
debug: k,
|
|
458
|
+
enableBmlManager: !!w,
|
|
459
|
+
animationWeights: R,
|
|
460
|
+
license: v
|
|
437
461
|
};
|
|
438
462
|
switch (t) {
|
|
439
463
|
case $.cc3:
|
|
440
|
-
|
|
464
|
+
G = await ae.fromCharacterCreator(te);
|
|
441
465
|
break;
|
|
442
466
|
case $.avatarsdk:
|
|
443
|
-
|
|
467
|
+
G = await ae.fromAvatarSDK(te);
|
|
444
468
|
break;
|
|
445
469
|
case $.avaturn:
|
|
446
|
-
|
|
470
|
+
G = await ae.fromAvaturn(te);
|
|
447
471
|
break;
|
|
448
472
|
}
|
|
449
|
-
|
|
473
|
+
G && K() ? G.dispose() : G && B(G);
|
|
450
474
|
}
|
|
451
475
|
}, Y = () => {
|
|
452
476
|
ie(!0);
|
|
453
477
|
};
|
|
454
478
|
l(() => {
|
|
455
479
|
var S, K;
|
|
456
|
-
if (a &&
|
|
457
|
-
if (C === !1 && ((K = (S = a.animationManager) == null ? void 0 : S.disableBreathing) == null || K.call(S)),
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
480
|
+
if (a && M)
|
|
481
|
+
if (C === !1 && ((K = (S = a.animationManager) == null ? void 0 : S.disableBreathing) == null || K.call(S)), D) {
|
|
482
|
+
at(a.getAllAnimationNames()), st(a.getAllAnimations());
|
|
483
|
+
const H = setTimeout(() => {
|
|
484
|
+
u == null || u();
|
|
461
485
|
}, 1e3);
|
|
462
|
-
return () => clearTimeout(
|
|
486
|
+
return () => clearTimeout(H);
|
|
463
487
|
} else
|
|
464
|
-
|
|
465
|
-
}, [a,
|
|
466
|
-
|
|
488
|
+
pe();
|
|
489
|
+
}, [a, M, D]), l(() => {
|
|
490
|
+
_e(y || []);
|
|
467
491
|
}, [y]), l(() => {
|
|
468
492
|
ie(!1);
|
|
469
493
|
let S = !1;
|
|
470
|
-
return
|
|
494
|
+
return N !== void 0 && (N ? Q(e, () => S) : u == null || u()), () => {
|
|
471
495
|
S = !0;
|
|
472
496
|
};
|
|
473
|
-
}, [e,
|
|
497
|
+
}, [e, N]), l(() => () => {
|
|
474
498
|
a == null || a.dispose();
|
|
475
499
|
}, [a]), l(() => {
|
|
476
|
-
if (
|
|
500
|
+
if (D && L && f)
|
|
477
501
|
if (s) {
|
|
478
|
-
const S =
|
|
479
|
-
le(S),
|
|
502
|
+
const S = Te(s, L, f);
|
|
503
|
+
le(S), de(s.lookAt ? f[s.lookAt] : f.lowerbelly), Ze(!!s.movable);
|
|
480
504
|
} else {
|
|
481
505
|
const S = f.mouth.clone();
|
|
482
|
-
S.setComponent(2, L.farther), le(S),
|
|
506
|
+
S.setComponent(2, L.farther), le(S), de(f.lowerbelly);
|
|
483
507
|
}
|
|
484
|
-
}, [
|
|
485
|
-
|
|
486
|
-
}, [
|
|
487
|
-
|
|
488
|
-
}, [
|
|
489
|
-
a == null || a.lipSyncManager.setAudioSource(
|
|
490
|
-
}, [a,
|
|
491
|
-
const
|
|
492
|
-
if (a &&
|
|
508
|
+
}, [D, s, L, f]), l(() => {
|
|
509
|
+
g && (g.credentials && ot(g.credentials), g.voice && mt(g.voice));
|
|
510
|
+
}, [g]), l(() => {
|
|
511
|
+
ut(o);
|
|
512
|
+
}, [o]), l(() => {
|
|
513
|
+
a == null || a.lipSyncManager.setAudioSource(z ?? null, U);
|
|
514
|
+
}, [a, z, U]);
|
|
515
|
+
const pe = () => {
|
|
516
|
+
if (a && x) {
|
|
493
517
|
try {
|
|
494
|
-
const { center: S, dimensions: K, defaultPositions:
|
|
495
|
-
|
|
518
|
+
const { center: S, dimensions: K, defaultPositions: H, defaultDistances: Z } = Re(a);
|
|
519
|
+
Je(S), Xe(K), Qe(H), Ye(Z);
|
|
496
520
|
} catch (S) {
|
|
497
521
|
console.warn(S);
|
|
498
522
|
}
|
|
499
523
|
ee(!0);
|
|
500
524
|
}
|
|
501
525
|
};
|
|
502
|
-
return /* @__PURE__ */ i.createElement(
|
|
526
|
+
return /* @__PURE__ */ i.createElement(St, { parentGpuTier: O, setIsGpuAvailable: W, tonemapping: h, inspector: E }, N ? /* @__PURE__ */ i.createElement(i.Fragment, null, a && /* @__PURE__ */ i.createElement(yt, { character: a, autoLookAt: !!b }), a && /* @__PURE__ */ i.createElement(bt, { animationsLoaded: M }), a && /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(Ie, { preset: F }), /* @__PURE__ */ i.createElement("primitive", { object: a, castShadow: !0, receiveShadow: !0 }))) : /* @__PURE__ */ i.createElement(i.Fragment, null));
|
|
503
527
|
};
|
|
504
528
|
export {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
529
|
+
Qt as Character,
|
|
530
|
+
tn as CharacterState,
|
|
531
|
+
nn as CreationTool,
|
|
532
|
+
an as Distances,
|
|
533
|
+
_t as Object3D,
|
|
534
|
+
sn as Positions,
|
|
535
|
+
on as Rotations,
|
|
536
|
+
Gt as addBlendshape,
|
|
537
|
+
Ot as addSPPASViseme,
|
|
513
538
|
he as addViseme,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
539
|
+
rn as bmlTags,
|
|
540
|
+
cn as emotionList,
|
|
541
|
+
dt as flushBlendshapeData,
|
|
542
|
+
ct as flushLipSyncData,
|
|
543
|
+
Ft as getAnimationsMap,
|
|
544
|
+
Bt as getCameraPosition,
|
|
545
|
+
Rt as getCharacterHeight,
|
|
546
|
+
xt as getLookAt,
|
|
547
|
+
Ht as getVoices,
|
|
548
|
+
tt as lookAtAndKeep,
|
|
549
|
+
It as playAnimationByName,
|
|
550
|
+
Xt as playFacialAnimation,
|
|
551
|
+
qt as playLiveBlendshapes,
|
|
552
|
+
ln as presets,
|
|
553
|
+
nt as releaseLookAt,
|
|
554
|
+
$t as setAutoDecay,
|
|
555
|
+
Lt as setAutoPlay,
|
|
556
|
+
Ut as setBlendshapes,
|
|
529
557
|
le as setCameraPosition,
|
|
530
558
|
ce as setCharacterState,
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
559
|
+
et as setCurrentAUs,
|
|
560
|
+
Dt as setCurrentGaze,
|
|
561
|
+
Vt as setCurrentHeadPose,
|
|
562
|
+
rt as setCurrentUtterance,
|
|
563
|
+
jt as setEmotions,
|
|
564
|
+
ut as setLipSyncFromAudio,
|
|
537
565
|
se as setLookAtCamera,
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
566
|
+
Ze as setMovable,
|
|
567
|
+
vt as setShowFirstTarget,
|
|
568
|
+
Nt as setTextToSpeak,
|
|
569
|
+
Wt as setUseTopEmotionOnly,
|
|
570
|
+
Kt as setVisemeIntensity,
|
|
571
|
+
zt as setVisemes,
|
|
572
|
+
mt as setVoice,
|
|
573
|
+
Jt as stopLiveBlendshapes,
|
|
574
|
+
c as useCharacterStore
|
|
546
575
|
};
|
package/dist/models/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ToneMapping, Object3D } from 'three/webgpu';
|
|
2
|
-
import { CreationTool, AnimationWeight, AudioLipSyncSource, EmotionData, CameraPositionData, DefaultDistances, DefaultPositions } from '@davi-ai/bodyengine-three';
|
|
2
|
+
import { CreationTool, AnimationWeight, AudioLipSyncSource, BlendshapeFrame, EmotionData, CameraPositionData, DefaultDistances, DefaultPositions } from '@davi-ai/bodyengine-three';
|
|
3
3
|
interface SpeechSynthesisCredentials {
|
|
4
4
|
region?: string;
|
|
5
5
|
subscriptionKey?: string;
|
|
@@ -52,4 +52,6 @@ interface Position2D {
|
|
|
52
52
|
y: number;
|
|
53
53
|
}
|
|
54
54
|
type EnvironmentPreset = 'apartment' | 'city' | 'dawn' | 'forest' | 'lobby' | 'night' | 'park' | 'studio' | 'sunset' | 'warehouse';
|
|
55
|
-
|
|
55
|
+
/** ARKit blendshape keyframe (see BlendshapeManager). */
|
|
56
|
+
type BlendShapesData = BlendshapeFrame;
|
|
57
|
+
export type { CharacterProps, SpeechSynthesisCredentials, Position2D, DefaultPositions, DefaultDistances, CameraPositionData, EmotionData, EnvironmentPreset, BlendShapesData };
|
package/dist/stats.html
CHANGED
|
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {
|
|
|
4929
4929
|
</script>
|
|
4930
4930
|
<script>
|
|
4931
4931
|
/*<!--*/
|
|
4932
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"D:/a/1/s/packages/reactjs","children":[{"name":"node_modules/zustand/esm","children":[{"uid":"
|
|
4932
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"D:/a/1/s/packages/reactjs","children":[{"name":"node_modules/zustand/esm","children":[{"uid":"2df4bb2f-1","name":"vanilla.mjs"},{"uid":"2df4bb2f-3","name":"react.mjs"}]},{"name":"src","children":[{"name":"contexts","children":[{"uid":"2df4bb2f-5","name":"characterStore.ts"},{"uid":"2df4bb2f-7","name":"cameraStore.ts"},{"uid":"2df4bb2f-9","name":"headStore.ts"},{"uid":"2df4bb2f-11","name":"animationStore.ts"},{"uid":"2df4bb2f-13","name":"speechStore.ts"},{"uid":"2df4bb2f-23","name":"emotionStore.ts"}]},{"name":"components","children":[{"uid":"2df4bb2f-15","name":"SpeechManager.tsx"},{"uid":"2df4bb2f-17","name":"HorizontalLine.tsx"},{"uid":"2df4bb2f-19","name":"Scene.tsx"},{"name":"Controllers","children":[{"uid":"2df4bb2f-21","name":"CharacterController.ts"},{"uid":"2df4bb2f-25","name":"EmotionController.ts"}]},{"uid":"2df4bb2f-27","name":"Character.tsx"}]},{"uid":"2df4bb2f-29","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"2df4bb2f-1":{"renderedLength":975,"gzipLength":394,"brotliLength":353,"metaUid":"2df4bb2f-0"},"2df4bb2f-3":{"renderedLength":557,"gzipLength":282,"brotliLength":232,"metaUid":"2df4bb2f-2"},"2df4bb2f-5":{"renderedLength":2066,"gzipLength":439,"brotliLength":380,"metaUid":"2df4bb2f-4"},"2df4bb2f-7":{"renderedLength":1028,"gzipLength":293,"brotliLength":249,"metaUid":"2df4bb2f-6"},"2df4bb2f-9":{"renderedLength":1154,"gzipLength":359,"brotliLength":315,"metaUid":"2df4bb2f-8"},"2df4bb2f-11":{"renderedLength":854,"gzipLength":308,"brotliLength":274,"metaUid":"2df4bb2f-10"},"2df4bb2f-13":{"renderedLength":2354,"gzipLength":557,"brotliLength":499,"metaUid":"2df4bb2f-12"},"2df4bb2f-15":{"renderedLength":4196,"gzipLength":985,"brotliLength":896,"metaUid":"2df4bb2f-14"},"2df4bb2f-17":{"renderedLength":383,"gzipLength":251,"brotliLength":209,"metaUid":"2df4bb2f-16"},"2df4bb2f-19":{"renderedLength":11550,"gzipLength":3294,"brotliLength":2903,"metaUid":"2df4bb2f-18"},"2df4bb2f-21":{"renderedLength":1366,"gzipLength":442,"brotliLength":408,"metaUid":"2df4bb2f-20"},"2df4bb2f-23":{"renderedLength":1187,"gzipLength":412,"brotliLength":371,"metaUid":"2df4bb2f-22"},"2df4bb2f-25":{"renderedLength":398,"gzipLength":211,"brotliLength":184,"metaUid":"2df4bb2f-24"},"2df4bb2f-27":{"renderedLength":5785,"gzipLength":1605,"brotliLength":1419,"metaUid":"2df4bb2f-26"},"2df4bb2f-29":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"2df4bb2f-28"}},"nodeMetas":{"2df4bb2f-0":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/vanilla.mjs","moduleParts":{"index.js":"2df4bb2f-1"},"imported":[],"importedBy":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-2"}]},"2df4bb2f-2":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/react.mjs","moduleParts":{"index.js":"2df4bb2f-3"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-0"}],"importedBy":[{"uid":"2df4bb2f-35"}]},"2df4bb2f-4":{"id":"D:/a/1/s/packages/reactjs/src/contexts/characterStore.ts","moduleParts":{"index.js":"2df4bb2f-5"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-30"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-22"},{"uid":"2df4bb2f-10"},{"uid":"2df4bb2f-20"},{"uid":"2df4bb2f-14"}]},"2df4bb2f-6":{"id":"D:/a/1/s/packages/reactjs/src/contexts/cameraStore.ts","moduleParts":{"index.js":"2df4bb2f-7"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-32"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"}]},"2df4bb2f-8":{"id":"D:/a/1/s/packages/reactjs/src/contexts/headStore.ts","moduleParts":{"index.js":"2df4bb2f-9"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-6"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"},{"uid":"2df4bb2f-24"}]},"2df4bb2f-10":{"id":"D:/a/1/s/packages/reactjs/src/contexts/animationStore.ts","moduleParts":{"index.js":"2df4bb2f-11"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-4"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"}]},"2df4bb2f-12":{"id":"D:/a/1/s/packages/reactjs/src/contexts/speechStore.ts","moduleParts":{"index.js":"2df4bb2f-13"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-30"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-14"}]},"2df4bb2f-14":{"id":"D:/a/1/s/packages/reactjs/src/components/SpeechManager.tsx","moduleParts":{"index.js":"2df4bb2f-15"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-39"},{"uid":"2df4bb2f-30"}],"importedBy":[{"uid":"2df4bb2f-18"}]},"2df4bb2f-16":{"id":"D:/a/1/s/packages/reactjs/src/components/HorizontalLine.tsx","moduleParts":{"index.js":"2df4bb2f-17"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-32"}],"importedBy":[{"uid":"2df4bb2f-18"}]},"2df4bb2f-18":{"id":"D:/a/1/s/packages/reactjs/src/components/Scene.tsx","moduleParts":{"index.js":"2df4bb2f-19"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-32"},{"uid":"2df4bb2f-36"},{"uid":"2df4bb2f-30"},{"uid":"2df4bb2f-34"},{"uid":"2df4bb2f-37"},{"uid":"2df4bb2f-6"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-14"},{"uid":"2df4bb2f-16"},{"uid":"2df4bb2f-38","dynamic":true}],"importedBy":[{"uid":"2df4bb2f-26"}]},"2df4bb2f-20":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/CharacterController.ts","moduleParts":{"index.js":"2df4bb2f-21"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-30"},{"uid":"2df4bb2f-37"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-6"}],"importedBy":[{"uid":"2df4bb2f-26"}]},"2df4bb2f-22":{"id":"D:/a/1/s/packages/reactjs/src/contexts/emotionStore.ts","moduleParts":{"index.js":"2df4bb2f-23"},"imported":[{"uid":"2df4bb2f-35"},{"uid":"2df4bb2f-31"},{"uid":"2df4bb2f-4"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-24"}]},"2df4bb2f-24":{"id":"D:/a/1/s/packages/reactjs/src/components/Controllers/EmotionController.ts","moduleParts":{"index.js":"2df4bb2f-25"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-22"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-30"}],"importedBy":[{"uid":"2df4bb2f-26"}]},"2df4bb2f-26":{"id":"D:/a/1/s/packages/reactjs/src/components/Character.tsx","moduleParts":{"index.js":"2df4bb2f-27"},"imported":[{"uid":"2df4bb2f-33"},{"uid":"2df4bb2f-32"},{"uid":"2df4bb2f-30"},{"uid":"2df4bb2f-34"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-10"},{"uid":"2df4bb2f-6"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"},{"uid":"2df4bb2f-24"}],"importedBy":[{"uid":"2df4bb2f-28"}]},"2df4bb2f-28":{"id":"D:/a/1/s/packages/reactjs/src/index.ts","moduleParts":{"index.js":"2df4bb2f-29"},"imported":[{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-6"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-22"},{"uid":"2df4bb2f-10"},{"uid":"2df4bb2f-30"},{"uid":"2df4bb2f-31"},{"uid":"2df4bb2f-32"}],"importedBy":[],"isEntry":true},"2df4bb2f-30":{"id":"@davi-ai/bodyengine-three","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-31"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"},{"uid":"2df4bb2f-24"},{"uid":"2df4bb2f-14"}],"isExternal":true},"2df4bb2f-31":{"id":"D:/a/1/s/packages/reactjs/src/models/enums.ts","moduleParts":{},"imported":[{"uid":"2df4bb2f-30"}],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-22"}]},"2df4bb2f-32":{"id":"three/webgpu","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-28"},{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-6"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-16"}],"isExternal":true},"2df4bb2f-33":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"},{"uid":"2df4bb2f-24"},{"uid":"2df4bb2f-14"},{"uid":"2df4bb2f-16"},{"uid":"2df4bb2f-2"}],"isExternal":true},"2df4bb2f-34":{"id":"@react-three/drei","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-26"},{"uid":"2df4bb2f-18"}],"isExternal":true},"2df4bb2f-35":{"id":"D:/a/1/s/packages/reactjs/node_modules/zustand/esm/index.mjs","moduleParts":{},"imported":[{"uid":"2df4bb2f-0"},{"uid":"2df4bb2f-2"}],"importedBy":[{"uid":"2df4bb2f-4"},{"uid":"2df4bb2f-12"},{"uid":"2df4bb2f-6"},{"uid":"2df4bb2f-8"},{"uid":"2df4bb2f-22"},{"uid":"2df4bb2f-10"}]},"2df4bb2f-36":{"id":"three/tsl","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-18"}],"isExternal":true},"2df4bb2f-37":{"id":"@react-three/fiber","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-18"},{"uid":"2df4bb2f-20"}],"isExternal":true},"2df4bb2f-38":{"id":"three/addons/inspector/Inspector.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-18"}],"isExternal":true},"2df4bb2f-39":{"id":"@davi-ai/web-speech-cognitive-services-davi","moduleParts":{},"imported":[],"importedBy":[{"uid":"2df4bb2f-14"}],"isExternal":true}},"env":{"rollup":"4.65.0"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davi-ai/react-bodyengine-three",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "Reactjs layer to use animations in a threejs environment",
|
|
5
5
|
"author": "DAVI",
|
|
6
6
|
"licence": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "vite build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@davi-ai/bodyengine-three": "^1.0.
|
|
25
|
+
"@davi-ai/bodyengine-three": "^1.0.27",
|
|
26
26
|
"@davi-ai/web-speech-cognitive-services-davi": "^3.0.1",
|
|
27
27
|
"@react-three/drei": "^10.0.0",
|
|
28
28
|
"@react-three/fiber": "^9.0.0",
|