PageSourceSearch

https://tesana.com/assets/AnimationBakerPage-CUUj33h9.js

js tesana.com collected 2026-10-09 22:40:04 UTC 2,932 bytes, 1 lines download raw bytes

1import{j as o}from"./vendor-motion-hRg_q8lq.js";import{b as C,d as _,r as l}from"./vendor-react-E98sgxjj.js";import{C as A,L as R,A as v}from"./vendor-three-Cz2JVrfJ.js";import{c as E,C as T}from"./libraryAssets-BbcE5eh7.js";import{u as S}from"./Gltf-kFBePvvf.js";import{u as x}from"./useAnimations-CPqp3P7o.js";const M=384,k=24,O=2,F=1,y="#161616",L=-.02,I=0,P=[1.2,.4,2.4],j=30;function q(){const{clipKey:a=""}=C(),n=decodeURIComponent(a),[e]=_(),t=Math.max(32,parseInt(e.get("size")??"",10)||M),i=Math.max(1,parseInt(e.get("fps")??"",10)||k),m=Math.max(.25,parseFloat(e.get("seconds")??"")||O),c=Math.max(.05,parseFloat(e.get("rate")??"")||F);return l.useEffect(()=>{window.__bakeReady=!1,window.__captureClipWebm=async()=>B({fps:i,durationMs:Math.round(m*1e3)})},[i,m]),n?o.jsx("div",{"data-bake-page":!0,style:{width:t,height:t,margin:0,background:y,overflow:"hidden"},children:o.jsxs(A,{camera:{position:P,fov:j},gl:{antialias:!0,preserveDrawingBuffer:!0},style:{width:t,height:t},children:[o.jsx("color",{attach:"background",args:[y]}),o.jsx("ambientLight",{intensity:.7}),o.jsx("directionalLight",{position:[-3,4,4],intensity:1.6}),o.jsx("directionalLight",{position:[3,2,2],intensity:.4}),o.jsx(D,{clipKey:n,rate:c})]})}):o.jsx("div",{style:{padding:24,color:"red"},children:"Missing clipKey URL param."})}function D({clipKey:a,rate:n}){const{scene:e,animations:t}=S(T),i=l.useMemo(()=>E(e),[e]),m=l.useMemo(()=>U(t),[t]),{actions:c,mixer:s}=x(m,i);return l.useEffect(()=>{const d=c[a];if(!d){console.error(`[BakerPage] clip "${a}" not in actions`);return}s.timeScale=n,d.reset().setLoop(R,1/0).fadeIn(0).play();const p=window.setTimeout(()=>{window.__bakeReady=!0},250);return()=>{window.clearTimeout(p),d.fadeOut(0),s.timeScale=1}},[c,a,s,n]),o.jsx("group",{position:[I,L,0],rotation:[0,Math.PI,0],children:o.jsx("primitive",{object:i})})}function U(a){const n=new Set(["Hips.position","Armature.position"]);return a.map(e=>new v(e.name,e.duration,e.tracks.filter(t=>!n.has(t.name))))}async function B({fps:a,durationMs:n}){const e=Date.now();for(;!window.__bakeReady;){if(Date.now()-e>3e4)throw new Error("bake page never signalled ready");await K(50)}const t=document.querySelector("[data-bake-page] canvas");if(!t)throw new Error("bake canvas not found");const i=t.captureStream(a),c=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"].find(p=>MediaRecorder.isTypeSupported(p))??"video/webm",s=new MediaRecorder(i,{mimeType:c}),d=[];return new Promise((p,w)=>{s.ondataavailable=r=>{r.data&&r.data.size>0&&d.push(r.data)},s.onstop=async()=>{try{const g=await new Blob(d,{type:c}).arrayBuffer(),f=new Uint8Array(g);let h="";const b=32768;for(let u=0;u<f.length;u+=b)h+=String.fromCharCode.apply(null,Array.from(f.subarray(u,Math.min(u+b,f.length))));p(btoa(h))}catch(r){w(r)}},s.onerror=r=>w(r),s.start(),setTimeout(()=>s.stop(),n)})}function K(a){return new Promise(n=>setTimeout(n,a))}export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.