Skip to content

Commit

Permalink
Merge pull request #11524 from donmccurdy/bug-gltf2-node-bones
Browse files Browse the repository at this point in the history
[gltf] Fix parsing of Bone nodes.
  • Loading branch information
mrdoob authored Jun 18, 2017
2 parents c234176 + 0fd9391 commit 3d7ca52
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions examples/js/loaders/GLTF2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2531,28 +2531,30 @@ THREE.GLTF2Loader = ( function () {
var extensions = this.extensions;
var scope = this;

return _each( json.nodes, function ( node ) {
var nodes = json.nodes || [];
var skins = json.skins || [];

var matrix = new THREE.Matrix4();
// 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 ) {

var _node;
skin.joints.forEach( function ( id ) {

if ( node.jointName ) {
nodes[ id ].isBone = true;

_node = new THREE.Bone();
_node.name = node.name !== undefined ? node.name : node.jointName;
_node.jointName = node.jointName;
} );

} else {
} );

_node = new THREE.Object3D();
if ( node.name !== undefined ) _node.name = node.name;
return _each( json.nodes, function ( node ) {

}
var matrix = new THREE.Matrix4();

var _node = node.isBone === true ? new THREE.Bone() : new THREE.Object3D();

if ( _node.name !== undefined ) {
if ( node.name !== undefined ) {

_node.name = THREE.PropertyBinding.sanitizeNodeName( _node.name );
_node.name = THREE.PropertyBinding.sanitizeNodeName( node.name );

}

Expand Down

0 comments on commit 3d7ca52

Please sign in to comment.