Skip to content
Snippets Groups Projects
Commit ea383606 authored by netpro2k's avatar netpro2k
Browse files

Fix cloning of GLTFs with unnamed bones

parent 894ac59a
No related branches found
No related tags found
No related merge requests found
......@@ -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 = {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment