airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.57k stars 2.87k forks source link

question about baking Hold Interpolation in expressions #2850

Open janjoostverhoef opened 2 years ago

janjoostverhoef commented 2 years ago

I'm trying to export an animation with some values as hold keyframes, but they get interpolated on subframes in the web player anyway.

This seems to happen because the properties I'm animating are driving values through an expression. This expression is then baked into interpolated frames.

I'm guessing this only resolved by disabling subframe rendering?

bodymovin commented 2 years ago

hi, how are baking the expressions? are you using the bodymovin option or are you baking them manually?

janjoostverhoef commented 2 years ago

with the bodymovin option.

it's basically a subcomp that single frame "sprites", with time remapping linked to a controller slider. When I keyframe the controller slider value 1 > 3 with hold keyframes, it ends up creating an interpolated keyframe on bake that also shows frame 2 in between (in the subframe).

to elaborate, I can keep expressions in and have a higher base size, but lower size per keyframe. or bake expressions and have a lower base size but higher size the more keyframes I've animated.

So I'm trying to keep our options open to see if it will work with baking expressions in, since it's part of a more elaborate puppet rig with other expressions.

I guess an alternate method would be to have a controller for opacity tied to each individual sprite but it's less flexible and would still end up creating smoothing. Or using something like EasyBake to bake the expression, but that's also a less elegant solution than using the bodymovin bake.

If this is unclear, I can link an example or post some screenshots. Thanks in any case.

bodymovin commented 2 years ago

can you share a reduced example to replicate?

janjoostverhoef commented 2 years ago

here's a link to a reduced example AE project https://drive.google.com/file/d/1Jg9wjjOt5NoT-j3AZqqypk72shUhxxZr/view?usp=sharing

here's the file on lottiefiles, you can already see it there, both for eyebrow position and the mouth sprites. https://app.lottiefiles.com/share/ab51836d-b803-4f4b-9730-cddafc6d6af8

if this is just a limitation of the expression bake then it is what it is. I'm already super happy with the expression bake in bodymovin compared to other baking methods I've tried.

These type of expressions work without being baked in; just want to keep my options open for if I end up having to bake expressions after all.