how to control a Lottie animation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to control a Lottie animation?

2,381 Views
PragmaLab
Contributor II

LS,

I just included my first Lottie animation and it works like charm. It is fast, simpel to implement and scalable.

But how to get control over the animation? I want load a new screen once the animation has finished, but no events are available for the lottie widget

Any help/hints?

Thanks

Rob

0 Kudos
8 Replies

2,349 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PragmaLab

Which chip are you using? 

 

BR

Alice

0 Kudos

2,343 Views
PragmaLab
Contributor II

Dear Alice,

my MCU is now a IMXRT1062 (I'm using the IMXRT1062 EVK from NXP).

In the GuiGuider Simulator everything worked fine as reported earlier but yesterday I flashed my code on the EVK (using a 800x480 display) and the code runs into a hardfault each time I try to load the screen with the lottie animation on it (see attached screenshot of the debugger)

PragmaLab_0-1676625954442.png

The line that causes the hard fault is here:

PragmaLab_1-1676626033074.png

This is just one scenario in which the hardfault is encountered. The hardfault is caused by reading from addresses that our outside the ROM/RAM area (eg 0x0c020608). These invalid addresses occur after executing this call:

rlottie->animation = lottie_animation_from_data(rlottie_desc_create, rlottie_desc_create, "");

on line 113 in lv_rlottie.c

The 'lottie_animation_from_data() call is hidden from the debugger since it resides in the lottie library, so I cannot debug the code any further from here

 .text.lottie_animation_from_data
                0x60065dd0       0x70 C:\Projects\pl_mx\code\mx6\magic_display\lib\arm\gcc\librlottie.a(lottieanimation_capi.cpp.obj)
                0x60065dd0                lottie_animation_from_data

I will enclose my lottie.json file and generated c-file. The json file is zipped since I cannot attach .json files here

What causes this call to override valid addesses with invalid ones? Is it a memory(-size) problem?

Thanks,

Rob

 

0 Kudos

2,311 Views
PragmaLab
Contributor II

...in addition to my previous post:

  • shouldn't the 'librlottie.a' be compiled for each specific platform? 
  • should I create a ticket for this issue?

kind regards,

Rob

0 Kudos

2,286 Views
zongchunyu
NXP Employee
NXP Employee

Hello Rob,

Thank you for reporting this hardfault issue. The issue is caused by the PNG images which are embedded in the lottie json file you shared.

currently the librlottie.a(for targets) only supports limited features. please try the lottie json files which don't have images.

We will add the event support for lottie widget in future GUI Guider release.

Best Regards

Zongchun

0 Kudos

2,273 Views
PragmaLab
Contributor II

Dear Zongcunyu,

  • I'm sorry but if the target Lottie JSON file cannot contain images, then where do the images come from in the animation?
  • So the Lottie feature can only be used in the Simulator? 
  • "currently the librlottie.a(for targets) only supports limited features" What are those features? The manual reports nothing about 'limited features...

kind regards,

Rob

0 Kudos

2,264 Views
zongchunyu
NXP Employee
NXP Employee

Hello Rob,

1. Regarding the images in animation, if you open the animatie.json file using text editor. you will see the RAW data of PNG images like the attachment(lottie-image.png). so five png images have been embedded in this lottie json file.

2. The "Limited features" doesn't mean only can run lottie in the simulator.  if you don't use the lottie json files which incude images, the lottie animation can also work on boards. 

3. Regarding the lottie features. I means the features of Adobe After Effects. for more details, please refer to https://lottiefiles.com/supported-features

this is the feature list for web lottie library.  the web library can support more features but not all features of AE.  of course, we can't use this web lottie library in MCU devices.

0 Kudos

2,186 Views
PragmaLab
Contributor II

Dear Zongchunyu,

thanks for your reply. I now understand that animations containing images are a no-go for embedded solutions. You might want to point that out in your manual. Your reference to the Lottie features isn't of much help: it doesn't state which features are available for the simulator and which for an embedded target. Images ARE supported for the simulator but NOT for an embedded target so it appears

I created a simple Lottie animation without images to see if that one passed the embedded test. It fails too, for different reasons. Would be nice if you could send me an example of a Lottie animation that runs on an embedded target. I enclosed my Lottie animation that has no images but still fails

kind regards,

Rob

0 Kudos

2,178 Views
zongchunyu
NXP Employee
NXP Employee

Hello Rob,

Please try the lottie json files in the following link:
https://github.com/Samsung/rlottie/tree/master/example/resource

 

Best Regards

Zongchun

0 Kudos