Skip to content

Commit

Permalink
[gltf] Use skins directly, don't iterate nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Jun 17, 2017
1 parent e17a485 commit ff50ff1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/js/loaders/GLTF2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2532,22 +2532,18 @@ THREE.GLTF2Loader = ( function () {
var scope = this;

var nodes = json.nodes || [];
var skins = json.skins || [];

// Nothing in the node definition indicates whether it is a Bone or an
// Object3D. So, traverse the hierarchy once in advance, using node.skins
// references to mark bones.
nodes.forEach( function ( node ) {
// Object3D. Use the skins' joint references to mark bones.
skins.forEach( function ( skin ) {

if ( node.skin !== undefined ) {

json.skins[ node.skin ].joints.forEach( function ( id ) {
skin.joints.forEach( function ( id ) {

nodes[ id ].isBone = true;

} );

}

} );

return _each( json.nodes, function ( node ) {
Expand Down

0 comments on commit ff50ff1

Please sign in to comment.