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

Enable non-linear easing #42

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Enable non-linear easing #42

merged 5 commits into from
Nov 11, 2024

Conversation

atoktoto
Copy link
Contributor

@atoktoto atoktoto commented Nov 9, 2024

It seems to me that most of the work to get non-linear easing is already done.

In order to check what is left to be done I removed the linear-only enforcement, created a simple example with 3 key frames and compared the results with lottielab.com editor:
easing_compare_before

I have found that:

The way I understand it is that while we are moving into position described by next key frame, we still should be using o and i parameters from the previous one.

After changing the Time::frames_and_weight to use the easing from current key frame, positions seem to match pretty well:

easing_compare_after

What do you think? Is there anything else missing to enable non-linear easing?

Thanks for creating an amazing library!

@simbleau
Copy link
Member

simbleau commented Nov 9, 2024

Haven't tested yet but the code looks good!

I was the person who implemented the work for non-linear easing at first, but abandoned it after I failed to figure out why my example file (which included position keyframes) was failing. I'm really happy to see someone else do the rubber duck test and spot the issue I failed to see!

I'll give it a go later.

Bless

@DJMcNab
Copy link
Member

DJMcNab commented Nov 11, 2024

Will this need to be ported into Interpoli as well?

@waywardmonkeys
Copy link
Contributor

Yes, @atoktoto Could you also PR the same change into the https://github.com/linebender/interpoli/ repository, please?

@simbleau
Copy link
Member

Local testing looks great. Super happy to land this; going to push a bug fix version for this as well.

@simbleau simbleau added this pull request to the merge queue Nov 11, 2024
Merged via the queue into linebender:main with commit 7c102b0 Nov 11, 2024
16 checks passed
@simbleau
Copy link
Member

Yes, @atoktoto Could you also PR the same change into the https://github.com/linebender/interpoli/ repository, please?

linebender/interpoli#31 made a tracking issue for that

github-merge-queue bot pushed a commit to linebender/interpoli that referenced this pull request Nov 12, 2024
Fix for #31 based on linebender/velato#42. 

One difference is that I had to enable `mint_types` feature for
`keyframe` crate dependency that pulls in `mint`. As far as I can tell
the project is still `#![no_std]`.
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.

4 participants