rLottie Wrapper

Hi everybody,

I’ve just written a wrapper for the rLottie library which offers a convenient way of displaying animations in JUCE. In a nutshell, it’s a C++ version of the Lottie library from AirBnb and allows to natively render animations that can be exported from Adobe After Effects with the bodymovin plugin.

I think it might be useful for other people so here’s the link to the source folder:

(Don’t be put off by the GPL license, I was just too lazy to pick another license, so if you need to use it in a more permissive way, let me know, then I’ll change it). (EDIT: changed to MIT).

Since rLottie is licensed under the LGPL license, it must be linked dynamically. I’ve compiled dynamic libraries for Windows and macOS which are ready to use here

There’s also a demo app which shows the usage:

The current feature set involves:

  • RLottieManager: Loading and initialising the dynamic rLottie library on runtime with a customizable folder location.
  • RLottieAnimation: A low-level class that loads an animation from a JSON String and various methods to render / control the animation.
  • RLottieComponent: A high-level JUCE component which displays an animation

It comes with no additional dependencies (apart from JUCE, obviously).

9 Likes

Would you consider putting this under MIT or BSD-3 license?

Yeah, sure, I’ll just clean it up a bit more.

1 Like

Alright, I’ve changed the wrapper code to MIT and added a few more convenient functions (scale factor for oversampling, better error reporting if the dll can’t be loaded, etc.)

Now I just need to find a better way of creating these files since I am never going to buy an Adobe subscription :slight_smile:

2 Likes

Here’s a great Lottie add-on for Blender I just discovered :wink:

Is there any way to use this library with Juce while targeting iOS and Android? I’m not very familiar with dynamic linking.

Possibly but not sure that version of the library supports iOS and Android. You might be better off using the official AirBnB library for those platforms.

Would be nice to have a wrapper that could use either Lotte or rLottie depending on the platform…

Yeah. That would be ideal. I also saw that description of rLottie states that it’s platform independent library. But cannot find anywhere any mentions of either iOS or Android.