-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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: Import step interpolation for loc/rot/scale as nearest #86016
Conversation
Note that GLTF cubic is not the same as godot cubic, so it will need to be baked or you can devise a curve fitting schema.
|
821ac38
to
7d19976
Compare
Thanks a lot for taking a look - I should have been clearer, this is only about the STEP/NEAREST interpolation. The method already does handle baking. For STEP interpolation we do not want any in-betweens generated, so we have to mark the resulting animation track with NEAREST interpolation, the other tracks will get baked correctly. I've made the change handle only the STEP case, wdyt? |
19cba4c
to
1252a2d
Compare
5f8afba
to
c2e1077
Compare
If you have some spare time, could check https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/InterpolationTest |
I think the change is working as it should. The existing code bakes everything to linear, so the only time we need to propagate the original interpolation intent is when it's STEP/NEAREST. |
Currently all object transform animation tracks get imported and baked as linear. For step interpolation mark the resulting animation track with Nearest interpolation to make sure there are no in-betweens generated. This is useful for camera cuts or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. We also have the same logic for weights a bit over 50 lines below here, so it makes sense to do this for pos/rot/scale tracks as well.
Thanks! And congrats for your first merged Godot contribution 🎉 |
Thank you |
Currently all transform animation tracks get imported as linear.
To support things like camera cuts honor the interpolation mode set in the gltf.