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

Export glTF skins as a Gltf struct #14343

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

barsoosayque
Copy link
Contributor

Objective

Solution

  • Add a new GltfSkin, representing skin data from a glTF file, new member skin to GltfNode and both skins + named_skins to Gltf (a la meshes/nodes).
  • Rewrite glTF nodes resolution as an iterator which sorts nodes by their dependencies (nodes without dependencies first). So when we create GltfNodes with their associated GltfSkin while iterating, their dependencies already have been loaded.
  • Make a distinction between GltfSkin and SkinnedMeshInverseBindposes in assets: prior to this PR, GltfAssetLabel::Skin(n) was responsible not for a skin, but for one of skin's components. Now GltfAssetLabel::InverseBindMatrices(n) will map to SkinnedMeshInverseBindposes, and GltfAssetLabel::Skin(n) will map to GltfSkin.

Testing

  • New test skin_node does just that; it tests whether or not GltfSkin was loaded properly.

Migration Guide

  • Change GltfAssetLabel::Skin(..) to GltfAssetLabel::InverseBindMatrices(..).

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@yrns
Copy link
Contributor

yrns commented Jul 16, 2024

I don't know that this is a problem per se, but I noticed that the error message "Unexpected child in GLTF Mesh" is from a older commit (removed in #13707). Which raises concern that this set of changes doesn't reflect more current work or there was a merge problem. (I'm not sure!) I only noticed because I was confused about "mesh" given the context. Maybe double check?

@janhohenheim janhohenheim added C-Feature A new feature, making something new possible A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Scenes Serialized ECS data stored on the disk D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jul 17, 2024
@barsoosayque
Copy link
Contributor Author

Which raises concern that this set of changes doesn't reflect more current work or there was a merge problem.

It's true that some work in this part of the codebase may be omitted because I ported these changes from 0.12 to current main and. But I double checked and everything seems to be fine, the error about gltf mesh child is basically irrelevant anyways according to the pr that removed it ?

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

This is a reasonable step forward :) Thanks for putting in the work to get this together.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 30, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 6, 2024
Merged via the queue into bevyengine:main with commit 5f2570e Aug 6, 2024
29 checks passed
@barsoosayque barsoosayque deleted the gltf-skin-0.14 branch August 6, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Scenes Serialized ECS data stored on the disk C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants