How do I animate an object to fade in and out within a timeline

What do you want to achieve?

I want to animate an object to fade in and fade out with in a timeline.

What have you tried so far?

I tried to make two animations to animate the object that both use this callback,

lv_anim_set_exec_cb(&animation, (lv_anim_exec_xcb_t) lv_obj_set_style_opa);

and add them to a timeline, but according to the LVGL animation documentation only one animiation function pair is allowed so only the most recent animation is added to the timeline:

The number of Animations that can be playing at the same time for a given object with a given animator callback is one (1)

I found that I could do what I’m looking to do with images using the lv_obj_set_style_image_opa function, but I need this to work on other objects. I also tried to setup the animation to run in forward and then in reverse and then add that to a timeline, but that didn’t work either

What MCU/Processor/Board and compiler are you using?

ESP32

What LVGL version are you using?

v9.1.1-dev