@liveroom-tech/react-immersive 6.1.3 → 6.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/dist/DownloadedEnvironment-NHM4U2LJ.mjs +1 -0
- package/dist/{SequencesTab-66VBWTO5.mjs → SequencesTab-VZKEKAUG.mjs} +1 -1
- package/dist/StreamingTilesModel-6Z7SIC2J.mjs +16 -0
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.d.mts +3 -3
- package/dist/binding-builder.d.ts +3 -3
- package/dist/binding-builder.js +59 -58
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-25WC5KDO.mjs +50 -0
- package/dist/chunk-2AJK643D.mjs +1 -0
- package/dist/chunk-3OCHN3CA.mjs +1 -0
- package/dist/chunk-7OVEHDDE.mjs +1 -0
- package/dist/chunk-KFLS7GI6.mjs +1 -0
- package/dist/{chunk-B75URXOE.mjs → chunk-KYXJG3TX.mjs} +1 -1
- package/dist/chunk-LD7QWHB4.mjs +3 -0
- package/dist/{chunk-LKKH4PO7.mjs → chunk-NMRTI3NQ.mjs} +1 -1
- package/dist/chunk-RKDATTUM.mjs +1 -0
- package/dist/chunk-RXZ4Q7CY.mjs +1 -0
- package/dist/chunk-TUYVYSN5.mjs +1 -0
- package/dist/chunk-UAZ6I25Y.mjs +1 -0
- package/dist/chunk-UCD76KQ6.mjs +1 -0
- package/dist/chunk-UHRJ2RBF.mjs +1 -0
- package/dist/chunk-UTVFRMYW.mjs +47 -0
- package/dist/chunk-YKDDNX2D.mjs +69 -0
- package/dist/exportSceneMesh-YJFOLFHS.mjs +1 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +4 -4
- package/dist/hosted.d.ts +4 -4
- package/dist/hosted.js +58 -57
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +52 -51
- package/dist/index.mjs +1 -1
- package/dist/meshFormats-4C6NHYOA.mjs +1 -0
- package/dist/{modelViewerProps-Bo48RDq6.d.ts → modelFileResolver-CVmON8hg.d.mts} +459 -895
- package/dist/{modelViewerProps-DkvYb1GH.d.mts → modelFileResolver-CVmON8hg.d.ts} +459 -895
- package/dist/modelViewerProps-BBnZTFO-.d.ts +949 -0
- package/dist/modelViewerProps-CIY4nsNY.d.mts +949 -0
- package/dist/{publicProps-DJSccx3b.d.ts → publicProps-BARVwXu7.d.ts} +2 -1
- package/dist/{publicProps-DN0-8tBm.d.mts → publicProps-n0Yvr_Km.d.mts} +2 -1
- package/dist/simple-model-viewer.css +1 -1
- package/dist/simple-model-viewer.d.mts +35 -4
- package/dist/simple-model-viewer.d.ts +35 -4
- package/dist/simple-model-viewer.js +5 -5
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +3 -3
- package/dist/utils.mjs +1 -1
- package/dist/xrRuntime-5S7KYUVB.mjs +1 -0
- package/package.json +7 -4
- package/dist/chunk-4RYMXBK6.mjs +0 -47
- package/dist/chunk-5P7ETEAN.mjs +0 -50
- package/dist/chunk-6Q6YZ7O5.mjs +0 -1
- package/dist/chunk-EC542N4J.mjs +0 -1
- package/dist/chunk-JK7GRGRG.mjs +0 -1
- package/dist/chunk-U3BQMOC3.mjs +0 -83
- package/dist/chunk-VMYNX63T.mjs +0 -3
- package/dist/modelFileResolver-B2B3F3d1.d.mts +0 -464
- package/dist/modelFileResolver-B2B3F3d1.d.ts +0 -464
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,c as B}from"./chunk-TUYVYSN5.mjs";import{a as x,f as v,h as T,i as w}from"./chunk-RXZ4Q7CY.mjs";import"./chunk-JR557W27.mjs";import{AnimationClip as $,Group as D,Matrix4 as A,Mesh as R,PropertyBinding as k,Quaternion as F,Scene as P,Vector3 as E}from"three";import{GLTFExporter as C,SkeletonUtils as U}from"three-stdlib";var G="reactImmersiveSkinFreeze",K=new Set(["position","quaternion","scale","morphTargetInfluences"]);function re({sources:o,downloadFilename:n,filenameSuffix:c="",onComplete:r}){let s=new P,p=[];try{for(let i of o){let t=W(i,o.length>1);if(o.length===1)s.name=t.sceneName,s.userData=t.sceneUserData,t.nodes.length&&s.add(...t.nodes);else{let l=new D;l.name=i.label??t.sceneName,t.nodes.length&&l.add(...t.nodes),s.add(l)}p.push(...t.animations)}}catch(i){console.error("GLB export failed:",i),r();return}new C().parse(s,i=>{let t=i instanceof ArrayBuffer?new Blob([i],{type:"model/gltf-binary"}):new Blob([JSON.stringify(i)],{type:"model/gltf+json"}),l=i instanceof ArrayBuffer?".glb":".gltf";I(t,`${n}${c}${l}`),r()},i=>{console.error("GLTFExporter error:",i),r()},{binary:!0,onlyVisible:!0,animations:p})}function W(o,n){let{root:c,clone:r,animations:s}=V(o,n);return r?{sceneName:r.name,sceneUserData:{...r.userData},nodes:L(c,r,s),animations:s}:{sceneName:o.scene.name,sceneUserData:{},nodes:[],animations:s}}function L(o,n,c){o.updateWorldMatrix(!0,!0);let r=n.matrixWorld.clone(),s=[...n.children],p=()=>(s.forEach(t=>n.remove(t)),s),u=new Set(c.flatMap(t=>t.tracks.map(l=>k.parseTrackName(l.name).nodeName)));if(u.has(n.uuid))return[o.children[0]];if(r.equals(_))return p();let i=[];for(let t of s){if(u.has(t.uuid))return[o.children[0]];t.updateMatrix();let l=r.clone().multiply(t.matrix),d=new E,b=new F,y=new E;l.decompose(d,b,y);let O=new A().compose(d,b,y);if(!z(O,l))return[o.children[0]];i.push(l)}return s.forEach((t,l)=>{i[l].decompose(t.position,t.quaternion,t.scale),t.matrix.copy(i[l])}),p()}var _=new A;function z(o,n){let c=Math.max(1,...n.elements.map(Math.abs));return o.elements.every((r,s)=>Math.abs(r-n.elements[s])<=1e-6*c)}function V({scene:o,objectBindings:n,matRefs:c,label:r},s){let p=new D;p.name=r??o.name??"";let u=new Map;for(let[e,a]of Object.entries(n))u.set(a.modelObjectId??e,e);let i=e=>{let a=e.name||e.uuid;return u.get(a)??a},t=e=>{let a=n[i(e)];return a?a.visible===!1:e.visible===!1};for(let e=o;e;e=e.parent)if(t(e))return{root:p,clone:null,animations:[]};o.updateWorldMatrix(!0,!0);let l=U.clone(o),d=new Map,b=[],y=[];o.traverse(e=>b.push(e)),l.traverse(e=>y.push(e)),b.forEach((e,a)=>d.set(e,y[a]));let O=[];for(let e=o.parent;e;e=e.parent)O.unshift(e);let g=p;for(let e of O){let a=N(e);g.add(a),g=a}g.add(l);let m=[],f=new Set;for(let e of b){let a=d.get(e);if(e.userData?.isWireframeOverlay){m.push(a);continue}delete a.userData[G];let j=a;if(j.isMesh){let M=c[i(e)];M&&(j.material=M)}(t(e)||e.parent&&f.has(e.parent))&&f.add(e),a.visible=!0}m.forEach(e=>e.removeFromParent());for(let e of f){let a=d.get(e);if(S(a,p)){if(!J(a)){a.removeFromParent();continue}if(a.isMesh){let j=N(a);j.name=a.name,j.userData=a.userData;for(let M of[...a.children])j.add(M);a.parent.add(j),a.removeFromParent(),d.set(e,j)}}}let h=Q(o,p,d,s&&r?`${r}: `:"");return h.length===0?H(b,d,p):Y(b,d,p,h),{root:p,clone:l,animations:h}}function N(o){let n=new D;return n.position.copy(o.position),n.quaternion.copy(o.quaternion),n.scale.copy(o.scale),n.matrix.copy(o.matrix),n.matrixAutoUpdate=o.matrixAutoUpdate,n}function Y(o,n,c,r){let s=r.map(p=>[...p.tracks]);for(let p of o){let u=v(p),i=n.get(p);if(!u||!x(i)||!S(i,c))continue;let t=i,l=new Set;for(let m of t.skeleton.bones)for(let f=m;f&&(l.add(f),f!==c);f=f.parent);let d=new Map,b=m=>{let f=m.isBone?m.clone(!1):N(m);d.set(m.uuid,f);for(let h of m.children)l.has(h)&&f.add(b(h));return f},y=b(c),O=new D,g=O;for(let m of[...u].reverse()){let f=new D;m.decompose(f.position,f.quaternion,f.scale);let h=new D;h.scale.set(1/f.scale.x,1/f.scale.y,1/f.scale.z);let e=new D;e.quaternion.copy(f.quaternion).invert();let a=new D;a.position.copy(f.position).negate(),g.add(h),h.add(e),e.add(a),g=a}g.add(y),t.add(O),t.skeleton.bones=t.skeleton.bones.map(m=>d.get(m.uuid)),r.forEach((m,f)=>{for(let h of s[f]){let e=k.parseTrackName(h.name);if(e.propertyName==="morphTargetInfluences")continue;let a=d.get(e.nodeName);if(!a)continue;let j=h.clone();j.name=q(a.uuid,e),m.tracks.push(j)}})}}function H(o,n,c){c.updateWorldMatrix(!0,!0);for(let r of o){let s=n.get(r);if(!x(r)||!x(s)||!s.parent||!S(s,c))continue;let p=s,u=new R(T(r),p.material);u.name=p.name,u.userData=p.userData,u.matrix.copy(s.parent.matrixWorld).invert().multiply(w(r)),u.matrixAutoUpdate=!1,u.matrix.decompose(u.position,u.quaternion,u.scale);let i=s.parent;i.children.splice(i.children.indexOf(s),1,u),u.parent=i,s.parent=null,u.updateMatrixWorld(!0);for(let t of[...s.children])u.attach(t)}}function J(o){let n=!1;return o.traverse(c=>{c.isBone&&(n=!0)}),n}function S(o,n){for(let c=o;c;c=c.parent)if(c===n)return!0;return!1}function Q(o,n,c,r){let s=[];for(let p of o.animations??[]){let u=[];for(let i of p.tracks){let t=k.parseTrackName(i.name);if(!K.has(t.propertyName))continue;let l=k.findNode(o,t.nodeName);if(t.objectName){if(t.objectName!=="bones"||!l||!x(l))continue;l=l.skeleton.getBoneByName(t.objectIndex)??null,t.objectName="",t.objectIndex=""}let d=l?c.get(l):void 0;if(!d||!S(d,n)||t.propertyName==="morphTargetInfluences"&&!d.morphTargetInfluences)continue;Z(l,d,t.propertyName);let b=i.clone();b.name=q(d.uuid,t),u.push(b)}u.length!==0&&s.push(new $(`${r}${p.name}`,p.duration,u,p.blendMode))}return s}function Z(o,n,c){let r=B(o);r&&(c==="position"?n.position.copy(r.position):c==="quaternion"?n.quaternion.copy(r.quaternion):c==="scale"?n.scale.copy(r.scale):c==="morphTargetInfluences"&&r.morphTargetInfluences&&n.morphTargetInfluences?.length===r.morphTargetInfluences.length&&(n.morphTargetInfluences=[...r.morphTargetInfluences]))}function q(o,n){let c=n.objectName?`.${n.objectName}${n.objectIndex!==void 0?`[${n.objectIndex}]`:""}`:"",r=n.propertyIndex!==void 0?`[${n.propertyIndex}]`:"";return`${o}${c}.${n.propertyName}${r}`}export{re as exportSceneMesh};
|