11 lines
33 KiB
JavaScript
11 lines
33 KiB
JavaScript
|
|
/*! (c) 2019-2025 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */
|
||
|
|
"use strict";var ze=Object.create;var $=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ge=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},fe=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!$e.call(o,r)&&r!==t&&$(o,r,{get:()=>e[r],enumerable:!(n=je(e,r))||n.enumerable});return o};var v=(o,e,t)=>(t=o!=null?ze(Ye(o)):{},fe(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),Xe=o=>fe($({},"__esModule",{value:!0}),o);var ee=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())});var Mt={};Ge(Mt,{VRMAnimation:()=>z,VRMAnimationLoaderPlugin:()=>J,VRMLookAtQuaternionProxy:()=>S,createVRMAnimationClip:()=>Fe,createVRMAnimationExpressionTracks:()=>de,createVRMAnimationHumanoidTracks:()=>he,createVRMAnimationLookAtTrack:()=>ce});module.exports=Xe(Mt);var Z=v(require("three"),1);var Ae=v(require("three"),1),O=v(require("three"),1),ie=v(require("three"),1),ke=v(require("three"),1),B=v(require("three"),1),D=v(require("three"),1),X=v(require("three"),1),Q=v(require("three"),1),w=v(require("three"),1),Ue=v(require("three"),1),ae=v(require("three"),1),M=v(require("three"),1),le=v(require("three"),1),R=v(require("three"),1),oe=v(require("three"),1),mt=v(require("three"),1);var H=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())}),ge=class extends Ae.Object3D{constructor(o){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${o}`,this.expressionName=o,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0<this.outputWeight?1:0:this.overrideBlink==="blend"?this.outputWeight:0}get overrideLookAtAmount(){return this.overrideLookAt==="block"?0<this.outputWeight?1:0:this.overrideLookAt==="blend"?this.outputWeight:0}get overrideMouthAmount(){return this.overrideMouth==="block"?0<this.outputWeight?1:0:this.overrideMouth==="blend"?this.outputWeight:0}get outputWeight(){return this.isBinary?this.weight>.5?1:0:this.weight}addBind(o){this._binds.push(o)}deleteBind(o){let e=this._binds.indexOf(o);e>=0&&this._binds.splice(e,1)}applyWeight(o){var e;let t=this.outputWeight;t*=(e=o==null?void 0:o.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(n=>n.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(o=>o.clearAppliedWeight())}};function Ke(o,e,t){var n,r;let i=o.parser.json,s=(n=i.nodes)==null?void 0:n[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let a=s.mesh;if(a==null)return null;let l=(r=i.meshes)==null?void 0:r[a];if(l==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let u=l.primitives.length,d=[];return t.traverse(f=>{d.length<u&&f.isMesh&&d.push(f)}),d}function Re(o,e){return H(this,null,function*(){let t=yield o.parser.getDependency("node",e);return Ke(o,e,t)})}var q={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function Ze(o){return Math.max(Math.min(o,1),0)}var Ee=class Le{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assig
|
||
|
|
/*!
|
||
|
|
* @pixiv/three-vrm-core v3.4.1
|
||
|
|
* The implementation of core features of VRM, for @pixiv/three-vrm
|
||
|
|
*
|
||
|
|
* Copyright (c) 2019-2025 pixiv Inc.
|
||
|
|
* @pixiv/three-vrm-core is distributed under MIT License
|
||
|
|
* https://github.com/pixiv/three-vrm/blob/release/LICENSE
|
||
|
|
*/
|