diff --git a/src/elements/a-gltf-entity.js b/src/elements/a-gltf-entity.js index 3c9c07031eecbf21069569b0f2738fe48afcea25..6c4490d23ac35a194afd0ddd8f388b6ae651be6d 100644 --- a/src/elements/a-gltf-entity.js +++ b/src/elements/a-gltf-entity.js @@ -22,19 +22,21 @@ AFRAME.AGLTFEntity = { // From https://gist.github.com/cdata/f2d7a6ccdec071839bc1954c32595e87 // Tracking glTF cloning here: https://github.com/mrdoob/three.js/issues/11573 function cloneGltf(gltf) { - const clone = { - animations: gltf.animations, - scene: gltf.scene.clone(true) - }; - const skinnedMeshes = {}; - gltf.scene.traverse(node => { + if (!node.name) { + node.name = node.uuid; + } if (node.isSkinnedMesh) { skinnedMeshes[node.name] = node; } }); + const clone = { + animations: gltf.animations, + scene: gltf.scene.clone(true) + }; + const cloneBones = {}; const cloneSkinnedMeshes = {};