Is there a way to individually animate meshes within a single .js file exported from Blender using Three.js?
The cube named "Cube" successfully loads, but attempts to select it by Name or Id fail to recognize the variable item1.
loader = new THREE.JSONLoader();
loader.load('engine.js', function (geometry, materials) {
var mesh, material;
material = new THREE.MeshFaceMaterial(materials);
mesh = new THREE.Mesh(geometry, material);
mesh.scale.set(1, 1, 1);
var item1 = scene.getObjectByName("Cube");
item1.position.x = 15;
scene.add(mesh);
});
A similar issue was found in this unresolved post: Three.js load multiple separated objects / JSONLoader
What is the recommended approach for loading and animating multiple meshes with JSONLoader? Ideally, I would like to load them together in one .js file and choose which ones to animate.
Thank you for your assistance!