-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Eases on last keyframe: A question. Maybe not an issue. #2620
Comments
hi, indeed the last keyframe doesn't have the outgoing and ingoing easing values since there is nothing for it to interpolate with |
@bodymovin, though, the in-going ease value interpolates with the previous keyframe... Understandable if there is no outgoing ease value. Here's a sketch to explain what I mean: The red line follows flat tangents (what easy ease produces). Given that the Lottie JSONs do not maintain easing information on the last keyframe of a timeline, the animation curves described in the above sketch could not be replicated by Lottie's playback. In looping, this could cause slight hitches at the seam of the loop, correct? |
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:  I have found that: - only the easing curves from first two key frames seem to affect the animation as rendered in lottielab. - [Lottie spec](https://lottie.github.io/lottie-spec/latest/specs/properties/) mentions that: "_All keyframes MUST have an i and o value, unless It is the last keyframe in the sequence OR ..._" - This comment mentions that the last one is unused: airbnb/lottie-web#2620 (comment) 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:  What do you think? Is there anything else missing to enable non-linear easing? Thanks for creating an amazing library! --------- Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com>
In order to better understand the Lottie JSON format, I've been creating simple animations and identifying the properties within the JSON in order to use them interactively later on.
It's a 1 second comp, 24fps.
I made keyframes at frames 0, 12 and 23.
In animating a Shape's Trim Path (end%) and also the Layer's Position, I set up a loop by copy-pasting the keyframes at frame zero into the last frame.
The keyframes from Trim Path (end%) and Position at frame 12 is an arbitrarily different value, just to see some kind of motion.
Anyway, in looking through the JSON, it seems that when adding an Easy Ease, the "Ease" is described by tangent handles, much like a bezier curve, with x and y values for the in- behavior and the out- behavior.
Oddly, the last keyframe has no Ease information, no "i" or "o" properties associated with it.
So far, I cannot tell if this makes a difference in the way the animation behaves.
The text was updated successfully, but these errors were encountered: