metamaker-for-three 0.1.17 → 0.1.19
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/examples/example.ts +19 -13
- package/libs/metamaker-for-three.js +1 -1
- package/package.json +2 -1
- package/src/lib/Env.ts +6 -0
- package/src/lib/core/index.ts +202 -25
- package/src/lib/core/utils/ResetMaterial.ts +257 -257
- package/src/lib/core/utils/convert.ts +140 -13
- package/src/lib/core/utils/downloadAnimation.ts +21 -7
- package/src/lib/index.ts +2 -0
- package/types/core/index.d.ts +8 -2
- package/types/core/utils/ResetMaterial.d.ts +1 -2
- package/types/core/utils/convert.d.ts +4 -0
package/examples/example.ts
CHANGED
|
@@ -433,19 +433,22 @@ async function replaceIdol(opts: string | Uint8Array) {
|
|
|
433
433
|
idol = await MMFT.core.parseGLTFModel(idolBuffer.buffer);
|
|
434
434
|
} else {
|
|
435
435
|
idol = await MMFT.core.parseGLTFModel(opts.buffer);
|
|
436
|
+
idol.scale.x = 5;
|
|
437
|
+
idol.scale.y = 5;
|
|
438
|
+
idol.scale.z = 5;
|
|
436
439
|
}
|
|
437
440
|
// MMFT.ClothPhysics.ClothPhysicManagerInstance.setClothPhysics(idol);
|
|
438
441
|
|
|
439
|
-
idol.traverse((child) => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
});
|
|
442
|
+
// idol.traverse((child) => {
|
|
443
|
+
// if (child.type == "Mesh" || child.type == "SkinnedMesh") {
|
|
444
|
+
|
|
445
|
+
// const anyTing: any = child;
|
|
446
|
+
// anyTing.material.envMapIntensity = 0.3;
|
|
447
|
+
// anyTing.material.needsUpdate = true;
|
|
448
|
+
// child.castShadow = true;
|
|
449
|
+
// child.receiveShadow = true;
|
|
450
|
+
// }
|
|
451
|
+
// });
|
|
449
452
|
MMFT.core.resetPolygonOffset(idol, camera);
|
|
450
453
|
mixer = new THREE.AnimationMixer(idol);
|
|
451
454
|
scene.add(idol);
|
|
@@ -522,9 +525,10 @@ async function handleTTS(audio, teeth, emo) {
|
|
|
522
525
|
*/
|
|
523
526
|
async function fetchTTSToAnim(text: string) {
|
|
524
527
|
const tts = {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
+
speed: 50,
|
|
529
|
+
volume: 50,
|
|
530
|
+
anim_agent: "mms",
|
|
531
|
+
voice_name: "zh-CN-YunyangNeural",
|
|
528
532
|
};
|
|
529
533
|
let response: any = await fetch("//open.metamaker.cn/api/openmm/v1/text_to_anim", {
|
|
530
534
|
method: "post",
|
|
@@ -711,3 +715,5 @@ makeSignCode();
|
|
|
711
715
|
setInterval(() => {
|
|
712
716
|
makeSignCode();
|
|
713
717
|
}, 60 * 1000 * 10);
|
|
718
|
+
|
|
719
|
+
MMFT.Env.TTSAnimationRatio = 1.5;
|