diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index 350649dd5645bb3e14783c2f38f396ffec43d322..ba2ef5461fed1398581e04276ff1d78b1531a448 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -2230,24 +2230,26 @@ THREE.GLTFLoader = ( function () { // Nothing in the node definition indicates whether it is a Bone or an // Object3D. Use the skins' joint references to mark bones. - skins.forEach( function ( skin ) { + for ( var skinIndex in skins ) { - skin.joints.forEach( function ( id ) { + for ( var jointIndex in skins[ skinIndex ].joints ) { - nodes[ id ].isBone = true; + nodes[ jointIndex ].isBone = true; - } ); + } - } ); + } // Meshes can (and should) be reused by multiple nodes in a glTF asset. To // avoid having more than one THREE.Mesh with the same name, count // references and rename instances below. // // Example: CesiumMilkTruck sample model reuses "Wheel" meshes. - nodes.forEach( function ( nodeDef ) { + for ( var nodeIndex in nodes ) { - if ( nodeDef.mesh ) { + var nodeDef = nodes[ nodeIndex ]; + + if ( nodeDef.mesh !== undefined ) { if ( meshReferences[ nodeDef.mesh ] === undefined ) { @@ -2259,7 +2261,7 @@ THREE.GLTFLoader = ( function () { } - } ); + } return scope._withDependencies( [