Qt Lottie Animation
Qt Lottie Animation provides a QML API for rendering graphics and animations that are exported in JSON format by the Lottie plugins for Adobe After Effects.
The Qt Lottie Animation APIs render animations into an intermediate buffer using the QPainter software renderer. This may impose some restrictions on the sizes of illustrations, as well as on the target hardware. As an alternative, an experimental tool called lottietoqml is included. This tool converts Lottie animations to QML. As a result, they can be rendered using the hardware-accelerated renderer in Qt Quick. The tool is currently considered to be in technical preview. It does not support the full range of features supported by Qt Lottie Animation yet, and incompatible changes should be expected.
Getting Started
Import the types using the the following statement:
import Qt.labs.lottieqt
See the GitHub page for Lottie for instructions on how to download and install the plugin for Adobe After Effects.
Limitations
The implementation follows the master specification for lottie. Deviations in exported Lottie files compared to the specification are taken into account as much as possible when differences are noticed.
General limitations
precomps
are not supported- expressions are not supported
- the timeline only supports frame-mode, not time-mode
Warning: The input files for Qt Lottie Animation are assumed to be trusted content. Application developers are advised to never pass in data from untrusted sources.
Animation level limitations
The following properties are not supported:
assets
- reusable text and imageschars
text
Layers
Only the shape
layer and the alpha mask adjustment
layer are supported.
The following properties are not supported:
ao
(auto-orientation)bm
(blend mode)maskProperties
(masks)sr
(time stretch)
Shapes
The following elements and shapes are not supported:
- the
gstroke
(group stroke) element - the
star
element - Nested Repeater shapes
Also note that the behavior when using multiple active trim paths (e.g. trim paths in nested groups) is unpredictable.
Effects
The only supported effects are Slide
and Layer Fill
.
Examples
The lottietoqml Example demonstrates how the lottietoqml tool can be used to convert Lottie files into Qt Quick scenes and load these in an application.
Licenses
Qt Lottie Animation is available under commercial licenses from The Qt Company. In addition, it is available under the GNU General Public License, version 3. See Qt Licensing for further details.