“Directory”
- Principles of LottieJS animation technology
- The characteristics of LottieJS
- Installation and use of LottieJS animation
Principles of Lottie animation technology
Lottie animation is to export AE files to JSON files, and then use LottieJS for animation control. Currently, animation is not very interactive, so this technology is used first.
The characteristics of LottieJS
To be updated
Installation and use of LottieJS animation
-
First of all, you need to install the AE software. Here, you have installed the CC 2017 version according to UE.
-
Second download bodyMovin. ZXP this AE extension plug-in, for AE animation JSON file export
-
ZXP Installer. exe can be used to install a variety of AE extensions. You can install ZXP installer.exe using aescript + aeplugins
-
Download the Lottie. Js, making Lottie – web address or git clone https://github.com/airbnb/lottie-web.git
-
Install bodymovin. ZXP in aescript + aeplugins ZXP Installer. exe and it will look like this
- Open the AE
Edit > Preferences > General
Check the interfaceAllows scripts to write files and access the network
, click OK
- Click in after Effects
Window > Extension
You can see the added plug-in in
- The next step is to prepare the animation, an AEP file plus the material file, after opening in the
Window > Extension
In the Bodymovin window, you can see the window below
Ps: I have encountered the export stuck situation before. Considering that it may be the reason that the plug-in and AE version do not match, if you have this reason, then you should go to a bodymovin. ZXP reinstall again, which should solve the problem.
- You can see that the exported file has
data.json
The images in the images file all have stroke. However, our animation does not need stroke under normal circumstances, so we need to export the images separately for manual replacement of the same name.
- Json is a reference to data. Json cannot be used locally, so you must open it with an HTTP service. Otherwise, this error will be reported
-
The following is the code, the following code to write the animation can play
<! The first step is to reference lottieJS--> <script src="./lottie.js"></script> <! Set up the container for the second step animation --> <div id="animation"></div> <! Step 3 Create an animated object <script> var b = lottie.loadAnimation({ container: document.getElementById('animation'), // the dom element that will contain the animation renderer: 'svg'.// What format is rendered loop: true.// Loop autoplay: true.// Auto play path: 'data.json' // the path to the animation json }); </script> Copy the code
Version1.0 — 2018.5.24 — Create Lottie animation installation and use
© burning_ rhyme groups