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

Resolve animation nodes correctly and uniquify sibling node names #3787

Merged
merged 6 commits into from
Dec 9, 2021

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented Dec 8, 2021

Fixes #playcanvas/model-viewer#135

We've had a bug in the gltf loader which prepends the name of the first node in the file to the animation path. This results in totally incorrect animation paths when the root node is not first in the list.

We are also unable to resolve paths in the tree when sibling nodes have the same name.

This PR does the following:

  • directly build the path from the node, including root name
  • uniquify sibling node names
  • attempt tree traversal to resolve node names, otherwise fall back to previous methods.

This PR appears to resolve a number of existing problem gltf files.

@slimbuck slimbuck added bug area: animation Animation related issue labels Dec 8, 2021
@slimbuck slimbuck requested a review from a team December 8, 2021 17:51
@slimbuck slimbuck self-assigned this Dec 8, 2021
@slimbuck
Copy link
Member Author

slimbuck commented Dec 9, 2021

Also appears to fix playcanvas/model-viewer#133

Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

looks good

@slimbuck slimbuck merged commit ef62660 into playcanvas:dev Dec 9, 2021
@slimbuck slimbuck deleted the anim-fixes branch December 9, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animation Animation related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants