clipoox-render 0.4.1 → 0.4.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.
- package/package.json +1 -1
- package/scripts/render-local.mjs +1322 -1320
- package/web/assets/{FxEmbed-CGqGi2Lw.js → FxEmbed-BCmj9Q5C.js} +1 -1
- package/web/assets/{MotionEmbed-C3CZ3_y_.js → MotionEmbed-CEmbcq8Z.js} +1 -1
- package/web/assets/PluginStore-C5hyahvG.js +3 -0
- package/web/assets/{ShotComposer-DFfaYLoV.js → ShotComposer-0DUtMTVI.js} +4 -4
- package/web/assets/{TemplateEmbed-C8pXcPsc.js → TemplateEmbed-ANxSs7H5.js} +1 -1
- package/web/assets/{TimelinePlugins-DnkV3i4G.js → TimelinePlugins-BYZ9y4m3.js} +4 -4
- package/web/assets/{TimelinePlugins-DYarX9RK.css → TimelinePlugins-D841ngau.css} +1 -1
- package/web/assets/{TimelineShotFx-foiuuogg.js → TimelineShotFx-q5PQwq-V.js} +2 -2
- package/web/assets/{TransitionEmbed-BueDilY0.js → TransitionEmbed-O6LInGWq.js} +1 -1
- package/web/assets/{Whiteboard-zBsNHh5h.js → Whiteboard-BP_DvIAV.js} +1 -1
- package/web/assets/{aerial-z34Nww_T.js → aerial-CGLDKKtP.js} +2 -2
- package/web/assets/{agentTools-ALxghYpf.js → agentTools-2Ghb80VH.js} +2 -2
- package/web/assets/{analyzerRun-DNwryAlU.js → analyzerRun-DRgxrcJA.js} +1 -1
- package/web/assets/{analyzerSandbox-A1oFsCrO.js → analyzerSandbox-DuIVFnsk.js} +1 -1
- package/web/assets/{api-DUp403BK.js → api-CJ8PdbfZ.js} +5 -5
- package/web/assets/{auraTrack-BKVZCwNt.js → auraTrack-DQw9sVU6.js} +1 -1
- package/web/assets/{breakthrough-Cwt8gEwK.js → breakthrough-BNj_iTDr.js} +2 -2
- package/web/assets/{cameraPresets-DSOPj4oy.js → cameraPresets-CYw0OdM3.js} +1 -1
- package/web/assets/{captionLayout-EuB59pN_.js → captionLayout-DvDPTwO9.js} +1 -1
- package/web/assets/{clientExport-BL1XMTF0.js → clientExport-xhoXY6Dh.js} +1 -1
- package/web/assets/conversion-4rhF3xRJ.js +17 -0
- package/web/assets/{depthEstimate-DOvsY8mn.js → depthEstimate-DEpeCojm.js} +1 -1
- package/web/assets/{directorTools-BkbNYbSq.js → directorTools-C5CpTmci.js} +1 -1
- package/web/assets/{distortFrames-Drch0LhT.js → distortFrames-Dia8O1NM.js} +2 -2
- package/web/assets/{distortGL-BlmBZKRU.js → distortGL-QalhICvi.js} +1 -1
- package/web/assets/{editTools-BcGinqHC.js → editTools-CY_JrQfw.js} +1 -1
- package/web/assets/engine-BedcnK45.js +1 -0
- package/web/assets/{exportEncode-MUwVTI52.js → exportEncode-QYsT9JBO.js} +1 -1
- package/web/assets/{exportGlb-SIXFRRJM.js → exportGlb-TSj09XoV.js} +1 -1
- package/web/assets/{faceTracker-DCbZbLMc.js → faceTracker-CnCWOwnJ.js} +1 -1
- package/web/assets/{fightDirector-hlF1JS_z.js → fightDirector-DCI_FWTh.js} +1 -1
- package/web/assets/{fightDrama-fHN5EXk3.js → fightDrama-Bg7uP_2Q.js} +2 -2
- package/web/assets/{frameSink-BvOXjLuw.js → frameSink-DeM8xC8_.js} +3 -3
- package/web/assets/{gpuCompose-CNkLwpbZ.js → gpuCompose-CA3UmOl4.js} +1 -1
- package/web/assets/{gpuExport-DQB6x4eh.js → gpuExport-D31azOQA.js} +13 -9
- package/web/assets/{handMatte-BD7OE3Zc.js → handMatte-Dl-xVXFR.js} +1 -1
- package/web/assets/{handTracker-BumGtRCW.js → handTracker-CplBsAFg.js} +2 -2
- package/web/assets/{id3-BCR9Bqgo.js → id3-arvEpAg7.js} +1 -1
- package/web/assets/{index-CuaB7Y0L.js → index-D5oyVCRl.js} +1 -1
- package/web/assets/index-_tSTJnL9.js +8 -0
- package/web/assets/layer-worker-DFuo32bk.js +5 -0
- package/web/assets/library-BufgA-Pl.js +1 -0
- package/web/assets/{lottieLayer-1ET89OUr.js → lottieLayer-DzbA3bHV.js} +4 -4
- package/web/assets/{lottie_light_canvas-DD9pkFL8.js → lottie_light_canvas-B-d7-ATe.js} +1 -1
- package/web/assets/main-VVYiW8XD.js +309 -0
- package/web/assets/{mapBake-DLoBt_k5.js → mapBake-BKOcEd0w.js} +1 -1
- package/web/assets/maskTrack-CHGXtBRy.js +1 -0
- package/web/assets/{matteFixRun-BdHKC3m5.js → matteFixRun-vgYrINet.js} +1 -1
- package/web/assets/{objectLocate-bZtc5AJo.js → objectLocate-BJltm8Ob.js} +1 -1
- package/web/assets/{output-BwZzMbp-.js → output-p-Q7qous.js} +1 -1
- package/web/assets/{pendingMatte-mlyLLZCT.js → pendingMatte-BPyzzx4y.js} +2 -2
- package/web/assets/{personAi-CUNQeseG.js → personAi-gJu03SjU.js} +2 -2
- package/web/assets/{plateCamera-_jP1xXnj.js → plateCamera-B2JvhjJw.js} +1 -1
- package/web/assets/{plateCameraMatch-rr0oUwQ2.js → plateCameraMatch-ByB9nVQT.js} +2 -2
- package/web/assets/{plateFollow-BjvtcT8q.js → plateFollow-C9S-l7RH.js} +2 -2
- package/web/assets/{plateMatte-BqyL8cQZ.js → plateMatte-J4qlNHnY.js} +2 -2
- package/web/assets/{pluginAutomation-Dp188qm7.js → pluginAutomation-CkP3tA9r.js} +1 -1
- package/web/assets/{poseTracker-DDGDhhMF.js → poseTracker-DGLbouqt.js} +1 -1
- package/web/assets/{productTools-CRgI88-O.js → productTools-CkaWF1bM.js} +2 -2
- package/web/assets/remote-C7J0Tqhb.js +1433 -0
- package/web/assets/{rigTrack-UYZU4P-e.js → rigTrack-urT3nDK0.js} +1 -1
- package/web/assets/{rotoMaskStore-BxyxB2bD.js → rotoMaskStore-DPziPKAN.js} +1 -1
- package/web/assets/{rotoMatte-BdYa8FSB.js → rotoMatte-C-2o3vv0.js} +1 -1
- package/web/assets/{rotoscope-DDixNQCt.js → rotoscope-GvPFRUBg.js} +1 -1
- package/web/assets/{shot-worker-D9sZS6bn.js → shot-worker-6dYkHPoL.js} +1 -1
- package/web/assets/{shotFxAgent-7RQNtEe4.js → shotFxAgent-BFLkqs8v.js} +1 -1
- package/web/assets/{skin-CVwmK130.js → skin-DY4QLaBI.js} +1 -1
- package/web/assets/{spark.module-B34aiScb.js → spark.module-DzziUgOj.js} +1 -1
- package/web/assets/{spellDuel-BkweL6pI.js → spellDuel-BD3m2ebA.js} +2 -2
- package/web/assets/store-Cug4GGcP.js +1 -0
- package/web/assets/{store-75tQUvPT.js → store-DW4E9xnW.js} +1 -1
- package/web/assets/{surfaceLight-DhU-zgNL.js → surfaceLight-aDSYU8Jg.js} +1 -1
- package/web/assets/surfacePin-m83hCgGP.js +2 -0
- package/web/assets/{textAnimators-nVSz_sZo.js → textAnimators-DUZjhVGO.js} +1 -1
- package/web/assets/{thumb-r6dlZprA.js → thumb-CS0ZuiGS.js} +1 -1
- package/web/assets/{timeline3d-246tBEJl.js → timeline3d-DOw-CpZI.js} +2 -2
- package/web/assets/{timeline3dExport-T57qnWi9.js → timeline3dExport-BtYLU1pw.js} +1 -1
- package/web/assets/{timelineComp-BcewYGR2.js → timelineComp-B4GtoH2f.js} +1 -1
- package/web/assets/{timelineProps-CJzzAWWO.js → timelineProps-D7MVutxu.js} +1 -1
- package/web/assets/{timelineText-BzUhNWPB.js → timelineText-BH09jfSM.js} +1 -1
- package/web/assets/{titleArt-B8DVR58F.js → titleArt-Drsrtfiv.js} +3 -3
- package/web/assets/{titleFrameBudget-BYRZAQPs.js → titleFrameBudget-CLZWaFHO.js} +1 -1
- package/web/assets/{titleFrames-BVgm601q.js → titleFrames-BI1DnLBn.js} +1 -1
- package/web/assets/{tool-CAGU3dUa.js → tool-DktQYmS6.js} +1 -1
- package/web/assets/{tools-DVaOkokV.js → tools-Co9aRDiT.js} +1 -1
- package/web/assets/{toonTools-CfGTR_H1.js → toonTools-CD9clJvN.js} +2 -2
- package/web/assets/{trackAnchor-DzUt1r5Q.js → trackAnchor-sOjTtd3I.js} +1 -1
- package/web/assets/{userFonts-DzY0A4bD.js → userFonts-CwlKh9NR.js} +1 -1
- package/web/assets/{vfxAlpha-DQJOaZ9v.js → vfxAlpha-71tSN86T.js} +2 -2
- package/web/assets/{vfxBackground-DiktQFOD.js → vfxBackground-Bq7lJvmZ.js} +2 -2
- package/web/assets/{videoExport-Ce0ElSQR.js → videoExport-D4KbireJ.js} +1 -1
- package/web/assets/{views-V3si1lOz.js → views-ozVF4ABO.js} +1 -1
- package/web/assets/{weaponDuel-D6sLVGmG.js → weaponDuel-ZhX-tjGZ.js} +1 -1
- package/web/assets/{windowFrames-D_2QJCJJ.js → windowFrames-CpqX3kOM.js} +1 -1
- package/web/layer-worker.html +3 -3
- package/web/assets/PluginStore-DKXZ-jBj.js +0 -3
- package/web/assets/index-DYa7fEK0.js +0 -24
- package/web/assets/layer-worker-DxPMMKIZ.js +0 -5
- package/web/assets/library-CyjJ8nGG.js +0 -1
- package/web/assets/main-BKjBWQik.js +0 -309
- package/web/assets/maskTrack-C2SJbDGO.js +0 -1
- package/web/assets/remote-Dva2qg58.js +0 -1241
- package/web/assets/surfacePin-ObK6QgDm.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/thumb-
|
|
2
|
-
import{_ as $}from"./titleFrameBudget-BYRZAQPs.js";import{fI as nt,a as w,iQ as at,ii as vt,j as e,eq as bt,eu as kt,am as yt}from"./remote-Dva2qg58.js";import{u as jt,r as m,t as a}from"./api-DUp403BK.js";import{u as F}from"./store-75tQUvPT.js";import{ag as Nt,ah as D,ai as wt}from"./main-BKjBWQik.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./rotoMaskStore-BxyxB2bD.js";import"./textAnimators-nVSz_sZo.js";import"./timelineComp-BcewYGR2.js";import"./rigTrack-UYZU4P-e.js";import"./spark.module-B34aiScb.js";import"./userFonts-DzY0A4bD.js";import"./lottieLayer-1ET89OUr.js";import"./timeline3d-246tBEJl.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-MUwVTI52.js";import"./captionLayout-EuB59pN_.js";import"./timelineText-BzUhNWPB.js";import"./titleArt-B8DVR58F.js";import"./rotoMatte-BdYa8FSB.js";import"./distortGL-BlmBZKRU.js";import"./motionBlur-uAm030t9.js";const _t=i=>{let h=0;for(let k=0;k<i.length;k++)h=Math.imul(h,31)+i.charCodeAt(k)|0;return String(h>>>0)},st=i=>_t(JSON.stringify([i.items.filter(h=>h.kind==="fx"||h.trackAnchor||h.kind==="person"),i.shots.map(h=>[h.duration,h.fxTiming,h.objectKeys,h.position,h.target,h.lens,h.cameraKeys]),i.plate]));function St({entry:i}){const h=m.useRef(null),[k,B]=m.useState(!1);return m.useEffect(()=>{const y=h.current,A=y?.getContext("2d");if(!y||!A)return;let x=0,E=!1;return $(async()=>{const{drawThumb:j,thumbRestTime:L,thumbLoopLength:N}=await import("./thumb-r6dlZprA.js").then(I=>I.e);return{drawThumb:j,thumbRestTime:L,thumbLoopLength:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(({drawThumb:j,thumbRestTime:L,thumbLoopLength:N})=>{if(E)return;if(!k){j(A,i,L(i),y.width,y.height);return}const I=performance.now(),P=N(i),O=()=>{j(A,i,(performance.now()-I)/1e3%P,y.width,y.height),x=requestAnimationFrame(O)};x=requestAnimationFrame(O)}),()=>{E=!0,cancelAnimationFrame(x)}},[i,k]),e.jsx("canvas",{ref:h,width:128,height:72,"aria-hidden":"true",onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1)})}function Wt({clip:i,locked:h,ensureScene:k,openShot:B,time:y,onBegin:A}){jt();const x=F(t=>t.toast),[,E]=m.useState(0),[j,L]=m.useState(nt[0].id),[N,I]=m.useState(""),[P,O]=m.useState(!1),[c,K]=m.useState(null),[it,U]=m.useState(0),[ot,X]=m.useState({}),[G,rt]=m.useState(""),d=i.vfxShot?.shotNodeId&&w()?.getNode(i.vfxShot.shotNodeId)?i.vfxShot.shotNodeId:null,Q=d?w()?.getNode(d):null,f=Q?.data?.shotScene??null,R=f?f.items.filter(t=>t.kind==="fx"):[],T=f?.items.find(t=>t.kind==="person"&&!t.hidden)??null,lt=f?.shots.find(t=>t.id===f.activeShot),q=m.useMemo(()=>Nt(i),[i]),[v,J]=m.useState(null),W=D(t=>t.want),ct=D(t=>t.ask),V=D(t=>t.got),z=W?.kind==="shot3d"&&W.clipId===i.id;m.useEffect(()=>{if(V?.kind!=="shot3d"||V.clipId!==i.id)return;D.setState({got:null});const t=i.crop??{left:0,right:0,top:0,bottom:0};J({u:t.left+V.media[0]*(1-t.left-t.right),v:t.top+V.media[1]*(1-t.top-t.bottom),t:Z()})},[V]);const ht=F(t=>t.clips.filter(s=>s.vfx?.source===i.id).length),Y=F(t=>t.clips.some(s=>s.vfxFinish===i.id)),H=!!f&&R.length>0&&Q?.data?.vfxRenderHash!==st(f),dt=m.useMemo(()=>{const t=at(N).trim();return vt.filter(s=>t?at(`${s.name} ${s.desc} ${s.keywords} ${s.id}`).includes(t):s.category===j)},[j,N]),_=async(t,s,o)=>{const r=w()?.getNode(t),p=r?.data?.shotScene;if(!p)throw new Error(a("Cảnh VFX không còn trên Canvas"));let g=structuredClone(p);const{runTool:n}=await $(async()=>{const{runTool:u}=await import("./remote-Dva2qg58.js").then(b=>b.jA);return{runTool:u}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10])),l=await n(s,o,{getStage:()=>g,setStage:u=>{g=u(g)},engine:()=>null,timelineClip:u=>F.getState().clips.find(b=>b.id===u)});if(l.ok===!1)throw new Error(l.error||s);return w()?.updateNodeData(t,{shotScene:g}),E(u=>u+1),l},M=async(t,s)=>{if(h){x(a("Track đã khóa"),"error");return}K(t);try{await s()}catch(o){x(o.message,"error")}finally{K(null)}};function Z(){return Math.round(Math.max(0,Math.min(Math.max(0,i.duration-.2),(y??i.start)-i.start))*100)/100}const ut=t=>M(a("Đang thêm hiệu ứng"),async()=>{const s=d??k(i);if(!s)throw new Error(a("Không tạo được cảnh VFX"));const o=w()?.getNode(s)?.data?.shotScene,r=o.items.find(b=>b.kind==="person"&&!b.hidden),p=t.attach==="body"||t.attach==="hand"||t.attach==="gun",g=t.attach==="path"||t.attach==="sky",n=r?.position??[0,0,0],l=Z();let u;if(v){const{scenePoint:b}=await $(async()=>{const{scenePoint:xt}=await import("./trackAnchor-DzUt1r5Q.js");return{scenePoint:xt}},__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10,12])),C=b(o,v.t,v.u,v.v,!(t.attach==="hand"||t.attach==="gun"||t.attach==="free"));u=g?{from:r?`${r.name}.hand_right`:[C[0]-3,C[1]+1.2,C[2]],to:C}:{at:C}}else u={...r&&p?{attach_to:r.name,...t.attach!=="body"?{hand:"right"}:{}}:{},...r&&g?{from:`${r.name}.hand_right`,to:[n[0]+3,n[1]+1.2,n[2]]}:{}};await _(s,"add_effect",{effect:t.id,vfx_layer:t.attach==="body"||t.attach==="ground"?"behind":"front",...l>0?{start:l}:{},...u}),O(!1)}),tt=t=>{if(h){x(a("Track đã khóa"),"error");return}const s=F.getState(),o=yt(s.clips,[{op:"finishVfx",clipId:i.id,...t?{}:{booleanValue:!1}}],[],s.timelineTracks);if(o.errors.length){x(a(o.errors[0].replace(/^finishVfx: /,"")),"error");return}A?.(),F.setState({clips:o.clips}),x(t?a("Đã hoàn thiện: phát sáng, màu theo phim, ánh sáng hắt lên người, hạt phim chung."):a("Đã bỏ phần hoàn thiện VFX."),"ok")},S=(t,s)=>M(a("Đang cập nhật"),()=>_(d,"update_effect",{name:t.name,...s})),et=t=>{const s=f?.items.find(r=>r.trackAnchor?.effect===t.id);if(s)return{kind:"track",source:s.trackAnchor.source};const o=t.fx?.attach;return o&&T&&o.to===T.id?o.hand?{kind:"hand",side:o.hand==="L"?"left":"right"}:{kind:"body"}:{kind:"none"}},mt=(t,s)=>M(a("Đang gắn hiệu ứng"),async()=>{if(et(t).kind==="track"&&await _(d,"follow_track",{name:t.name,stop:!0}),s==="none"){t.fx?.attach&&await _(d,"update_effect",{name:t.name,attach_to:"none"});return}if(s==="body"||s==="hand-right"||s==="hand-left"){if(!T)throw new Error(a("Cảnh VFX không có người đứng thế"));await _(d,"update_effect",{name:t.name,attach_to:T.name,hand:s==="body"?"none":s==="hand-left"?"left":"right"});return}const r=wt(s);await _(d,"follow_track",{name:t.name,source:r.source,...r.object?{object:r.object}:{},...r.source==="hand"?{side:r.hand,point:r.point}:{}})}),pt=()=>M(a("Đang đọc người trong video"),async()=>{const{withBackgroundScene:t}=await $(async()=>{const{withBackgroundScene:r}=await import("./vfxBackground-DiktQFOD.js");return{withBackgroundScene:r}},__vite__mapDeps([13,3,2,1,4,5,6,7,8,9,10])),s=Number(G),o=await t(d,r=>r.run("follow_plate",s>=8&&s<=300?{lens_mm:s}:{}),{timeoutMs:6e5});if(o.ok===!1)throw new Error(o.error||"follow_plate");E(r=>r+1),x(o.camera?a("Đã khớp camera ({0} mm, cao {1} m, nghiêng {2}°) và cho người đứng thế bám theo người trong video",[o.camera.lens_mm,o.camera.height_m.toFixed(2),o.camera.tilt_deg.toFixed(1)]):a("Người đứng thế đã bám theo người trong video"),"info")}),gt=()=>M(a("Đang render hiệu ứng"),async()=>{const{withBackgroundScene:t}=await $(async()=>{const{withBackgroundScene:n}=await import("./vfxBackground-DiktQFOD.js");return{withBackgroundScene:n}},__vite__mapDeps([13,3,2,1,4,5,6,7,8,9,10])),{shotFps:s}=await $(async()=>{const{shotFps:n}=await import("./remote-Dva2qg58.js").then(l=>l.ju);return{shotFps:n}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10]));U(0);const o=w()?.getNode(d)?.data?.shotScene,r=o.shots.find(n=>n.id===o.activeShot),p=await t(d,n=>n.exportVfx({fps:s(r),height:720,vfxAlpha:"auto"},U),{timeoutMs:12e4});w()?.updateNodeData(d,{vfxRenderHash:st(w()?.getNode(d)?.data?.shotScene)}),E(n=>n+1);const g=p.passes.filter(n=>n.alpha).length;x(p.placed?g?a("Đã render {0} lớp hiệu ứng lên video ({1} lớp có kênh trong suốt cho khói / bụi)",[p.passes.length,g]):a("Đã render {0} lớp hiệu ứng lên video",[p.passes.length]):a("Đã render; video hiệu ứng nằm trên Canvas"),"info")}),ft=t=>t.kind==="none"?"none":t.kind==="body"?"body":t.kind==="hand"?`hand-${t.side}`:q.find(s=>s.value===t.source)?.value??q.find(s=>s.value.split(":")[0]===t.source.split(":")[0])?.value??t.source;return e.jsxs("div",{className:"tl-shotfx",children:[e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>O(t=>!t),children:P?a("Đóng kho hiệu ứng"):a("✦ Thêm hiệu ứng 3D")}),d&&e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>B(i),children:a("Mở trong 3D Shot")})]}),e.jsxs("div",{className:"tl-vfxf-place",children:[e.jsxs("button",{type:"button",className:`tl-vfxf-pick${z?" on":""}`,"aria-pressed":z,title:a("Chọn điểm trên Monitor: hiệu ứng mới đặt đúng chỗ đó, từ playhead"),onClick:()=>ct("shot3d",i.id),children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"12",r:"7"}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"}),e.jsx("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3"})]}),e.jsx("span",{className:"txt",children:v?a("Điểm đặt: {0}% · {1}% (giây {2})",[Math.round(v.u*100),Math.round(v.v*100),v.t.toFixed(1)]):a("Chọn điểm")})]}),v&&e.jsx("button",{type:"button",className:"tl-vfxf-clear","aria-label":a("Bỏ điểm (gắn vào người như cũ)"),title:a("Bỏ điểm (gắn vào người như cũ)"),onClick:()=>J(null),children:"×"})]}),P&&e.jsxs("div",{className:"tl-shotfx-gallery",children:[e.jsx("input",{className:"tl-shotfx-search",placeholder:a("Tìm hiệu ứng (aura, sét, khói…)"),value:N,onChange:t=>I(t.target.value)}),!N&&e.jsx("div",{className:"tl-shotfx-cats",children:nt.map(t=>e.jsx("button",{className:`tl-shotfx-cat${t.id===j?" on":""}`,onClick:()=>L(t.id),children:a(t.name)},t.id))}),e.jsx("div",{className:"tl-shotfx-grid",children:dt.slice(0,60).map(t=>e.jsxs("button",{className:"tl-shotfx-card",title:a(t.desc),disabled:!!c,onClick:()=>void ut(t),children:[e.jsx(St,{entry:t}),e.jsx("span",{children:a(t.name)})]},t.id))})]}),R.length>0&&e.jsx("div",{className:"tl-shotfx-list",children:R.map(t=>{const s=bt(t,lt),o=et(t),r=kt[t.fx.preset]?.params??[],p=(n,l)=>{X(u=>{const{[`${t.id}:${n}`]:b,...C}=u;return C}),S(t,n==="intensity"?{intensity:l}:{params:{[n]:l}})},g=(n,l)=>ot[`${t.id}:${n}`]??l;return e.jsxs("div",{className:"tl-shotfx-item",children:[e.jsxs("div",{className:"tl-shotfx-head",children:[e.jsx("input",{type:"color",value:t.color,disabled:!!c,onChange:n=>void S(t,{color:n.target.value}),title:a("Màu")}),e.jsx("b",{children:t.name}),e.jsxs("select",{value:t.vfxLayer??"behind",disabled:!!c,onChange:n=>void S(t,{vfx_layer:n.target.value}),children:[e.jsx("option",{value:"behind",children:a("Sau người")}),e.jsx("option",{value:"front",children:a("Trước người")})]}),e.jsx("button",{className:"tl-shotfx-del",disabled:!!c,title:a("Xoá hiệu ứng"),onClick:()=>void M(a("Đang xoá"),()=>_(d,"remove_effect",{name:t.name})),children:"✕"})]}),e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a("Bám theo")}),e.jsxs("select",{value:ft(o),disabled:!!c,onChange:n=>void mt(t,n.target.value),children:[e.jsx("option",{value:"none",children:a("Đứng yên trong cảnh")}),T&&e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"body",children:a("Người (thân)")}),e.jsx("option",{value:"hand-right",children:a("Người · tay phải")}),e.jsx("option",{value:"hand-left",children:a("Người · tay trái")})]}),q.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))]})]}),e.jsxs("div",{className:"tl-shotfx-time",children:[e.jsxs("label",{children:[a("Bắt đầu")," ",e.jsx("input",{type:"number",min:0,step:.1,value:+s.start.toFixed(2),disabled:!!c,onChange:n=>void S(t,{start:Math.max(0,Number(n.target.value)||0)})})]}),e.jsxs("label",{children:[a("Dài")," ",e.jsx("input",{type:"number",min:.2,step:.1,value:+s.duration.toFixed(2),disabled:!!c,onChange:n=>void S(t,{duration:Math.max(.2,Number(n.target.value)||.2)})})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.loop,disabled:!!c,onChange:n=>void S(t,{loop:n.target.checked})})," ",a("Lặp")]})]}),e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a("Độ mạnh")}),e.jsx("input",{type:"range",min:.1,max:3,step:.05,value:g("intensity",t.fx.intensity),disabled:!!c,onChange:n=>X(l=>({...l,[`${t.id}:intensity`]:Number(n.target.value)})),onMouseUp:n=>p("intensity",Number(n.target.value)),onKeyUp:n=>p("intensity",Number(n.target.value))})]}),r.map(n=>n.type==="enum"?e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a(n.label??n.key)}),e.jsx("select",{value:String(t.fx.params[n.key]??n.def),disabled:!!c,onChange:l=>void S(t,{params:{[n.key]:l.target.value}}),children:(n.options??[]).map(l=>e.jsx("option",{value:l,children:l},l))})]},n.key):e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a(n.label??n.key)}),e.jsx("input",{type:"range",min:n.min,max:n.max,step:((n.max??1)-(n.min??0))/100,value:g(n.key,Number(t.fx.params[n.key]??n.def)),disabled:!!c,onChange:l=>X(u=>({...u,[`${t.id}:${n.key}`]:Number(l.target.value)})),onMouseUp:l=>p(n.key,Number(l.target.value)),onKeyUp:l=>p(n.key,Number(l.target.value))})]},n.key))]},t.id)})}),d&&T&&R.length>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>void pt(),title:a("Đọc tư thế người trong video (miễn phí, trong trình duyệt): hiệu ứng gắn vào người sẽ chạy theo họ"),children:a("Bám người thật (tư thế)")}),e.jsx("input",{className:"tl-shotfx-lens",type:"number",min:8,max:300,step:1,value:G,disabled:!!c,placeholder:a("Ống kính mm"),title:a("Tiêu cự ống kính đã quay (mm, khổ phim 36 mm). Để trống: tự giả định 28 mm — ống kính chính của điện thoại"),onChange:t=>rt(t.target.value)})]}),f?.plate?.match&&e.jsx("p",{className:"tl-vfx-hint",children:a("Camera đã khớp với video: {0} mm · cao {1} m · nghiêng {2}°",[f.plate.match.lens,f.plate.match.height.toFixed(2),f.plate.match.tilt.toFixed(1)])}),d&&R.length>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:`pill-btn${H?" on":""}`,disabled:!!c,onClick:()=>void gt(),children:c===a("Đang render hiệu ứng")?`${a("Đang render")} ${it}%`:H?a("▶ Render hiệu ứng lên video"):a("Render lại")}),H&&e.jsx("span",{className:"tl-shotfx-stale",children:a("Đã sửa, cần render lại")})]}),ht>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>tt(!0),children:Y?a("✨ Làm lại phần hoàn thiện"):a("✨ Hoàn thiện giống thật")}),Y&&e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>tt(!1),children:a("Bỏ hoàn thiện")})]}),c&&c!==a("Đang render hiệu ứng")&&e.jsxs("p",{className:"tl-vfx-hint",children:[c,"…"]})]})}export{Wt as default,st as vfxSceneHash};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/thumb-CS0ZuiGS.js","assets/remote-C7J0Tqhb.js","assets/api-CJ8PdbfZ.js","assets/titleFrameBudget-CLZWaFHO.js","assets/three.module-Bx43vjkH.js","assets/GLTFLoader-BHWu1lKg.js","assets/store-DW4E9xnW.js","assets/rotoMaskStore-DPziPKAN.js","assets/textAnimators-DUZjhVGO.js","assets/timelineComp-B4GtoH2f.js","assets/rigTrack-urT3nDK0.js","assets/trackAnchor-sOjTtd3I.js","assets/shotFxAgent-BFLkqs8v.js","assets/vfxBackground-Bq7lJvmZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as $}from"./titleFrameBudget-CLZWaFHO.js";import{fI as nt,a as w,iQ as at,ie as vt,j as e,eq as bt,eu as kt,am as yt}from"./remote-C7J0Tqhb.js";import{u as jt,r as m,t as a}from"./api-CJ8PdbfZ.js";import{u as F}from"./store-DW4E9xnW.js";import{ah as Nt,ai as D,aj as wt}from"./main-VVYiW8XD.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";import"./spark.module-DzziUgOj.js";import"./userFonts-CwlKh9NR.js";import"./lottieLayer-DzbA3bHV.js";import"./timeline3d-DOw-CpZI.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-QYsT9JBO.js";import"./captionLayout-DvDPTwO9.js";import"./timelineText-BH09jfSM.js";import"./titleArt-Drsrtfiv.js";import"./rotoMatte-C-2o3vv0.js";import"./distortGL-QalhICvi.js";import"./motionBlur-uAm030t9.js";const _t=i=>{let h=0;for(let k=0;k<i.length;k++)h=Math.imul(h,31)+i.charCodeAt(k)|0;return String(h>>>0)},st=i=>_t(JSON.stringify([i.items.filter(h=>h.kind==="fx"||h.trackAnchor||h.kind==="person"),i.shots.map(h=>[h.duration,h.fxTiming,h.objectKeys,h.position,h.target,h.lens,h.cameraKeys]),i.plate]));function St({entry:i}){const h=m.useRef(null),[k,B]=m.useState(!1);return m.useEffect(()=>{const y=h.current,A=y?.getContext("2d");if(!y||!A)return;let x=0,E=!1;return $(async()=>{const{drawThumb:j,thumbRestTime:L,thumbLoopLength:N}=await import("./thumb-CS0ZuiGS.js").then(I=>I.e);return{drawThumb:j,thumbRestTime:L,thumbLoopLength:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(({drawThumb:j,thumbRestTime:L,thumbLoopLength:N})=>{if(E)return;if(!k){j(A,i,L(i),y.width,y.height);return}const I=performance.now(),P=N(i),O=()=>{j(A,i,(performance.now()-I)/1e3%P,y.width,y.height),x=requestAnimationFrame(O)};x=requestAnimationFrame(O)}),()=>{E=!0,cancelAnimationFrame(x)}},[i,k]),e.jsx("canvas",{ref:h,width:128,height:72,"aria-hidden":"true",onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1)})}function Wt({clip:i,locked:h,ensureScene:k,openShot:B,time:y,onBegin:A}){jt();const x=F(t=>t.toast),[,E]=m.useState(0),[j,L]=m.useState(nt[0].id),[N,I]=m.useState(""),[P,O]=m.useState(!1),[c,K]=m.useState(null),[it,U]=m.useState(0),[ot,X]=m.useState({}),[G,rt]=m.useState(""),d=i.vfxShot?.shotNodeId&&w()?.getNode(i.vfxShot.shotNodeId)?i.vfxShot.shotNodeId:null,Q=d?w()?.getNode(d):null,f=Q?.data?.shotScene??null,R=f?f.items.filter(t=>t.kind==="fx"):[],T=f?.items.find(t=>t.kind==="person"&&!t.hidden)??null,lt=f?.shots.find(t=>t.id===f.activeShot),q=m.useMemo(()=>Nt(i),[i]),[v,J]=m.useState(null),W=D(t=>t.want),ct=D(t=>t.ask),V=D(t=>t.got),z=W?.kind==="shot3d"&&W.clipId===i.id;m.useEffect(()=>{if(V?.kind!=="shot3d"||V.clipId!==i.id)return;D.setState({got:null});const t=i.crop??{left:0,right:0,top:0,bottom:0};J({u:t.left+V.media[0]*(1-t.left-t.right),v:t.top+V.media[1]*(1-t.top-t.bottom),t:Z()})},[V]);const ht=F(t=>t.clips.filter(s=>s.vfx?.source===i.id).length),Y=F(t=>t.clips.some(s=>s.vfxFinish===i.id)),H=!!f&&R.length>0&&Q?.data?.vfxRenderHash!==st(f),dt=m.useMemo(()=>{const t=at(N).trim();return vt.filter(s=>t?at(`${s.name} ${s.desc} ${s.keywords} ${s.id}`).includes(t):s.category===j)},[j,N]),_=async(t,s,o)=>{const r=w()?.getNode(t),p=r?.data?.shotScene;if(!p)throw new Error(a("Cảnh VFX không còn trên Canvas"));let g=structuredClone(p);const{runTool:n}=await $(async()=>{const{runTool:u}=await import("./remote-C7J0Tqhb.js").then(b=>b.jA);return{runTool:u}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10])),l=await n(s,o,{getStage:()=>g,setStage:u=>{g=u(g)},engine:()=>null,timelineClip:u=>F.getState().clips.find(b=>b.id===u)});if(l.ok===!1)throw new Error(l.error||s);return w()?.updateNodeData(t,{shotScene:g}),E(u=>u+1),l},M=async(t,s)=>{if(h){x(a("Track đã khóa"),"error");return}K(t);try{await s()}catch(o){x(o.message,"error")}finally{K(null)}};function Z(){return Math.round(Math.max(0,Math.min(Math.max(0,i.duration-.2),(y??i.start)-i.start))*100)/100}const ut=t=>M(a("Đang thêm hiệu ứng"),async()=>{const s=d??k(i);if(!s)throw new Error(a("Không tạo được cảnh VFX"));const o=w()?.getNode(s)?.data?.shotScene,r=o.items.find(b=>b.kind==="person"&&!b.hidden),p=t.attach==="body"||t.attach==="hand"||t.attach==="gun",g=t.attach==="path"||t.attach==="sky",n=r?.position??[0,0,0],l=Z();let u;if(v){const{scenePoint:b}=await $(async()=>{const{scenePoint:xt}=await import("./trackAnchor-sOjTtd3I.js");return{scenePoint:xt}},__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10,12])),C=b(o,v.t,v.u,v.v,!(t.attach==="hand"||t.attach==="gun"||t.attach==="free"));u=g?{from:r?`${r.name}.hand_right`:[C[0]-3,C[1]+1.2,C[2]],to:C}:{at:C}}else u={...r&&p?{attach_to:r.name,...t.attach!=="body"?{hand:"right"}:{}}:{},...r&&g?{from:`${r.name}.hand_right`,to:[n[0]+3,n[1]+1.2,n[2]]}:{}};await _(s,"add_effect",{effect:t.id,vfx_layer:t.attach==="body"||t.attach==="ground"?"behind":"front",...l>0?{start:l}:{},...u}),O(!1)}),tt=t=>{if(h){x(a("Track đã khóa"),"error");return}const s=F.getState(),o=yt(s.clips,[{op:"finishVfx",clipId:i.id,...t?{}:{booleanValue:!1}}],[],s.timelineTracks);if(o.errors.length){x(a(o.errors[0].replace(/^finishVfx: /,"")),"error");return}A?.(),F.setState({clips:o.clips}),x(t?a("Đã hoàn thiện: phát sáng, màu theo phim, ánh sáng hắt lên người, hạt phim chung."):a("Đã bỏ phần hoàn thiện VFX."),"ok")},S=(t,s)=>M(a("Đang cập nhật"),()=>_(d,"update_effect",{name:t.name,...s})),et=t=>{const s=f?.items.find(r=>r.trackAnchor?.effect===t.id);if(s)return{kind:"track",source:s.trackAnchor.source};const o=t.fx?.attach;return o&&T&&o.to===T.id?o.hand?{kind:"hand",side:o.hand==="L"?"left":"right"}:{kind:"body"}:{kind:"none"}},mt=(t,s)=>M(a("Đang gắn hiệu ứng"),async()=>{if(et(t).kind==="track"&&await _(d,"follow_track",{name:t.name,stop:!0}),s==="none"){t.fx?.attach&&await _(d,"update_effect",{name:t.name,attach_to:"none"});return}if(s==="body"||s==="hand-right"||s==="hand-left"){if(!T)throw new Error(a("Cảnh VFX không có người đứng thế"));await _(d,"update_effect",{name:t.name,attach_to:T.name,hand:s==="body"?"none":s==="hand-left"?"left":"right"});return}const r=wt(s);await _(d,"follow_track",{name:t.name,source:r.source,...r.object?{object:r.object}:{},...r.source==="hand"?{side:r.hand,point:r.point}:{}})}),pt=()=>M(a("Đang đọc người trong video"),async()=>{const{withBackgroundScene:t}=await $(async()=>{const{withBackgroundScene:r}=await import("./vfxBackground-Bq7lJvmZ.js");return{withBackgroundScene:r}},__vite__mapDeps([13,3,2,1,4,5,6,7,8,9,10])),s=Number(G),o=await t(d,r=>r.run("follow_plate",s>=8&&s<=300?{lens_mm:s}:{}),{timeoutMs:6e5});if(o.ok===!1)throw new Error(o.error||"follow_plate");E(r=>r+1),x(o.camera?a("Đã khớp camera ({0} mm, cao {1} m, nghiêng {2}°) và cho người đứng thế bám theo người trong video",[o.camera.lens_mm,o.camera.height_m.toFixed(2),o.camera.tilt_deg.toFixed(1)]):a("Người đứng thế đã bám theo người trong video"),"info")}),gt=()=>M(a("Đang render hiệu ứng"),async()=>{const{withBackgroundScene:t}=await $(async()=>{const{withBackgroundScene:n}=await import("./vfxBackground-Bq7lJvmZ.js");return{withBackgroundScene:n}},__vite__mapDeps([13,3,2,1,4,5,6,7,8,9,10])),{shotFps:s}=await $(async()=>{const{shotFps:n}=await import("./remote-C7J0Tqhb.js").then(l=>l.ju);return{shotFps:n}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10]));U(0);const o=w()?.getNode(d)?.data?.shotScene,r=o.shots.find(n=>n.id===o.activeShot),p=await t(d,n=>n.exportVfx({fps:s(r),height:720,vfxAlpha:"auto"},U),{timeoutMs:12e4});w()?.updateNodeData(d,{vfxRenderHash:st(w()?.getNode(d)?.data?.shotScene)}),E(n=>n+1);const g=p.passes.filter(n=>n.alpha).length;x(p.placed?g?a("Đã render {0} lớp hiệu ứng lên video ({1} lớp có kênh trong suốt cho khói / bụi)",[p.passes.length,g]):a("Đã render {0} lớp hiệu ứng lên video",[p.passes.length]):a("Đã render; video hiệu ứng nằm trên Canvas"),"info")}),ft=t=>t.kind==="none"?"none":t.kind==="body"?"body":t.kind==="hand"?`hand-${t.side}`:q.find(s=>s.value===t.source)?.value??q.find(s=>s.value.split(":")[0]===t.source.split(":")[0])?.value??t.source;return e.jsxs("div",{className:"tl-shotfx",children:[e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>O(t=>!t),children:P?a("Đóng kho hiệu ứng"):a("✦ Thêm hiệu ứng 3D")}),d&&e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>B(i),children:a("Mở trong 3D Shot")})]}),e.jsxs("div",{className:"tl-vfxf-place",children:[e.jsxs("button",{type:"button",className:`tl-vfxf-pick${z?" on":""}`,"aria-pressed":z,title:a("Chọn điểm trên Monitor: hiệu ứng mới đặt đúng chỗ đó, từ playhead"),onClick:()=>ct("shot3d",i.id),children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"12",r:"7"}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"}),e.jsx("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3"})]}),e.jsx("span",{className:"txt",children:v?a("Điểm đặt: {0}% · {1}% (giây {2})",[Math.round(v.u*100),Math.round(v.v*100),v.t.toFixed(1)]):a("Chọn điểm")})]}),v&&e.jsx("button",{type:"button",className:"tl-vfxf-clear","aria-label":a("Bỏ điểm (gắn vào người như cũ)"),title:a("Bỏ điểm (gắn vào người như cũ)"),onClick:()=>J(null),children:"×"})]}),P&&e.jsxs("div",{className:"tl-shotfx-gallery",children:[e.jsx("input",{className:"tl-shotfx-search",placeholder:a("Tìm hiệu ứng (aura, sét, khói…)"),value:N,onChange:t=>I(t.target.value)}),!N&&e.jsx("div",{className:"tl-shotfx-cats",children:nt.map(t=>e.jsx("button",{className:`tl-shotfx-cat${t.id===j?" on":""}`,onClick:()=>L(t.id),children:a(t.name)},t.id))}),e.jsx("div",{className:"tl-shotfx-grid",children:dt.slice(0,60).map(t=>e.jsxs("button",{className:"tl-shotfx-card",title:a(t.desc),disabled:!!c,onClick:()=>void ut(t),children:[e.jsx(St,{entry:t}),e.jsx("span",{children:a(t.name)})]},t.id))})]}),R.length>0&&e.jsx("div",{className:"tl-shotfx-list",children:R.map(t=>{const s=bt(t,lt),o=et(t),r=kt[t.fx.preset]?.params??[],p=(n,l)=>{X(u=>{const{[`${t.id}:${n}`]:b,...C}=u;return C}),S(t,n==="intensity"?{intensity:l}:{params:{[n]:l}})},g=(n,l)=>ot[`${t.id}:${n}`]??l;return e.jsxs("div",{className:"tl-shotfx-item",children:[e.jsxs("div",{className:"tl-shotfx-head",children:[e.jsx("input",{type:"color",value:t.color,disabled:!!c,onChange:n=>void S(t,{color:n.target.value}),title:a("Màu")}),e.jsx("b",{children:t.name}),e.jsxs("select",{value:t.vfxLayer??"behind",disabled:!!c,onChange:n=>void S(t,{vfx_layer:n.target.value}),children:[e.jsx("option",{value:"behind",children:a("Sau người")}),e.jsx("option",{value:"front",children:a("Trước người")})]}),e.jsx("button",{className:"tl-shotfx-del",disabled:!!c,title:a("Xoá hiệu ứng"),onClick:()=>void M(a("Đang xoá"),()=>_(d,"remove_effect",{name:t.name})),children:"✕"})]}),e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a("Bám theo")}),e.jsxs("select",{value:ft(o),disabled:!!c,onChange:n=>void mt(t,n.target.value),children:[e.jsx("option",{value:"none",children:a("Đứng yên trong cảnh")}),T&&e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"body",children:a("Người (thân)")}),e.jsx("option",{value:"hand-right",children:a("Người · tay phải")}),e.jsx("option",{value:"hand-left",children:a("Người · tay trái")})]}),q.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))]})]}),e.jsxs("div",{className:"tl-shotfx-time",children:[e.jsxs("label",{children:[a("Bắt đầu")," ",e.jsx("input",{type:"number",min:0,step:.1,value:+s.start.toFixed(2),disabled:!!c,onChange:n=>void S(t,{start:Math.max(0,Number(n.target.value)||0)})})]}),e.jsxs("label",{children:[a("Dài")," ",e.jsx("input",{type:"number",min:.2,step:.1,value:+s.duration.toFixed(2),disabled:!!c,onChange:n=>void S(t,{duration:Math.max(.2,Number(n.target.value)||.2)})})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.loop,disabled:!!c,onChange:n=>void S(t,{loop:n.target.checked})})," ",a("Lặp")]})]}),e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a("Độ mạnh")}),e.jsx("input",{type:"range",min:.1,max:3,step:.05,value:g("intensity",t.fx.intensity),disabled:!!c,onChange:n=>X(l=>({...l,[`${t.id}:intensity`]:Number(n.target.value)})),onMouseUp:n=>p("intensity",Number(n.target.value)),onKeyUp:n=>p("intensity",Number(n.target.value))})]}),r.map(n=>n.type==="enum"?e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a(n.label??n.key)}),e.jsx("select",{value:String(t.fx.params[n.key]??n.def),disabled:!!c,onChange:l=>void S(t,{params:{[n.key]:l.target.value}}),children:(n.options??[]).map(l=>e.jsx("option",{value:l,children:l},l))})]},n.key):e.jsxs("label",{className:"tl-shotfx-field",children:[e.jsx("span",{children:a(n.label??n.key)}),e.jsx("input",{type:"range",min:n.min,max:n.max,step:((n.max??1)-(n.min??0))/100,value:g(n.key,Number(t.fx.params[n.key]??n.def)),disabled:!!c,onChange:l=>X(u=>({...u,[`${t.id}:${n.key}`]:Number(l.target.value)})),onMouseUp:l=>p(n.key,Number(l.target.value)),onKeyUp:l=>p(n.key,Number(l.target.value))})]},n.key))]},t.id)})}),d&&T&&R.length>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>void pt(),title:a("Đọc tư thế người trong video (miễn phí, trong trình duyệt): hiệu ứng gắn vào người sẽ chạy theo họ"),children:a("Bám người thật (tư thế)")}),e.jsx("input",{className:"tl-shotfx-lens",type:"number",min:8,max:300,step:1,value:G,disabled:!!c,placeholder:a("Ống kính mm"),title:a("Tiêu cự ống kính đã quay (mm, khổ phim 36 mm). Để trống: tự giả định 28 mm — ống kính chính của điện thoại"),onChange:t=>rt(t.target.value)})]}),f?.plate?.match&&e.jsx("p",{className:"tl-vfx-hint",children:a("Camera đã khớp với video: {0} mm · cao {1} m · nghiêng {2}°",[f.plate.match.lens,f.plate.match.height.toFixed(2),f.plate.match.tilt.toFixed(1)])}),d&&R.length>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:`pill-btn${H?" on":""}`,disabled:!!c,onClick:()=>void gt(),children:c===a("Đang render hiệu ứng")?`${a("Đang render")} ${it}%`:H?a("▶ Render hiệu ứng lên video"):a("Render lại")}),H&&e.jsx("span",{className:"tl-shotfx-stale",children:a("Đã sửa, cần render lại")})]}),ht>0&&e.jsxs("div",{className:"tl-3d-row",children:[e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>tt(!0),children:Y?a("✨ Làm lại phần hoàn thiện"):a("✨ Hoàn thiện giống thật")}),Y&&e.jsx("button",{className:"pill-btn",disabled:!!c,onClick:()=>tt(!1),children:a("Bỏ hoàn thiện")})]}),c&&c!==a("Đang render hiệu ứng")&&e.jsxs("p",{className:"tl-vfx-hint",children:[c,"…"]})]})}export{Wt as default,st as vfxSceneHash};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./remote-
|
|
1
|
+
import{j as c}from"./remote-C7J0Tqhb.js";import{r as p}from"./api-CJ8PdbfZ.js";import{gT as g}from"./titleFrameBudget-CLZWaFHO.js";import{d}from"./main-VVYiW8XD.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./store-DW4E9xnW.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";import"./spark.module-DzziUgOj.js";import"./userFonts-CwlKh9NR.js";import"./lottieLayer-DzbA3bHV.js";import"./timeline3d-DOw-CpZI.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-QYsT9JBO.js";import"./captionLayout-DvDPTwO9.js";import"./timelineText-BH09jfSM.js";import"./titleArt-Drsrtfiv.js";import"./rotoMatte-C-2o3vv0.js";import"./distortGL-QalhICvi.js";import"./motionBlur-uAm030t9.js";const f=["https://admin.clipoox.com","http://localhost:3000","http://localhost:5173"];function B(){const m=p.useRef(null),[e,l]=p.useState(null);return p.useEffect(()=>{const r=(t,i)=>t.source?.postMessage(i,{targetOrigin:t.origin}),n=t=>{if(!f.includes(t.origin)||t.source!==window.parent||!t.data||typeof t.data!="object")return;let i;try{i=g(t.data.transition)}catch(o){r(t,{type:"clipoox-transition-error",id:"id"in t.data?t.data.id:null,error:o.message});return}if(t.data.type==="clipoox-transition-play"){l(i);return}if(t.data.type==="clipoox-transition-thumb"){const o=Object.assign(document.createElement("canvas"),{width:640,height:360}),s=o.getContext("2d");d(s,i,Number.isFinite(t.data.p)?Number(t.data.p):.5,640,360),r(t,{type:"clipoox-transition-thumb",id:t.data.id,png:o.toDataURL("image/png")})}},a=t=>n(t);return window.addEventListener("message",a),window.parent?.postMessage({type:"clipoox-transition-ready"},"*"),()=>window.removeEventListener("message",a)},[]),p.useEffect(()=>{const r=m.current,n=r?.getContext("2d");if(!r||!n||!e)return;let a=0;const t=performance.now(),i=e.duration*1e3,o=600,s=u=>{const h=(u-t)%(i+2*o)-o;d(n,e,Math.max(0,Math.min(1,h/i)),r.width,r.height),a=requestAnimationFrame(s)};return a=requestAnimationFrame(s),()=>cancelAnimationFrame(a)},[e]),c.jsx("div",{style:{margin:0,background:"#000",width:"100vw",height:"100vh",display:"grid",placeItems:"center"},children:c.jsx("canvas",{ref:m,width:1280,height:720,style:{width:"100%",height:"100%",objectFit:"contain"},"aria-label":"Transition preview"})})}export{B as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as u,a as I}from"./remote-
|
|
1
|
+
import{j as u,a as I}from"./remote-C7J0Tqhb.js";import{u as ut,r as h,t as m,c as ht}from"./api-CJ8PdbfZ.js";import{u as pt}from"./store-DW4E9xnW.js";import{u as ft,W as U,a as dt}from"./main-VVYiW8XD.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./rotoMaskStore-DPziPKAN.js";import"./titleFrameBudget-CLZWaFHO.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";import"./spark.module-DzziUgOj.js";import"./userFonts-CwlKh9NR.js";import"./lottieLayer-DzbA3bHV.js";import"./timeline3d-DOw-CpZI.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-QYsT9JBO.js";import"./captionLayout-DvDPTwO9.js";import"./timelineText-BH09jfSM.js";import"./titleArt-Drsrtfiv.js";import"./rotoMatte-C-2o3vv0.js";import"./distortGL-QalhICvi.js";import"./motionBlur-uAm030t9.js";const tt=(i,p,c,o,f,s)=>{const a=f-c,r=s-o,d=a*a+r*r,v=d?Math.max(0,Math.min(1,((i-c)*a+(p-o)*r)/d)):0;return Math.hypot(i-(c+v*a),p-(o+v*r))};function R(i){if(i.type==="pen"){const s=i.points||[];let a=1/0,r=1/0,d=-1/0,v=-1/0;for(let x=0;x<s.length;x+=2)a=Math.min(a,s[x]),r=Math.min(r,s[x+1]),d=Math.max(d,s[x]),v=Math.max(v,s[x+1]);return s.length?{x:a,y:r,w:d-a,h:v-r}:{x:0,y:0,w:0,h:0}}if(i.type==="text"){const s=String(i.text||"").split(`
|
|
2
2
|
`),a=i.size||36;return{x:i.x||0,y:i.y||0,w:Math.max(...s.map(r=>r.length),1)*a*.6,h:s.length*a*1.25}}const p=i.x||0,c=i.y||0,o=i.w||0,f=i.h||0;return{x:Math.min(p,p+o),y:Math.min(c,c+f),w:Math.abs(o),h:Math.abs(f)}}function H(i,p,c,o=8){for(let f=i.length-1;f>=0;f--){const s=i[f],a=(s.width||2)/2+o;if(s.type==="pen"){const r=s.points||[];for(let d=0;d+3<r.length;d+=2)if(tt(p,c,r[d],r[d+1],r[d+2],r[d+3])<=a)return s;if(r.length===2&&Math.hypot(p-r[0],c-r[1])<=a)return s}else if(s.type==="arrow"){if(tt(p,c,s.x||0,s.y||0,(s.x||0)+(s.w||0),(s.y||0)+(s.h||0))<=a)return s}else{const r=R(s);if(p>=r.x-a&&p<=r.x+r.w+a&&c>=r.y-a&&c<=r.y+r.h+a)return s}}return null}function yt(i,p,c){return i.type==="pen"?{...i,points:(i.points||[]).map((o,f)=>o+(f%2?c:p))}:{...i,x:(i.x||0)+p,y:(i.y||0)+c}}function et(i){if(!Array.isArray(i))return[];const p=[];for(const c of i.slice(0,2e3)){if(!c||typeof c!="object"||!["pen","arrow","rect","ellipse","text"].includes(c.type))continue;const o=c;p.push({id:String(o.id||Math.random().toString(36).slice(2)),type:o.type,color:/^#[0-9a-fA-F]{3,8}$/.test(String(o.color))?o.color:"#111111",width:Math.max(1,Math.min(48,Number(o.width)||4)),...o.type==="pen"?{points:(Array.isArray(o.points)?o.points:[]).slice(0,4e3).map(f=>Math.round(Number(f)||0))}:{},...o.type!=="pen"?{x:Math.round(Number(o.x)||0),y:Math.round(Number(o.y)||0)}:{},...o.type==="rect"||o.type==="ellipse"||o.type==="arrow"?{w:Math.round(Number(o.w)||0),h:Math.round(Number(o.h)||0)}:{},...o.type==="text"?{text:String(o.text||"").slice(0,2e3),size:Math.max(10,Math.min(200,Number(o.size)||36))}:{}})}return p}const mt=["#ffffff","#111111","#e5484d","#f5a524","#f7ce46","#3fb950","#4c8dff","#7c66ff","#ef5da8","#8a93a6"],q=()=>Math.random().toString(36).slice(2,10);function $t({nodeId:i}){ut();const p=pt(t=>t.toast),c=ft(t=>t.close),o=I()?.getNode(i),[f,s]=h.useState(()=>o?.data?.wbAspect in U?(o?.data).wbAspect:"16:9"),{w:a,h:r}=U[f],[d,v]=h.useState(()=>et(o?.data?.wbShapes)),[x,nt]=h.useState("pen"),[j,J]=h.useState("#111111"),[C,rt]=h.useState(6),[T,P]=h.useState(null),[M,_]=h.useState(null),[z,O]=h.useState(!1),A=h.useRef([]),B=h.useRef([]),E=h.useRef(null),S=h.useRef(null),L=h.useRef(null),X=h.useRef(null),[,D]=h.useState(0),w=h.useRef(d);w.current=d;const N=t=>{A.current=[...A.current.slice(-49),w.current],B.current=[],v(t)},Y=()=>{const t=A.current.pop();t&&(B.current.push(w.current),v(t),P(null))},G=()=>{const t=B.current.pop();t&&(A.current.push(w.current),v(t),P(null))},K=h.useCallback(()=>{I()?.updateNodeData(i,{wbShapes:et(w.current),wbAspect:f})},[i,f]),$=h.useCallback(()=>{K(),c()},[K,c]);h.useEffect(()=>{const t=e=>{M||(e.key==="Escape"&&$(),(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="z"&&(e.preventDefault(),e.shiftKey?G():Y()),(e.key==="Delete"||e.key==="Backspace")&&T&&N(w.current.filter(n=>n.id!==T)))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[T,M,$]);const Q=t=>{const e=L.current.getBoundingClientRect();return{x:Math.round((t.clientX-e.left)*(a/e.width)),y:Math.round((t.clientY-e.top)*(r/e.height))}},ot=t=>{const e=Q(t);if(M){W();return}if(x==="text"){t.preventDefault(),_({x:e.x,y:e.y,value:""});return}if(t.target.setPointerCapture?.(t.pointerId),x==="select"){const n=H(w.current,e.x,e.y);P(n?.id||null),n&&(S.current={id:n.id,lx:e.x,ly:e.y});return}if(x==="eraser"){const n=H(w.current,e.x,e.y);n&&N(w.current.filter(l=>l.id!==n.id)),S.current={id:"__erase__",lx:e.x,ly:e.y};return}E.current=x==="pen"?{id:q(),type:"pen",color:j,width:C,points:[e.x,e.y]}:{id:q(),type:x,color:j,width:C,x:e.x,y:e.y,w:0,h:0},D(n=>n+1)},it=t=>{if(t.buttons!==1)return;const e=Q(t);if(S.current){if(S.current.id==="__erase__"){const l=H(w.current,e.x,e.y);l&&N(w.current.filter(y=>y.id!==l.id))}else{const{id:l,lx:y,ly:g}=S.current;S.current={id:l,lx:e.x,ly:e.y},v(k=>k.map(b=>b.id===l?yt(b,e.x-y,e.y-g):b))}return}const n=E.current;if(n)if(n.type==="pen"){const l=n.points,y=l.length;Math.hypot(e.x-l[y-2],e.y-l[y-1])>=3&&y<4e3&&(l.push(e.x,e.y),D(g=>g+1))}else n.w=e.x-(n.x||0),n.h=e.y-(n.y||0),D(l=>l+1)},V=()=>{if(S.current){S.current.id!=="__erase__"&&N(w.current),S.current=null;return}const t=E.current;if(E.current=null,!t)return;const e=R(t);if(t.type!=="pen"&&e.w<3&&e.h<3){D(n=>n+1);return}N([...w.current,t])},Z=dt(()=>W()),W=()=>{const t=M;_(null),t&&t.value.trim()&&N([...w.current,{id:q(),type:"text",x:t.x,y:t.y,text:t.value.slice(0,2e3),color:j,width:C,size:Math.round(C*4+16)}])},F=(t,e)=>{if(t.strokeStyle=e.color,t.fillStyle=e.color,t.lineWidth=e.width,t.lineCap="round",t.lineJoin="round",e.type==="pen"){const n=e.points||[];if(n.length<2)return;t.beginPath(),t.moveTo(n[0],n[1]);for(let l=2;l<n.length;l+=2)t.lineTo(n[l],n[l+1]);n.length===2&&t.lineTo(n[0]+.1,n[1]),t.stroke()}else if(e.type==="arrow"){const n=e.x||0,l=e.y||0,y=n+(e.w||0),g=l+(e.h||0);t.beginPath(),t.moveTo(n,l),t.lineTo(y,g),t.stroke();const k=Math.atan2(g-l,y-n),b=Math.max(14,e.width*3.2);t.beginPath(),t.moveTo(y,g),t.lineTo(y-b*Math.cos(k-.45),g-b*Math.sin(k-.45)),t.moveTo(y,g),t.lineTo(y-b*Math.cos(k+.45),g-b*Math.sin(k+.45)),t.stroke()}else if(e.type==="rect"){const n=R(e);t.strokeRect(n.x,n.y,n.w,n.h)}else if(e.type==="ellipse"){const n=R(e);t.beginPath(),t.ellipse(n.x+n.w/2,n.y+n.h/2,Math.max(1,n.w/2),Math.max(1,n.h/2),0,0,Math.PI*2),t.stroke()}else if(e.type==="text"){const n=e.size||36;t.font=`600 ${n}px system-ui, -apple-system, sans-serif`,t.textBaseline="top",String(e.text||"").split(`
|
|
3
3
|
`).forEach((l,y)=>t.fillText(l,e.x||0,(e.y||0)+y*n*1.25))}},st=()=>{const t=L.current?.getContext("2d");if(t){t.fillStyle="#ffffff",t.fillRect(0,0,a,r);for(const e of d)F(t,e);if(E.current&&F(t,E.current),T){const e=d.find(n=>n.id===T);if(e){const n=R(e);t.save(),t.strokeStyle="#4c8dff",t.lineWidth=2,t.setLineDash([8,6]),t.strokeRect(n.x-8,n.y-8,n.w+16,n.h+16),t.restore()}}}};h.useEffect(st);const at=async()=>{if(!z){W(),O(!0);try{K();const t=document.createElement("canvas");t.width=a,t.height=r;const e=t.getContext("2d");e.fillStyle="#ffffff",e.fillRect(0,0,a,r);for(const b of w.current)F(e,b);const n=await new Promise(b=>t.toBlob(b,"image/png"));if(!n)throw Error("Canvas export failed");const{url:l,gcsUri:y}=await ht(new File([n],"whiteboard.png",{type:"image/png"}),void 0,"image"),g=I(),k=g?.getNode(i)?.position||g?.centerFlowPos()||{x:0,y:0};g?.addNode("image",{url:l,gcsUri:y,label:"Whiteboard sketch"},{x:k.x+420,y:k.y},{sourceIds:[i]}),p(m("Đã xuất bản vẽ thành node Image — dùng làm ảnh tham chiếu được ngay."),"ok"),c()}catch(t){p(t.message,"error")}finally{O(!1)}}},lt=h.useMemo(()=>{const t=X.current?.getBoundingClientRect();return t?t.width/a:.5},[M,f]),ct=[["select","⬚",m("Chọn / di chuyển")],["pen","✎",m("Bút vẽ")],["arrow","↗",m("Mũi tên")],["rect","▭",m("Khung chữ nhật")],["ellipse","◯",m("Elip")],["eraser","⌫",m("Tẩy")],["text","T",m("Chữ")]];return u.jsxs("div",{className:"wb-backdrop",children:[u.jsxs("header",{children:[u.jsx("button",{onClick:$,title:m("Lưu và quay lại Canvas"),children:"↩"}),u.jsx("span",{children:m("Whiteboard — vẽ nháp ý tưởng, Export thành ảnh tham chiếu")}),u.jsx("select",{value:f,onChange:t=>s(t.target.value),"aria-label":m("Tỷ lệ khung"),children:Object.keys(U).map(t=>u.jsx("option",{value:t,children:t},t))}),u.jsx("button",{className:"primary",disabled:z,onClick:at,children:z?m("Đang xuất…"):"Export"})]}),u.jsx("div",{className:"wb-stage",children:u.jsxs("div",{className:"wb-frame",ref:X,style:{aspectRatio:`${a} / ${r}`},children:[u.jsx("canvas",{ref:L,width:a,height:r,style:{cursor:x==="select"?"default":x==="text"?"text":"crosshair"},onPointerDown:ot,onPointerMove:it,onPointerUp:V,onPointerLeave:V}),M&&u.jsx("textarea",{className:"wb-textedit",rows:2,ref:t=>t?.focus({preventScroll:!0}),onPointerDown:t=>t.stopPropagation(),style:{left:`${M.x/a*100}%`,top:`${M.y/r*100}%`,color:j,fontSize:Math.max(12,Math.round((C*4+16)*lt))},value:M.value,placeholder:m("Nhập chữ… Enter để đặt"),onChange:t=>_(e=>e&&{...e,value:t.target.value}),onKeyDown:t=>{Z.onKeyDown(t)||t.key==="Escape"&&_(null)},onCompositionEnd:Z.onCompositionEnd,onBlur:W})]})}),u.jsxs("footer",{children:[u.jsxs("div",{className:"wb-tools",children:[ct.map(([t,e,n])=>u.jsx("button",{className:x===t?"on":"",title:n,onClick:()=>{nt(t),P(null)},children:e},t)),u.jsx("span",{className:"wb-sep"}),u.jsx("button",{title:m("Hoàn tác"),onClick:Y,children:"↶"}),u.jsx("button",{title:m("Làm lại"),onClick:G,children:"↷"})]}),u.jsxs("div",{className:"wb-colors",children:[mt.map(t=>u.jsx("button",{className:`wb-swatch ${j===t?"on":""}`,style:{background:t},onClick:()=>J(t),"aria-label":t},t)),u.jsx("input",{type:"color",value:j,title:m("Màu tùy chọn"),onChange:t=>J(t.target.value)})]}),u.jsxs("label",{className:"wb-width",title:m("Độ dày nét / cỡ chữ"),children:[u.jsx("svg",{viewBox:"0 0 20 20",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:u.jsx("path",{d:"M3 15c3-6 6-9 14-11"})}),u.jsx("input",{type:"range",min:2,max:24,value:C,onChange:t=>rt(Number(t.target.value))})]})]})]})}export{$t as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-
|
|
2
|
-
import{_ as et}from"./titleFrameBudget-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-C7J0Tqhb.js","assets/api-CJ8PdbfZ.js","assets/titleFrameBudget-CLZWaFHO.js","assets/three.module-Bx43vjkH.js","assets/GLTFLoader-BHWu1lKg.js","assets/store-DW4E9xnW.js","assets/rotoMaskStore-DPziPKAN.js","assets/textAnimators-DUZjhVGO.js","assets/timelineComp-B4GtoH2f.js","assets/rigTrack-urT3nDK0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as et}from"./titleFrameBudget-CLZWaFHO.js";import{jr as U,iY as G,fq as J,gM as y,dH as b,fs as V,js as at,iR as ot,hG as W,fJ as it,fD as nt,fE as Y,ft as rt,hD as st,iW as ct}from"./remote-C7J0Tqhb.js";import{c as mt}from"./cameraPresets-CYw0OdM3.js";import"./api-CJ8PdbfZ.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./store-DW4E9xnW.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";const z=()=>crypto.randomUUID(),u=o=>Math.round(o*100)/100,lt=o=>st(o)*(o.scale[1]||1);function B(o,c){const a=y(o),k=a.duration/c,e=l=>l?.map(i=>({...i,time:Math.min(1,i.time*k)})),s={...a,duration:c,cameraKeys:e(a.cameraKeys)??[],objectKeys:Object.fromEntries(Object.entries(a.objectKeys||{}).map(([l,i])=>[l,e(i)||[]])),...a.flight?{flight:Object.fromEntries(Object.entries(a.flight).map(([l,i])=>[l,e(i)||[]]))}:{}};return{...o,shots:o.shots.map(l=>l.id===a.id?s:l)}}function R(o,c,a,k,e){const s=y(o),l=s.duration,i=(s.objectKeys?.[c.id]||[]).filter(p=>p.time*l<a-1e-6);return{...o,shots:o.shots.map(p=>p.id===s.id?{...p,objectKeys:{...p.objectKeys,[c.id]:[...i,{id:z(),time:a/l,position:k.map(_=>+_.toFixed(3)),rotation:[0,+e.toFixed(1),0],scale:c.scale}]}}:p)}}const Q=(o,c)=>Math.atan2(c[0]-o[0],c[2]-o[2])*180/Math.PI;async function St(o,c){const a=U.find(t=>t.id===String(o.move??""));if(!a)return{ok:!1,error:`unknown move; use one of ${U.map(t=>t.id).join(", ")}`};const k=c.getStage();let e,s;try{e=G(k,String(o.name??""))}catch(t){return{ok:!1,error:t.message}}if(!J(e))return{ok:!1,error:`'${e.name}' is not a person`};const l=y(k),i=Math.max(0,Number(o.time??0)||0);if(o.target!=null)try{s=G(k,String(o.target))}catch(t){return{ok:!1,error:t.message}}else{const t=b(e,l,Math.min(1,i/l.duration)).position,m=k.items.filter(n=>n.id!==e.id&&J(n)&&!n.hidden).map(n=>{const r=b(n,l,Math.min(1,i/l.duration)).position;return{i:n,d:Math.hypot(r[0]-t[0],r[2]-t[2])}}).sort((n,r)=>n.d-r.d)[0];if(!m)return{ok:!1,error:"no target: put another person in the scene or give target"};s=m.i}const p=V(a.id),_=at(a.id);if(!p||!_)return{ok:!1,error:`the clip ${a.id} is missing`};const v=[];let h=k;i+p.duration+1.6>l.duration&&(h=B(h,Math.min(300,Math.ceil((i+p.duration+1.8)*10)/10)));let S=y(h),w=S.duration;const j=i+_.at,$=j+(a.ranged?a.travel??.6:0),g=b(e,{...S,flight:void 0},Math.min(1,i/w)).position,M=b(s,{...S,flight:void 0},Math.min(1,$/w)).position,C=Q(g,M);let x=g;if(!a.ranged){const t=(_.dz+(a.reach??.8))*lt(e),m=Math.hypot(M[0]-g[0],M[2]-g[2])||1,n=(g[0]-M[0])/m,r=(g[2]-M[2])/m;x=[M[0]+n*t,g[1],M[2]+r*t];const f=Math.hypot(x[0]-g[0],x[2]-g[2]);if(f>.3&&i>.25){const d=Math.min(.8,Math.max(.2,f/6),i);h=R(h,e,i-d,g,C),v.push(`${e.name} closes ${u(f)} m in ${u(d)} s before the strike${f>3?" (for a longer approach play ac-superman-glide / ac-burst-dash before)":""}`)}}h=R(h,e,i,x,C);const F=(t,m,n)=>{const r=y(n),f=r.flight?.[t.id];return!!f?.length&&ct(f,Math.min(1,m/r.duration),r.duration).air>.5};a.land&&F(e,i,h)&&(S=y(h),w=S.duration,h={...h,shots:h.shots.map(t=>t.id===S.id?{...t,flight:{...t.flight,[e.id]:ot(t.flight?.[e.id],{time:j/w,on:!1})}}:t)},v.push(`${e.name} lands on the strike (flight off at ${u(j)} s)`));const O=W(h,e.id,p,{start:i/y(h).duration,newId:z,loop:!1});if(!O.ok)return{ok:!1,error:O.error};c.setStage(()=>O.stage);const{runTool:X}=await et(async()=>{const{runTool:t}=await import("./remote-C7J0Tqhb.js").then(m=>m.jA);return{runTool:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),q=[];for(const t of a.fx){const m=t.at==="strike"?j:i,n={effect:t.fx,start:u(m),duration:t.duration,...t.params?{params:t.params}:{},...o.color?{color:o.color}:{}},r=it(t.fx)?.attach==="path",f=t.place==="self"?{...n,attach_to:e.name}:t.place==="target"?{...n,at:`${s.name}.chest`}:t.place==="trail"?{...n,from:`${e.name}.chest`,to:`${s.name}.chest`}:t.place==="path"?{...n,from:`${e.name}.hand_right`,to:`${s.name}.chest`}:r?{...n,from:`${e.name}.feet`,to:`${s.name}.feet`}:{...n,at:`${s.name}.feet`},d=await X("add_effect",f,c);d.ok?q.push({effect:t.fx,start_s:u(m)}):v.push(`${t.fx}: ${String(d.error)}`)}const I=String(o.react??"hit");let T=null;if(I!=="none"){const t=F(s,$,c.getStage()),[m,n]=I==="block"?t?["ac-air-block",.16]:["xx-palm-shield",.22]:I==="evade"?t?a.heavy?["ac-backflip-evade",.3]:["ac-corkscrew-dodge",.2]:["xx-teleport",.26]:t?[a.heavy?"ac-air-knocked-spin":"ac-air-recoil",0]:[(a.heavy,"xx-knocked-flying"),0],r=Math.max(0,$-n),f=V(m);if(f){let d=c.getStage();const E=y(d),A=E.duration,L=b(s,{...E,flight:void 0},Math.min(1,r/A)).position,Z=b(e,E,Math.min(1,r/A)).position;d=R(d,s,r,L,Q(L,Z)),r+f.duration+.3>A&&(d=B(d,Math.min(300,Math.ceil((r+f.duration+.4)*10)/10)));const P=W(d,s.id,f,{start:r/y(d).duration,newId:z,loop:!1});if(P.ok){if(c.setStage(()=>P.stage),T={motion:m,at_s:u(r)},I==="hit"&&o.timing!==!1){const K=y(c.getStage()),tt=nt(rt(K.timing,K.duration),[$],a.heavy?Y.heavy:Y.medium,K.duration);c.setStage(N=>({...N,shots:N.shots.map(H=>H.id===K.id?{...H,timing:tt??void 0}:H)}))}}else v.push(`${s.name} ${m}: ${P.error}`)}}const D=[];if(o.camera===!0){const t=[["wide-track",e,i,$+.2]];a.heavy&&t.push(["low-hero",s,$+.2,$+1.4]);for(const[m,n,r,f]of t){const d=mt(c.getStage(),{preset:m,subject:n.id,start:r,end:f});d.ok&&(c.setStage(()=>d.stage),D.push(`${m} ${u(r)}–${u(f)} s`))}}return{ok:!0,move:a.id,attacker:e.name,target:s.name,start_s:u(i),strike_s:u(j),impact_s:u($),end_s:u(i+p.duration),effects:q,...T?{reaction:T}:{},...D.length?{camera:D}:{},...v.length?{notes:v}:{}}}export{St as aerialStrike};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/views-
|
|
2
|
-
import{_ as A}from"./titleFrameBudget-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/views-ozVF4ABO.js","assets/three.module-Bx43vjkH.js","assets/GLTFLoader-BHWu1lKg.js","assets/skin-DY4QLaBI.js","assets/remote-C7J0Tqhb.js","assets/api-CJ8PdbfZ.js","assets/titleFrameBudget-CLZWaFHO.js","assets/store-DW4E9xnW.js","assets/rotoMaskStore-DPziPKAN.js","assets/textAnimators-DUZjhVGO.js","assets/timelineComp-B4GtoH2f.js","assets/rigTrack-urT3nDK0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as A}from"./titleFrameBudget-CLZWaFHO.js";import{gM as y,gy as N,gA as _,ir as M,iY as v,gz as S,dV as O,jc as q,gG as z,gH as F,gD as G,gE as E,gF as V,gI as P,gC as U,fU as C}from"./remote-C7J0Tqhb.js";import{f as L,d as H,e as T}from"./skin-DY4QLaBI.js";import"./api-CJ8PdbfZ.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./store-DW4E9xnW.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";const K=["humanoid","quadruped","chain","hinge","wheels"],B=()=>crypto.randomUUID(),Y=o=>Math.round(o*100)/100,w=o=>o.joints.filter(n=>!O(o.joints,n)).map(n=>n.name);function ae(o,n){const i=o.rig,e=y(n),r=(e.objectKeys?.[o.id]||[]).filter(a=>a.bones),u=new Set;for(const a of r)for(const[s,t]of Object.entries(a.bones))t.some(c=>Math.abs(c)>.05)&&u.add(s);const g=w(i);return{rig:i.kind,rig_source:i.source,fingers:_(i),bones:g.filter(a=>!M(a)),..._(i)?{finger_bones:"thumb|index|middle|ring|pinky + 1..3 + L|R (e.g. index2R); hand shapes via set_pose hands curl them"}:{},keyed_bones:[...u],bone_key_times:r.map(a=>Y(a.time*e.duration)),...i.bones?{posed_bones:Object.keys(i.bones)}:{},...N(i)?{posable:"humanoid skeleton: set_pose, play_motion, hold_prop, set_gaze and resolve_hits work on it like on a mannequin"}:{}}}function x(o,n){const i=w(o);return i.find(e=>e===n)??i.find(e=>e.toLowerCase()===n.toLowerCase())??null}const R=o=>Array.isArray(o)&&o.length===3&&o.every(n=>Number.isFinite(Number(n)))?o.map(n=>Math.round(Math.max(-S.angle,Math.min(S.angle,Number(n)))*100)/100):null;function $(o,n,i,e,r){o.setStage(u=>{const g=y(u),a=u.items.find(d=>d.id===n.id),s=g.objectKeys?.[n.id]||[],t=(d,h)=>{const k=s.find(j=>Math.abs(j.time-d)<1e-6),p=C(a,g,d);return{...k,id:k?.id||B(),time:d,position:p.position,rotation:p.rotation,scale:p.scale,bones:h}};let c=[...s];if(!s.some(d=>d.bones)&&i>1e-6){const d=t(0,{...a.rig?.bones||{}});c=[...c.filter(h=>h.id!==d.id),d]}const m=U(c,i,a.rig?.bones),{poseEase:f,...b}=t(i,{...m,...e}),l=r&&r!=="smooth"?{...b,poseEase:r}:b;return c=[...c.filter(d=>d.id!==l.id),l].sort((d,h)=>d.time-h.time),{...u,shots:u.shots.map(d=>d.id===g.id?{...d,objectKeys:{...d.objectKeys,[n.id]:c}}:d)}})}async function D(o,n){const i=o.engine();if(!i)return null;for(let e=0;e<200;e++){i.sync(o.getStage(),null);const r=i.objects.children.find(u=>u.userData.id===n)?.children[0];if(r)return r;await new Promise(u=>setTimeout(u,100))}return null}async function I(o,n){const i=v(o.getStage(),String(n.name));if(i.kind!=="model"||!i.model)return{ok:!1,error:`'${i.name}' is not a GLB model; people (mannequins) are already posable`};const e=String(n.kind??"humanoid");if(!K.includes(e))return{ok:!1,error:`unknown kind '${e}'; use ${K.join(", ")}`};const r=[];let u=n.ai===!0;if(u&&e!=="humanoid")return{ok:!1,error:"the AI auto-rig is for humanoid characters only; use the free template of that kind (ai:false)"};u&&!q(o.userText)&&(u=!1,r.push("ai:true refused — the user did not ask for the paid AI auto-rig; the free humanoid template was used (no credits). Only use ai:true when the user explicitly asks for AI / auto-rig."));const g=await D(o,i.id);if(!g)return{ok:!1,error:`${i.name} is not loaded (renderer not ready or the GLB failed to load)`};const a=e==="humanoid"&&!u&&n.file_skeleton!==!1?o.engine()?.nativeSkeleton?.(i.id):null;if(a?.ok)return o.setStage(l=>({...l,items:l.items.map(d=>d.id===i.id?{...d,rig:void 0,skeleton:"native"}:d)})),o.engine()?.sync(o.getStage(),null),{ok:!0,name:i.name,rig:"humanoid",source:"file",bones:a.bones,fileBones:a.total,credits:0,paid:!1,...r.length?{notes:r}:{},hint:"the model plays on its own skeleton and skin from the file (as in Blender): set_pose, play_motion, stage_spell_duel, hold_prop and set_gaze work on it"};const s=L(g);if(s.isEmpty())return{ok:!1,error:`${i.name} has no geometry to rig`};let t,c=0,m=null;if(u){const l=(o.rigViews??(await A(async()=>{const{renderRigViews:p}=await import("./views-ozVF4ABO.js");return{renderRigViews:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))).renderRigViews)(g),d=o.rigAgent??(await A(async()=>{const{rigAgent:p}=await import("./api-CJ8PdbfZ.js").then(j=>j.c2);return{rigAgent:p}},__vite__mapDeps([5,6]))).rigAgent,h={requestId:B(),front:l.front,side:l.side,name:i.name};let k;try{k=await d(h)}catch(p){if(!(p instanceof TypeError))return{ok:!1,error:p.message||"AI auto-rig failed (no credits charged)"};k=await d(h)}if(!k.humanoid||!k.landmarks||!k.landmarks.humanoid)return{ok:!1,error:"the AI did not see a humanoid in this model; no credits were charged. Use a free template: quadruped / chain / hinge / wheels, or humanoid.",credits:0};t=z(k.landmarks,l.frame),c=k.credits,m=F(k.landmarks,l.frame)}else{const l=e==="humanoid"?H(g):null;t=G(e,{min:s.min.toArray(),max:s.max.toArray()},{segments:Number(n.segments)||4,...l?{tips:l}:{}})}e==="humanoid"&&n.fingers!==!1&&(t=E(t,{positions:T(g).positions,tips:m})),o.setStage(l=>({...l,items:l.items.map(d=>d.id===i.id?{...d,rig:t,skeleton:void 0}:d)}));const f=o.engine();let b;if(f){f.sync(o.getStage(),null),await f.rigReady();const l=f.objects.children.find(d=>d.userData.id===i.id)?.children[0]?.userData.rig;l&&(b={vertices:l.info.vertices,ms:l.info.ms,source:l.info.source})}return{ok:!0,name:i.name,rig:t.kind,source:t.source,joints:t.joints.length,fingers:_(t),bones:w(t).filter(l=>!M(l)),credits:c,paid:u,...b?{weights:b}:{},...r.length?{notes:r}:{},hint:t.kind==="humanoid"?"humanoid skeleton: set_pose, play_motion, hold_prop, set_gaze, resolve_hits now work on it; set_bone_rotation / set_bone_keys turn single bones":"turn its bones with set_bone_rotation / set_bone_keys (time = a key)"}}async function J(o,n){const i=o.getStage(),e=v(i,String(n.name)),r=String(n.action||"");if(e.locked)return{ok:!1,error:`${e.name} is locked in the composer`};const u=s=>s.map(t=>(({bones:c,...m})=>m)(t));if(r==="remove")return!e.rig&&e.skeleton!=="native"?{ok:!1,error:`${e.name} has no skeleton`}:(o.setStage(s=>({...s,items:s.items.map(t=>t.id!==e.id?t:(({rig:c,skeleton:m,...f})=>f)(t)),shots:s.shots.map(t=>t.objectKeys?.[e.id]?{...t,objectKeys:{...t.objectKeys,[e.id]:u(t.objectKeys[e.id])}}:t)})),{ok:!0,name:e.name,removed:"skeleton and its bone keys"});if(!e.rig)return{ok:!1,error:`${e.name} has no editable skeleton; rig_template gives it one`};if(r==="reset_bones")return o.setStage(s=>({...s,items:s.items.map(t=>t.id===e.id&&t.rig?{...t,rig:(({bones:c,...m})=>m)(t.rig)}:t),shots:s.shots.map(t=>t.id!==s.activeShot||!t.objectKeys?.[e.id]?t:{...t,objectKeys:{...t.objectKeys,[e.id]:u(t.objectKeys[e.id])}})})),{ok:!0,name:e.name,reset:"every bone back to rest (bone keys of this shot removed)"};const g=await D(o,e.id);if(!g)return{ok:!1,error:`${e.name} is not loaded (it needs the 3D view: a scene open in the composer or the render machine)`};let a;if(r==="mirror"){const s=L(g);a=V(e.rig,(s.min.x+s.max.x)/2)}else if(r==="fingers")a=n.on===!1?P(e.rig):_(e.rig)?e.rig:E(e.rig,{positions:T(g).positions});else return{ok:!1,error:"action must be remove, reset_bones, mirror or fingers"};return o.setStage(s=>({...s,items:s.items.map(t=>t.id===e.id?{...t,rig:a}:t)})),{ok:!0,name:e.name,action:r,joints:a.joints.length,fingers:_(a)}}async function de(o,n,i){try{if(o==="auto_rig")return await I(i,n);if(o==="rig_template")return await I(i,{...n,ai:!1});if(o==="rig_edit")return await J(i,n);const e=i.getStage(),r=v(e,String(n.name)),u=y(e);if(!r.rig)return{ok:!1,error:`${r.name} has no skeleton; call auto_rig first (people mannequins use set_pose)`};const g=n.ease==null?void 0:String(n.ease);if(g&&!["smooth","snap","hold","overshoot"].includes(g))return{ok:!1,error:`unknown ease '${g}'`};if(o==="set_bone_rotation"){const a=x(r.rig,String(n.bone??"")),s=R(n.rotation_deg);if(!a)return{ok:!1,error:`unknown bone '${String(n.bone)}' of ${r.name}; bones: ${w(r.rig).join(", ")}`};if(!s)return{ok:!1,error:"rotation_deg must be [x, y, z] degrees"};if(n.time==null)return i.setStage(c=>({...c,items:c.items.map(m=>{if(m.id!==r.id||!m.rig)return m;const f={...m.rig.bones||{},[a]:s};return s.every(b=>b===0)&&delete f[a],{...m,rig:{...m.rig,...Object.keys(f).length?{bones:f}:{bones:void 0}}}}),shots:c.shots.map(m=>m.id!==c.activeShot||!m.objectKeys?.[r.id]?.some(f=>f.bones)?m:{...m,objectKeys:{...m.objectKeys,[r.id]:m.objectKeys[r.id].map(f=>f.bones?{...f,bones:{...f.bones,[a]:s}}:f)}})})),{ok:!0,name:r.name,bone:a,rotation_deg:s,whole_shot:!0};const t=Math.max(0,Math.min(1,Number(n.time)/u.duration));return $(i,r,t,{[a]:s},g),{ok:!0,name:r.name,bone:a,rotation_deg:s,time:Number(n.time),bone_keys:(y(i.getStage()).objectKeys?.[r.id]||[]).filter(c=>c.bones).length}}if(o==="set_bone_keys"){if(n.time==null)return{ok:!1,error:"set_bone_keys needs time (seconds); use set_bone_rotation without time for the whole shot"};const a=n.bones&&typeof n.bones=="object"&&!Array.isArray(n.bones)?Object.entries(n.bones):[];if(!a.length)return{ok:!1,error:"bones must map bone names to [x, y, z] degrees"};const s={},t=[];for(const[m,f]of a.slice(0,S.joints)){const b=x(r.rig,m),l=R(f);!b||!l?t.push(m):s[b]=l}if(t.length)return{ok:!1,error:`unknown bones or bad angles: ${t.join(", ")}; bones: ${w(r.rig).join(", ")}`};const c=Math.max(0,Math.min(1,Number(n.time)/u.duration));return $(i,r,c,s,g),{ok:!0,name:r.name,time:Number(n.time),bones_set:Object.keys(s),bone_keys:(y(i.getStage()).objectKeys?.[r.id]||[]).filter(m=>m.bones).length}}return{ok:!1,error:`unknown tool '${o}'`}}catch(e){return{ok:!1,error:e.message||String(e)}}}export{K as RIG_TEMPLATE_KINDS,ae as rigSummary,de as runRigTool,w as turnableBones};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as v}from"./store-
|
|
1
|
+
import{u as v}from"./store-DW4E9xnW.js";import{t as S}from"./api-CJ8PdbfZ.js";import{am as A}from"./remote-C7J0Tqhb.js";import{af as y,A as I,ag as k,l as P,x as _,z as j,I as F}from"./main-VVYiW8XD.js";import{runAnalyzerCode as R}from"./analyzerSandbox-DuIVFnsk.js";import{e as E}from"./pluginAutomation-CkP3tA9r.js";import"./titleFrameBudget-CLZWaFHO.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";import"./spark.module-DzziUgOj.js";import"./userFonts-CwlKh9NR.js";import"./lottieLayer-DzbA3bHV.js";import"./timeline3d-DOw-CpZI.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-QYsT9JBO.js";import"./captionLayout-DvDPTwO9.js";import"./timelineText-BH09jfSM.js";import"./titleArt-Drsrtfiv.js";import"./rotoMatte-C-2o3vv0.js";import"./distortGL-QalhICvi.js";import"./motionBlur-uAm030t9.js";async function $(t){const{plugins:o}=await P(),r=o.find(a=>a.id===t.id&&a.enabled);if(!r)throw _("use_missing",[t.id]);const n=t.item?await j(r,t.item):await F(r);if(n.manifest.kind!=="analyzer")throw _("use_plugin",[0,t.item?`${t.id}/${t.item}`:t.id],"not an analyzer plug-in");return n}async function O(t,o,r){if(window.__analyzerFramesStub)return window.__analyzerFramesStub(t,o);const n=Object.assign(document.createElement("video"),{muted:!0,playsInline:!0,preload:"auto",crossOrigin:"anonymous"});n.src=t.url;try{await new Promise((l,h)=>{n.onloadeddata=()=>l(),n.onerror=()=>h(Error(S("Không đọc được video của clip (CORS / định dạng)")))});const a=n.videoWidth||1280,d=n.videoHeight||720,e=Math.min(o.width,a),s=Math.max(2,Math.round(e*d/a)),i=Object.assign(document.createElement("canvas"),{width:e,height:s}),m=i.getContext("2d",{willReadFrequently:!0}),p=t.playbackRate||1,b=t.inPoint||0,z=Math.min(t.duration,o.maxSeconds),c=Math.max(1,Math.floor(z*o.fps)),g=new Uint8Array(e*s*c);for(let l=0;l<c;l++){r?.aborted;const h=Math.max(0,Math.min(n.duration-1/60,b+l/o.fps*p));Math.abs(n.currentTime-h)>1e-4&&await new Promise((u,w)=>{const M=window.setTimeout(()=>w(Error(S("Seek video quá lâu"))),8e3);n.onseeked=()=>{window.clearTimeout(M),u()},n.currentTime=h}),m.drawImage(n,0,0,e,s);const f=m.getImageData(0,0,e,s).data,x=l*e*s;for(let u=0,w=0;u<f.length;u+=4,w++)g[x+w]=f[u]*77+f[u+1]*150+f[u+2]*29>>8}return{fps:o.fps,width:e,height:s,count:c,data:g,sourceWidth:a,sourceHeight:d}}finally{n.removeAttribute("src"),n.load()}}function T(t){const o=v.getState().timelineMedia.find(i=>t.gcsUri&&i.gcsUri===t.gcsUri||i.url===t.url),r=t.playbackRate||1,n=t.inPoint||0,a=i=>+((i-n)/r).toFixed(3),d=i=>a(i.end)>0&&a(i.start)<t.duration,e=(o?.words??[]).filter(d).slice(0,y.words).map(i=>({start:a(i.start),end:a(i.end),word:String(i.word).slice(0,60)})),s=(o?.pauses??[]).filter(d).map(i=>({start:a(i.start),end:a(i.end)}));return{words:e,pauses:s}}async function dt(t,o){const r=o.params??{};if(!r.plugin?.id)throw Error("runAnalyzer: no plug-in");if(t.kind!=="video"||!t.url)throw Error(S("Plug-in phân tích cần một clip video"));const n=await $(r.plugin),a=n.manifest,d=a.sample??{fps:y.fps.default,width:y.width.default,maxSeconds:y.maxSeconds.default},e=await O(t,d),s={clip:{duration:t.duration,width:e.sourceWidth,height:e.sourceHeight},frames:{fps:e.fps,width:e.width,height:e.height,count:e.count,data:e.data},...T(t),params:I(a,r.values??{})},i=k(await R(n.entry,s),t.id);if(!i.ops.length)return E("plugin.analyzed",{project_id:v.getState().canvasId??null,clip_id:t.id,plugin:r.plugin.item?`${r.plugin.id}/${r.plugin.item}`:r.plugin.id,ops:0,summary:i.summary}),{};const m=A([t],i.ops);if(m.errors?.length)throw Error(String(m.errors[0]).slice(0,200));const p=m.clips.find(g=>g.id===t.id);if(!p)throw Error("runAnalyzer: the clip was lost");const{id:b,clientJobs:z,...c}=p;return E("plugin.analyzed",{project_id:v.getState().canvasId??null,clip_id:t.id,plugin:r.plugin.item?`${r.plugin.id}/${r.plugin.item}`:r.plugin.id,ops:i.ops.length,summary:i.summary}),c}export{dt as runAnalyzerJob};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{af as d}from"./main-VVYiW8XD.js";import"./titleFrameBudget-CLZWaFHO.js";import"./remote-C7J0Tqhb.js";import"./api-CJ8PdbfZ.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-BHWu1lKg.js";import"./store-DW4E9xnW.js";import"./rotoMaskStore-DPziPKAN.js";import"./textAnimators-DUZjhVGO.js";import"./timelineComp-B4GtoH2f.js";import"./rigTrack-urT3nDK0.js";import"./spark.module-DzziUgOj.js";import"./userFonts-CwlKh9NR.js";import"./lottieLayer-DzbA3bHV.js";import"./timeline3d-DOw-CpZI.js";import"./RoomEnvironment-Dmv_G5ka.js";import"./exportEncode-QYsT9JBO.js";import"./captionLayout-DvDPTwO9.js";import"./timelineText-BH09jfSM.js";import"./titleArt-Drsrtfiv.js";import"./rotoMatte-C-2o3vv0.js";import"./distortGL-QalhICvi.js";import"./motionBlur-uAm030t9.js";const u=`
|
|
2
2
|
const clamp=(v,a,b)=>Math.min(b,Math.max(a,v))
|
|
3
3
|
function frameAt(f,i){const n=f.width*f.height;return f.data.subarray(i*n,(i+1)*n)}
|
|
4
4
|
function diff(f,i,j){const a=frameAt(f,i),b=frameAt(f,j),W=f.width,H=f.height;let s=0,sx=0,sy=0;for(let y=0;y<H;y++)for(let x=0;x<W;x++){const k=y*W+x,d=Math.abs(a[k]-b[k]);if(d>24){s+=d;sx+=x*d;sy+=y*d}}
|