linebender / velato

An integration to parse and render Lottie with Vello.
http://linebender.org/velato/
Apache License 2.0
76 stars 9 forks source link

Fishes are swimming the wrong way #10

Closed Jasper-Bekkers closed 5 months ago

Jasper-Bekkers commented 1 year ago

Boat_Loader.zip from https://github.com/airbnb/lottie/blob/master/AEP/Boat_Loader.zip has an animation where there are a few fishes. However, compared to the preview in https://svgsprite.com/tools/lottie-player/ it appears that the fishes are swimming the wrong way.

simbleau commented 7 months ago

Thanks for the issue! Will take a look at this over the coming weeks.

simbleau commented 5 months ago

Hey @Jasper-Bekkers , thanks for your patience. Definitely been busy!

After looking into the issue, I've found that basically this Lottie is particularly old. This file is v4 bodymovin:

image

As well there are plenty of schema mismatches that most modern lottie players will not have correct behavior... I even see some clipping issues present in the robust, modern lottie players.

image

Velato supports the lottie schema as of version 5.5.2, by uploaded by LottieFiles.

I would say as a result, and due to limited bandwidth, I'm sorry to say supporting older versions than 5.5.2 is out of scope. You could try to somehow migrate this file to a new lottie version (I am unaware of any tools for this. Perhaps try to import into LottieFiles/LottieLab and export from there).

Furthermore, it's on the roadmap to upgrade the schema in the future to the new schema defined by the Lottie Action Committee (LAC), but I'm not sure where they're at, only that the schema is drafted here. I think it's also very unclear in general how Lottie is versioning itself.

Lastly, some good news...

Although I can't confirm what you're seeing or reproduce the issue, if I was to guess, it's position keyframes. We're still working on implementing that. So it's possible the issue of incorrectly positioned elements will align over time as we fix that.

mbasaglia commented 5 months ago

If you need some context, lotties with v "4.x.x" have a slightly different keyframe structure, they have an e property which specifies the end value of that keyframe (s being the start value) and they omit s on the last keyframe.

Some even older lotties don't even have a showing if a property is animated, but it doesn't seem it's the case with the file here

Jasper-Bekkers commented 5 months ago

Thanks for digging in! I'm currently ok with this answer, this was a test asset I was using to evaluate this crate.

It might be nice going forward to just log out a warning about the version number so it's a bit more clear whats going on.

simbleau commented 5 months ago

Agreed - I've filed #21 to track that.