@fleox/agent3d 0.2.2 → 0.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.
- package/README.md +11 -10
- package/changelog.json +9 -0
- package/dist/agent/agent3d.mjs +2 -2
- package/dist/agent/chunks/{package-Dkr2v4or.mjs → package-fw4h5vsh.mjs} +1 -1
- package/dist/runtime/agent3d-runtime.js +1 -1
- package/dist/runtime/agent3d-runtime.single.js +1 -1
- package/dist/studio/assets/{camera-braC-Y4j.js → camera-Be6lnp3k.js} +1 -1
- package/dist/studio/assets/{editor-DwKj0yf_.js → editor-Mpnz-b2E.js} +1 -1
- package/dist/studio/assets/{game-Bd0sO8CA.js → game-WMgRSJUD.js} +3 -3
- package/dist/studio/assets/{generators-CFiebqmG.js → generators-DozXE7ta.js} +1 -1
- package/dist/studio/assets/{index-C87jPees.js → index-tSGZFEt5.js} +4 -4
- package/dist/studio/assets/{model-Bg7e4Z-9.js → model-C2bZTK7-.js} +1 -1
- package/dist/studio/assets/{physicsHost-CwJdYJ2g.js → physicsHost-CTRsIvfu.js} +1 -1
- package/dist/studio/assets/{postfx-CGkvYb03.js → postfx-DQtp0JIy.js} +1 -1
- package/dist/studio/assets/{runtime-DNb5FyOS.js → runtime-NGp1VdnH.js} +4 -4
- package/dist/studio/assets/{shaders-Brwuj1zc.js → shaders-BOb6Uter.js} +1 -1
- package/dist/studio/assets/{svg-Db96jdHi.js → svg-CnUMpv_N.js} +1 -1
- package/dist/studio/assets/{text-DqnNIq0M.js → text-CGIZs8HE.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agent3d-assets/SKILL.md +24 -24
- package/plugin/skills/agent3d-create/SKILL.md +20 -20
- package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
- package/plugin/skills/agent3d-create/references/recipes.md +6 -6
- package/plugin/skills/agent3d-edit/SKILL.md +22 -22
- package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
- package/plugin/skills/agent3d-game/SKILL.md +7 -7
- package/plugin/skills/agent3d-publish/SKILL.md +21 -21
- package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GLTFLoader-1Zd9N406.js","./three.module-CnI50X0U.js","./BufferGeometryUtils-CAlXAboW.js","./SkeletonUtils-CG5akqME.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Ln as e,U as t,c as n,d as r,ht as i,mt as a}from"./three.module-CnI50X0U.js";import{v as o}from"./camera-
|
|
2
|
+
import{Ln as e,U as t,c as n,d as r,ht as i,mt as a}from"./three.module-CnI50X0U.js";import{v as o}from"./camera-Be6lnp3k.js";import{o as s}from"./runtime-NGp1VdnH.js";import{h as c}from"./index-tSGZFEt5.js";var l=new Map;function u(e){let t=new Uint8Array(e),n;if(t.byteLength>=20&&new DataView(e).getUint32(0,!0)===1179937895){let r=new DataView(e).getUint32(12,!0);n=new TextDecoder().decode(t.subarray(20,20+r))}else n=new TextDecoder().decode(t);try{let e=JSON.parse(n);return Array.isArray(e.extensionsUsed)?e.extensionsUsed.filter(e=>typeof e==`string`):[]}catch{return[]}}async function d(e){let t=l.get(e);return t||(t=(async()=>{let[{GLTFLoader:t},n]=await Promise.all([c(()=>import(`./GLTFLoader-1Zd9N406.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),fetch(e)]);if(!n.ok)throw Error(`HTTP ${n.status} for ${e}`);let r=await n.arrayBuffer(),i=u(r);if(i.includes(`KHR_draco_mesh_compression`))throw Error(`${e} uses Draco compression (KHR_draco_mesh_compression), which the Agent3D runtime does not decode. Re-export it without Draco (Blender: uncheck "Compression"), or convert it to meshopt with gltfpack (\`gltfpack -i in.glb -o out.glb -cc\`), then run \`agent3d assets optimize\`.`);let a=new t;if(i.includes(`EXT_meshopt_compression`)){let{MeshoptDecoder:e}=await c(async()=>{let{MeshoptDecoder:e}=await import(`./meshopt_decoder.module-DXTYc6wn.js`);return{MeshoptDecoder:e}},[],import.meta.url);await e.ready,a.setMeshoptDecoder(e)}let o=e.slice(0,e.lastIndexOf(`/`)+1);return a.parseAsync(r,/^data:/.test(e)?``:o)})(),t.catch(()=>l.delete(e)),l.set(e,t)),t}function f(e,t){e.traverse(e=>{let n=e;if(n.isMesh&&n.morphTargetDictionary&&n.morphTargetInfluences)for(let[e,r]of Object.entries(t)){let t=n.morphTargetDictionary[e];t!==void 0&&typeof r==`number`&&(n.morphTargetInfluences[t]=r)}})}async function p(l,u){let p=await d(u.resolveAsset(l.src)),{clone:m}=await c(async()=>{let{clone:e}=await import(`./SkeletonUtils-CG5akqME.js`);return{clone:e}},[],import.meta.url),h=m(p.scene),g=new t;g.add(h),h.updateMatrixWorld(!0);let _=new r().setFromObject(h);if(!_.isEmpty()){let t=_.getSize(new e),n=Math.max(t.x,t.y,t.z),r=l.fit&&n>0?l.fit/n:1;if(h.scale.multiplyScalar(r),l.center!==!1){let t=_.getCenter(new e);h.position.set(-t.x*r,-_.min.y*r,-t.z*r)}}h.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=l.castShadow??!0,t.receiveShadow=l.receiveShadow??!1)}),l.material&&await s(h,l.material,u),l.morph&&f(h,l.morph);let v;if(p.animations.length){let e=new n(h),t=null,r=e=>typeof e==`number`||/^\d+$/.test(String(e))?p.animations[Number(e)]:p.animations.find(t=>t.name===e)??p.animations.find(t=>t.name.toLowerCase().includes(String(e).toLowerCase())),s=new Set,c=e=>{let t=r(e);return!t&&!s.has(String(e))&&(s.add(String(e)),u.issue(`asset-load`,`Model ${l.id} has no animation clip "${e}" (clips: ${p.animations.map(e=>e.name).join(`, `)})`,`objects#${l.id}.animation.clip`)),t},d=(n,r={})=>{let s=c(n);if(!s)return;let l=e.clipAction(s);l.setLoop(r.loop===!1?a:i,1/0),l.clampWhenFinished=r.loop===!1,l.timeScale=o(r.speed,1),l.enabled=!0,t&&t!==l?(l.reset().setEffectiveWeight(1).play(),t.crossFadeTo(l,o(r.crossfade,.3),!1)):l.setEffectiveWeight(1).play(),t=l},f=t=>{let n=c(t);if(!n)return null;let r=e.clipAction(n);return r.isRunning()||(r.enabled=!0,r.setLoop(i,1/0),r.play()),r},m={weight(e,t){f(e)?.setEffectiveWeight(Math.max(0,t))},speed(e,t){let n=f(e);n&&(n.timeScale=t)},time(e,t){let n=f(e);n&&(n.paused=!0,n.time=Math.max(0,t))}},g=l.animation??{},_=()=>{e.stopAllAction(),t=null,d(g.clip??0,g),g.offset&&t&&(t.time=Math.max(0,g.offset));for(let[e,t]of Object.entries(g.blend??{}))m.weight(e,t);e.update(0)};v={mixer:e,clips:p.animations,play:d,control:m,reset:_},_()}return{object:g,animator:v}}export{p as buildModel};
|