Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.
JavaScript 3d3d-assets3d-modelingagent-skillsagent-toolsai-agentsasset-pipelinecligame-assetsglbgltfmcpmcp-servermodel-context-protocolprocedural-generationprocedural-modelingtext-to-3dthreejstypescript
import test from 'node:test';import assert from 'node:assert/strict';import * as THREE from 'three/webgpu';import {createRoleLookup,findRole} from '../src/game/assets.mjs';
test('retained role lookup preserves first depth-first aliases without later traversal',()=>{
const root=new THREE.Group(),a=new THREE.Object3D(),b=new THREE.Object3D();a.name='Mesh_hand';a.userData.role='grip';b.name='hand';root.add(a,b);
const expected=['hand','Mesh_hand','grip','missing'].map(name=>findRole(root,name)),lookup=createRoleLookup(root);root.traverse=()=>{throw Error('Repeated traversal');};
assert.deepEqual(['hand','Mesh_hand','grip','missing'].map(lookup),expected);
});