-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Allow users to fix glTF coordinate system imports #19633
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
Allow users to fix glTF coordinate system imports #19633
Conversation
You added a new feature but didn't update the readme. Please run |
Will fix the CI and expand the PR description in a few minutes :) |
I would prefer them to be fixed in this PR. Introducing temporary changes in examples makes it harder to sort actual regressions |
Sure, can do :) |
We should remove the term "simply" entirely and make sure that phrasing is not used in the migration guide. |
@ChristopherBiscardi done. Also, I fixed the CI and expanded the PR description. Right now I'm porting all examples, but that will take quite a while. This PR can be merged in the meantime without any issues, as the flag is not enabled by default yet |
Alright, fixed the camera issues. See the PR description. I've been thinking about this some more, and I really think that it would be better to split this off into two PRs, as described above. I'd like
I believe this approach will allow us to separate the concerns of
Does that sound good to you, @alice-i-cecile? |
Update: got Alice's okay for the above plan on Discord :) |
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
Now that this is opt-in and not breaking, I want a brief release note to gather feedback please. |
@alice-i-cecile done 👍 |
Objective
Fixes #5670 as an opt-in for now
glTF uses the following coordinate system:
and Bevy uses:
For the longest time, Bevy has simply ignored this distinction. That caused issues when working across programs, as most software respects the
glTF coordinate system when importing and exporting glTFs. Your scene might have looked correct in Blender, Maya, TrenchBroom, etc. but everything would be flipped when importing it into Bevy!
Solution
Add an option to the glTF loader to perform coordinate conversion. Note that this makes a distinction in the camera nodes, as glTF uses a different coordinate system for them.
Follow Ups
Testing
I ran all glTF animation examples with the new setting enabled to validate that they look the same, just flipped.
Also got a nice test scene from Chris that includes a camera inside the glTF. Thanks @ChristopherBiscardi!
Blender (-Y forward):

Bevy (-Z forward, but the model looks the wrong way):

Bevy with

convert_coordinates
enabled (-Z forward):Validation that the axes are correct with F3D's glTF viewer (+Z forward):
