bodymovin / bodymovin-to-smil

bodymovin to smil
MIT License
39 stars 7 forks source link

Bug with transform groups #5

Closed circlingthesun closed 3 years ago

circlingthesun commented 3 years ago

Hi,

Firstly, thanks for this really nice tool.

I've been working with a designer to export some lottie animation to SMIL because now that IE11 is dead, SMIL lets us show animations without displaying a blank screen while the lottie JS code loads.

We started with some complicated stuff and simplified it significantly, but the code still crashes. I've been poking around in the code to see if I could figure it out. The conversion crashes when creating a transform group where the position is being animated because the keyframes are undefined.

I had a look at the createTransformGroup function, and there is a check isPositionAnimated(transform.p) that falls through to a block that creates an animated property using keyframes at transform.p.k. The problem is k is undefined. I do however see keyframes define at transform.p.x.k and transform.p.y.k. I have no insight into this however. If I check that transform.p.k` is defined and skip the animated property creation, the export works but doesn't look quite right.

I've attached the lottie exports and and the aep source projects. The first test used keyframes converted from some 'expression', so it's larger than it needs to be. The text animation part seems to work fine though. The 2nd test is smaller but the text animation part fails. Both files fail to convert because of the error described above.

Is there perhaps a way to work around this?

test.zip

bodymovin commented 3 years ago

hi, thanks for the examples. Indeed transform with separate dimensions animated is not yet supported. I'll try to take a look at it but it's not that simple to add.

circlingthesun commented 3 years ago

Thanks for the quick response and having a look @bodymovin. Much appreciated.

bodymovin commented 3 years ago

Hi! Separate dimensions should work now on version 1.1.0. I tested it with your demo file and it looks like it works.

circlingthesun commented 3 years ago

Thanks so much for taking the time :) It all works now :+1: