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

Conversation

donmccurdy
Copy link
Collaborator

Fun fact: apparently all the animated examples still work if their bones are turned to Object3D.

But SkeletonHelper is less happy, so this fixes that.

404e2547-c421-4eea-a237-bdc7ff97c599-67635-000250d3b29d7255

@donmccurdy
Copy link
Collaborator Author

Related: KhronosGroup/glTF#1020

/cc @takahirox

@mrdoob
Copy link
Owner

mrdoob commented Jun 16, 2017

@takahirox looks good?

// 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 ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donmccurdy
Why do you traverse all nodes and check each for skin? It would be faster to traverse skins directly:

skins.forEach( function ( skin ) {

    if ( skin.joints !== undefined ) {

        skin.joints.forEach( function ( id ) {

            nodes[ id ].isBone = true;

        } );

    }
    
} );

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks! 😆

@mrdoob mrdoob merged commit 3d7ca52 into mrdoob:dev Jun 18, 2017
@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants