@liveroom-tech/react-immersive 6.2.1 → 6.2.3

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.
Files changed (71) hide show
  1. package/README.md +23 -0
  2. package/dist/AnimationsTab-IKAAKT3P.mjs +1 -0
  3. package/dist/AnnotationsTab-NEJIXCOM.mjs +1 -0
  4. package/dist/CinematicTab-TIQXCPFE.mjs +1 -0
  5. package/dist/ConfigureTab-NYRMOFW4.mjs +6 -0
  6. package/dist/RulesTab-2U4MFYOZ.mjs +1 -0
  7. package/dist/SequencesTab-JZEE5WAM.mjs +1 -0
  8. package/dist/SequencesTab-O7USMDFP.css +1 -0
  9. package/dist/{StreamingTilesModel-6Z7SIC2J.mjs → StreamingTilesModel-IM2DDWO5.mjs} +1 -1
  10. package/dist/binding-builder.css +1 -1
  11. package/dist/binding-builder.d.mts +3 -3
  12. package/dist/binding-builder.d.ts +3 -3
  13. package/dist/binding-builder.js +45 -45
  14. package/dist/binding-builder.mjs +1 -1
  15. package/dist/chunk-37QOMZW6.mjs +1 -0
  16. package/dist/{chunk-NMRTI3NQ.mjs → chunk-3GA7JFNH.mjs} +1 -1
  17. package/dist/chunk-3I7PPFUV.mjs +1 -0
  18. package/dist/chunk-3PLML3PO.mjs +1 -0
  19. package/dist/chunk-5C4H7SRF.mjs +1 -0
  20. package/dist/chunk-CHMFH4D4.mjs +1 -0
  21. package/dist/chunk-CUDL77ZY.mjs +1 -0
  22. package/dist/{chunk-UTVFRMYW.mjs → chunk-IEKGBS46.mjs} +2 -2
  23. package/dist/chunk-LU3BQ7WG.mjs +69 -0
  24. package/dist/chunk-QZNUWZG7.mjs +50 -0
  25. package/dist/{chunk-3OCHN3CA.mjs → chunk-SOAUR4DL.mjs} +1 -1
  26. package/dist/chunk-SXN3YYD3.mjs +1 -0
  27. package/dist/chunk-TI2YXAHW.mjs +3 -0
  28. package/dist/exportSceneMesh-MSQIMBFF.mjs +1 -0
  29. package/dist/hosted.css +1 -1
  30. package/dist/hosted.d.mts +5 -3
  31. package/dist/hosted.d.ts +5 -3
  32. package/dist/hosted.js +44 -44
  33. package/dist/hosted.mjs +1 -1
  34. package/dist/index.css +1 -1
  35. package/dist/index.d.mts +8 -4
  36. package/dist/index.d.ts +8 -4
  37. package/dist/index.js +42 -42
  38. package/dist/index.mjs +1 -1
  39. package/dist/{modelFileResolver-CVmON8hg.d.mts → modelFileResolver-An1aQ0D3.d.mts} +42 -29
  40. package/dist/{modelFileResolver-CVmON8hg.d.ts → modelFileResolver-An1aQ0D3.d.ts} +42 -29
  41. package/dist/{modelViewerProps-BBnZTFO-.d.ts → modelViewerProps-BnVflYRA.d.mts} +22 -3
  42. package/dist/{modelViewerProps-CIY4nsNY.d.mts → modelViewerProps-H_K454u_.d.ts} +22 -3
  43. package/dist/{publicProps-BARVwXu7.d.ts → publicProps-AdNUI06n.d.ts} +1 -1
  44. package/dist/{publicProps-n0Yvr_Km.d.mts → publicProps-BOQBJBA_.d.mts} +1 -1
  45. package/dist/simple-model-viewer.css +1 -1
  46. package/dist/simple-model-viewer.d.mts +6 -2
  47. package/dist/simple-model-viewer.d.ts +6 -2
  48. package/dist/simple-model-viewer.js +5 -5
  49. package/dist/simple-model-viewer.mjs +1 -1
  50. package/dist/utils.d.mts +4 -4
  51. package/dist/utils.d.ts +4 -4
  52. package/dist/utils.js +15 -15
  53. package/dist/utils.mjs +1 -1
  54. package/package.json +7 -5
  55. package/dist/AnimationsTab-NUJTEMZ5.mjs +0 -1
  56. package/dist/AnnotationsTab-OHRVWRKI.mjs +0 -1
  57. package/dist/CinematicTab-IJAY2BS6.mjs +0 -1
  58. package/dist/ConfigureTab-UQRRATCY.mjs +0 -6
  59. package/dist/RulesTab-YVBZGJZX.mjs +0 -1
  60. package/dist/SequencesTab-IC5LWQ6N.css +0 -1
  61. package/dist/SequencesTab-VZKEKAUG.mjs +0 -1
  62. package/dist/chunk-25WC5KDO.mjs +0 -50
  63. package/dist/chunk-7OVEHDDE.mjs +0 -1
  64. package/dist/chunk-AL6UIGWP.mjs +0 -1
  65. package/dist/chunk-KYXJG3TX.mjs +0 -1
  66. package/dist/chunk-LD7QWHB4.mjs +0 -3
  67. package/dist/chunk-RKDATTUM.mjs +0 -1
  68. package/dist/chunk-UAZ6I25Y.mjs +0 -1
  69. package/dist/chunk-UHRJ2RBF.mjs +0 -1
  70. package/dist/chunk-YKDDNX2D.mjs +0 -69
  71. package/dist/exportSceneMesh-YJFOLFHS.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{a as B,c as E}from"./chunk-TUYVYSN5.mjs";import{a as M,f as w,h as N,i as I}from"./chunk-RXZ4Q7CY.mjs";import"./chunk-JR557W27.mjs";import{AnimationClip as F,Group as x,Matrix4 as q,Mesh as P,PropertyBinding as k,Quaternion as C,Scene as U,Vector3 as A}from"three";import{GLTFExporter as G,SkeletonUtils as K}from"three-stdlib";var W="reactImmersiveSkinFreeze",L=new Set(["position","quaternion","scale","morphTargetInfluences"]);function se({sources:n,downloadFilename:e,filenameSuffix:a="",onComplete:r}){let s=new U,c=[];try{for(let l of n){let t=_(l,n.length>1);if(n.length===1)s.name=t.sceneName,s.userData=t.sceneUserData,t.nodes.length&&s.add(...t.nodes);else{let i=new x;i.name=l.label??t.sceneName,t.nodes.length&&i.add(...t.nodes),s.add(i)}c.push(...t.animations)}}catch(l){console.error("GLB export failed:",l),r();return}new G().parse(s,l=>{let t=l instanceof ArrayBuffer?new Blob([l],{type:"model/gltf-binary"}):new Blob([JSON.stringify(l)],{type:"model/gltf+json"}),i=l instanceof ArrayBuffer?".glb":".gltf";B(t,`${e}${a}${i}`),r()},l=>{console.error("GLTFExporter error:",l),r()},{binary:!0,onlyVisible:!0,animations:c})}function _(n,e){let{root:a,clone:r,animations:s}=H(n,e);return r?{sceneName:r.name,sceneUserData:{...r.userData},nodes:z(a,r,s),animations:s}:{sceneName:n.scene.name,sceneUserData:{},nodes:[],animations:s}}function z(n,e,a){n.updateWorldMatrix(!0,!0);let r=e.matrixWorld.clone(),s=[...e.children],c=()=>(s.forEach(t=>e.remove(t)),s),p=new Set(a.flatMap(t=>t.tracks.map(i=>k.parseTrackName(i.name).nodeName)));if(p.has(e.uuid))return[n.children[0]];if(r.equals(V))return c();let l=[];for(let t of s){if(p.has(t.uuid))return[n.children[0]];t.updateMatrix();let i=r.clone().multiply(t.matrix),f=new A,b=new C,h=new A;i.decompose(f,b,h);let D=new q().compose(f,b,h);if(!Y(D,i))return[n.children[0]];l.push(i)}return s.forEach((t,i)=>{l[i].decompose(t.position,t.quaternion,t.scale),t.matrix.copy(l[i])}),c()}var V=new q;function Y(n,e){let a=Math.max(1,...e.elements.map(Math.abs));return n.elements.every((r,s)=>Math.abs(r-e.elements[s])<=1e-6*a)}function H({scene:n,objectBindings:e,matRefs:a,label:r},s){let c=new x;c.name=r??n.name??"";let p=new Map;for(let[o,u]of Object.entries(e))p.set(u.modelObjectId??o,o);let l=o=>{let u=o.name||o.uuid;return p.get(u)??u},t=o=>{let u=e[l(o)];return u?u.visible===!1:o.visible===!1};for(let o=n;o;o=o.parent)if(t(o))return{root:c,clone:null,animations:[]};n.updateWorldMatrix(!0,!0);let i=K.clone(n),f=new Map,b=[],h=[];n.traverse(o=>b.push(o)),i.traverse(o=>h.push(o)),b.forEach((o,u)=>f.set(o,h[u]));let D=[];for(let o=n.parent;o;o=o.parent)D.unshift(o);let O=c;for(let o of D){let u=v(o);O.add(u),O=u}O.add(i);let m=new Map,d=[],y=new Set;for(let o of b){let u=f.get(o);if(o.userData?.isWireframeOverlay){d.push(u);continue}delete u.userData[W];let g=u;if(g.isMesh){let S=a[l(o)];g.material=R(S??g.material,m)}(t(o)||o.parent&&y.has(o.parent))&&y.add(o),u.visible=!0}d.forEach(o=>o.removeFromParent());for(let o of y){let u=f.get(o);if(T(u,c)){if(!Z(u)){u.removeFromParent();continue}if(u.isMesh){let g=v(u);g.name=u.name,g.userData=u.userData;for(let S of[...u.children])g.add(S);u.parent.add(g),u.removeFromParent(),f.set(o,g)}}}let j=X(n,c,f,s&&r?`${r}: `:"");return j.length===0?Q(b,f,c):J(b,f,c,j),{root:c,clone:i,animations:j}}function R(n,e){if(Array.isArray(n))return n.map(p=>R(p,e));let a=n,r=e.get(a);if(r)return r;let s=null;for(let[p,l]of Object.entries(a)){let t=l;if(!t?.isTexture||t.center.x===0&&t.center.y===0)continue;let{offset:i,repeat:f,rotation:b,center:h}=t,D=Math.cos(b),O=Math.sin(b),m=t.clone();m.center.set(0,0),m.offset.set(-f.x*(D*h.x+O*h.y)+h.x+i.x,-f.y*(-O*h.x+D*h.y)+h.y+i.y),s??(s=a.clone()),s[p]=m}let c=s??a;return e.set(a,c),c}function v(n){let e=new x;return e.position.copy(n.position),e.quaternion.copy(n.quaternion),e.scale.copy(n.scale),e.matrix.copy(n.matrix),e.matrixAutoUpdate=n.matrixAutoUpdate,e}function J(n,e,a,r){let s=r.map(c=>[...c.tracks]);for(let c of n){let p=w(c),l=e.get(c);if(!p||!M(l)||!T(l,a))continue;let t=l,i=new Set;for(let m of t.skeleton.bones)for(let d=m;d&&(i.add(d),d!==a);d=d.parent);let f=new Map,b=m=>{let d=m.isBone?m.clone(!1):v(m);f.set(m.uuid,d);for(let y of m.children)i.has(y)&&d.add(b(y));return d},h=b(a),D=new x,O=D;for(let m of[...p].reverse()){let d=new x;m.decompose(d.position,d.quaternion,d.scale);let y=new x;y.scale.set(1/d.scale.x,1/d.scale.y,1/d.scale.z);let j=new x;j.quaternion.copy(d.quaternion).invert();let o=new x;o.position.copy(d.position).negate(),O.add(y),y.add(j),j.add(o),O=o}O.add(h),t.add(D),t.skeleton.bones=t.skeleton.bones.map(m=>f.get(m.uuid)),r.forEach((m,d)=>{for(let y of s[d]){let j=k.parseTrackName(y.name);if(j.propertyName==="morphTargetInfluences")continue;let o=f.get(j.nodeName);if(!o)continue;let u=y.clone();u.name=$(o.uuid,j),m.tracks.push(u)}})}}function Q(n,e,a){a.updateWorldMatrix(!0,!0);for(let r of n){let s=e.get(r);if(!M(r)||!M(s)||!s.parent||!T(s,a))continue;let c=s,p=new P(N(r),c.material);p.name=c.name,p.userData=c.userData,p.matrix.copy(s.parent.matrixWorld).invert().multiply(I(r)),p.matrixAutoUpdate=!1,p.matrix.decompose(p.position,p.quaternion,p.scale);let l=s.parent;l.children.splice(l.children.indexOf(s),1,p),p.parent=l,s.parent=null,p.updateMatrixWorld(!0);for(let t of[...s.children])p.attach(t)}}function Z(n){let e=!1;return n.traverse(a=>{a.isBone&&(e=!0)}),e}function T(n,e){for(let a=n;a;a=a.parent)if(a===e)return!0;return!1}function X(n,e,a,r){let s=[];for(let c of n.animations??[]){let p=[];for(let l of c.tracks){let t=k.parseTrackName(l.name);if(!L.has(t.propertyName))continue;let i=k.findNode(n,t.nodeName);if(t.objectName){if(t.objectName!=="bones"||!i||!M(i))continue;i=i.skeleton.getBoneByName(t.objectIndex)??null,t.objectName="",t.objectIndex=""}let f=i?a.get(i):void 0;if(!f||!T(f,e)||t.propertyName==="morphTargetInfluences"&&!f.morphTargetInfluences)continue;ee(i,f,t.propertyName);let b=l.clone();b.name=$(f.uuid,t),p.push(b)}p.length!==0&&s.push(new F(`${r}${c.name}`,c.duration,p,c.blendMode))}return s}function ee(n,e,a){let r=E(n);r&&(a==="position"?e.position.copy(r.position):a==="quaternion"?e.quaternion.copy(r.quaternion):a==="scale"?e.scale.copy(r.scale):a==="morphTargetInfluences"&&r.morphTargetInfluences&&e.morphTargetInfluences?.length===r.morphTargetInfluences.length&&(e.morphTargetInfluences=[...r.morphTargetInfluences]))}function $(n,e){let a=e.objectName?`.${e.objectName}${e.objectIndex!==void 0?`[${e.objectIndex}]`:""}`:"",r=e.propertyIndex!==void 0?`[${e.propertyIndex}]`:"";return`${n}${a}.${e.propertyName}${r}`}export{se as exportSceneMesh};