Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gltf] Fix parsing of Bone nodes. #11524

Merged
merged 2 commits into from
Jun 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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