lottie-rs icon indicating copy to clipboard operation
lottie-rs copied to clipboard

Does not render correctly

Open SirVer opened this issue 2 years ago • 10 comments

I have two animations from my design folks here at Qwello and both look very incorrect in the rendering of this crate vs the official renderer: https://lottiefiles.github.io/lottie-docs/playground/json_editor/. It is not only blending, but a lot of other things.

How much of the standard is supposed to be correctly implemented? I cannot share the files publicly, but I can make them available via email if that is of interest for debugging purposes.

My use case is the following: I'd like to take a Lottie file, remove all texts from it, then create PNG files for every frame, in which I can then draw text again. For this, I need to remember the draw position of each text for every frame - since they can be animated. The reason is internationalization: I need PNG files for our asset pipeline, but we have multiple languages and would like to automate the generations.

I assume that lottie-rs is not ready to do the PNG generation, but that is fine, I can use puppeteer-lottie there. However, I hope to be able to use lottie-rs to get the information where to draw the text to. Do you think this is feasible?

SirVer avatar Jan 11 '24 15:01 SirVer

Sorry but I don't think so. The lottie file format is really complex and lack of documentation (The "official" doc you referred to is from lottiefiles.com, which I think is not really official since lottie is from airbnb I think?). Even though I tried my best to mimic the behavior of the web renderer, there's always a gap. Text rendering is IMO the hardest part in the pipeline. This project can hardly be production-ready in a short time, given that I can only contribute in my part-time.

Anyway, you can still strip down the file and send it to me so I can make this project better. To strip down a lottie file, you could just keep the wanted layers and remove everything else.

zimond avatar Jan 12 '24 02:01 zimond

By the way this crate is made to do server side rendering, and could generate png files just file. Incorrect rendering is another problem though.

zimond avatar Jan 12 '24 08:01 zimond

Thanks for your consideration! I really appreciate you working on this project and I hope it becomes a true alternative to the web renderer eventually. For now I will try to work my problems without relying on lottiefiles.

SirVer avatar Jan 17 '24 19:01 SirVer

Feel free to checkout https://github.com/vectorgameexperts/bevy-vello, which has text and supports JSON lottie/svg.

It uses compute shaders for rendering through Vello, which is also much more performant.

nuzzles avatar Jan 23 '24 03:01 nuzzles

@simbleau Thank you for self-promoting this much more performant approach! Have a nive day.

zimond avatar Jan 23 '24 04:01 zimond

@SirVer if you just want bbox for texts in every frame, skottie is the best.

zimond avatar Jan 23 '24 04:01 zimond

@simbleau I'll have a look at it.

@zimond Let a thousand flowers bloom, right? I'll check out skottie too, thanks for the pointer!

SirVer avatar Jan 23 '24 20:01 SirVer

@SirVer skottie is battle-tested and also passes almost all lottie tests. We use it in our production. This project, in the meantime, is our experimental approach to use Rust in the pipeline. Still if you want to contribute to lottie-rs, you're welcomed to send me any file that not rendered correctly.

zimond avatar Jan 24 '24 02:01 zimond

@zimond Do you mean this skottie? https://skia.org/docs/user/modules/skottie/. I will need to use skia then too, right?

SirVer avatar Jan 25 '24 17:01 SirVer

@SirVer yes indeed

zimond avatar Jan 25 '24 17:01 zimond