The following manual will outline a method which allows a user to create interesting Lottie animations without writing a single line of code. It is most suited to creating short, mono-chromatic animations that would be difficult to create by hand (eg: 3D physics simulations).
For highly complex or demanding animations you should either use the video method, or bite the bullet and write some custom code using either css (see fig .001) or javascript libraries such as three.js, gsap or anime.js.
However, if it can be done in Lottie, small file sizes, infinite resolution and user interactivity are just some of the many benefits.
Required:
Adobe After Effects
Webflow
Bodymovin or LottieFiles AE extensions
Optional:
3D Engine (Blender)
Source Video / GIF
Also check the Lottie Supported Features, as these limitations are always changing, and explain why the following method works.
In brief this method uses After Effect's auto-trace tool to detect the edges of a piece of source media, be it an already existing layer, a video file, or a pre-rendered scene. The auto-trace tool then creates a series of masks which are used as paths to draw exportable (Lottie approved) shapes.
Create your scene in the 3D engine and render it as either an image sequence or a video file.
For optimum ease with this method your render should have:
- High resolution and sharp edges.
- High a solid colour background distinguishable from the objects in the scene.
The render in (fig .006) was created using Blender's rigid body physics and then exported as a .mp4 video file.
Any source can technically be used for this method: videos, gifs or still images. The lightning Lottie on the specifications page of this manual (fig .002) was created by tracing the gif in (fig .007).
Import the source media into your After Effects composition.
I recommend matching your composition settings to those of the source media.
Use the Linear Colour Key effect (fig .008) to remove the background colour from the source media leaving transparency in its place.
Set composition length to the length of the source media and with source layer selected:
Layer → Auto-Trace
Use the preview frame as a reference to fine tune the auto-trace settings until it looks like all your shapes have been accurately traced without creating an excessive amount of masks.
Add a new shape layer and add a single path to its contents.
Check how many masks exist in the layer created by the auto-trace tool (example has 44) and then duplicate the new shape layer's path until the shape has the same amount of paths (eg: 44 paths) in its contents.
Select all the masks in the layer created by the auto trace tool and search for 'mask path' to reveal just the path layer of each mask. (fig .011)
Select all these mask paths and copy them to the clipboard.
Select and expand all the paths in the new shape layer, then select all the expanded paths and paste in the mask paths (the paths will be pasted at the playhead position so make sure this is where you want it).
Since the shape's paths don't share the opacity behaviour of their original masks, when the objects they are tracking disappear, the paths require manual adjustment.
With the new shape layer selected use the original source video as a reference to find unwanted, lingering paths and at the exact time that they are out of place, move them off the screen. (since these lingering paths are still used throughout the rest of the animation, they should be moved out of view instead of deleted)
Add a fill to the shape layer, and it should now resemble the source layer!
Since the shape layer simply uses animated paths and fills, it is now Lottie friendly and ready for export.
The Bodymovin extension can be used to export your animation as a ,json file.
Alternatively, the LottieFiles extension is able to preview your animation right inside After Effects, before exporting.
Drag and drop that .json into a Webflow project and your done!
The Lottie element created can be sized and transformed like any other HTML element.
The element's playback behaviour can be controlled via its settings tab, or by using Webflow's interactions engine. This is how the animation on the front page of this manual was rigged to play when the user scrolls the page.
What about multi-coloured animations?
Try a mono-chromatic source file, then matching colours to corresponding path fills (do-able, but tedious).
Animations without clear edges?
Vector animation types (like Lottie) probably aren't what you're after.
Super hectic animations with stuff flying about and crossing over a lot?
Sure, but be prepared spend some time in step 006 (hopefully less time than creating the animation by hand)
Best case use:
Use the auto-trace tool to enhance standard vector animations (the sort you see on the LottieFiles featured page).
This way your vector animations can contain clean (well-labelled), controlled vector elements but also complex (physics simulated), auto-traced elements.