# Lottie for Web, [Android](https://github.com/airbnb/lottie-android), [iOS](https://github.com/airbnb/lottie-ios), [React Native](https://github.com/airbnb/lottie-react-native), and [Windows](https://aka.ms/lottie)
Lottie is a mobile library for Web, and iOS that parses [Adobe After Effects](http://www.adobe.com/products/aftereffects.html) animations exported as json with [Bodymovin](https://github.com/airbnb/lottie-web) and renders them natively on mobile!
For the first time, designers can create **and ship** beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:
# View documentation, FAQ, help, examples, and more at [airbnb.io/lottie](http://airbnb.io/lottie/)
![Example1](gifs/Example1.gif)
![Example2](gifs/Example2.gif)
![Example3](gifs/Example3.gif)
![Community](gifs/Community%202_3.gif)
![Example4](gifs/Example4.gif)
# Plugin installation
### Option 1 (Recommended):
**Download it from from aescripts + aeplugins:**
http://aescripts.com/bodymovin/
### Option 2:
**Or get it from the adobe store**
https://creative.adobe.com/addons/products/12557
CC 2014 and up.
## Other installation options:
### Option 3:
- download the ZIP from the repo.
- Extract content and get the .zxp file from '/build/extension'
- Use the [ZXP installer](http://aescripts.com/learn/zxp-installer/) from aescripts.com.
### Option 4:
- Close After Effects<br/>
- Extract the zipped file on `build/extension/bodymovin.zxp` to the adobe CEP folder:<br/>
WINDOWS:<br/>
`C:\Program Files (x86)\Common Files\Adobe\CEP\extensions or`<br/>
`C:\<username>\AppData\Roaming\Adobe\CEP\extensions`<br/>
MAC:<br/>
`/Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
(you can open the terminal and type:<br/>
`$ cp -R YOURUNZIPEDFOLDERPATH/extension /Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
then type:<br/>
`$ ls /Library/Application\ Support/Adobe/CEP/extensions/bodymovin`<br/>
to make sure it was copied correctly type)<br/>
- Edit the registry key:<br/>
WINDOWS:<br/>
open the registry key `HKEY_CURRENT_USER/Software/Adobe/CSXS.6` and add a key named `PlayerDebugMode`, of type String, and value `1`.<br/>
MAC:<br/>
open the file `~/Library/Preferences/com.adobe.CSXS.6.plist` and add a row with key `PlayerDebugMode`, of type String, and value `1`.<br/>
### Option 5:
Install the zxp manually following the instructions here:
https://helpx.adobe.com/x-productkb/global/installingextensionsandaddons.html
Skip directly to "Install third-party extensions"
### Option 6:
Install with [Homebrew](http://brew.sh)-[adobe](https://github.com/danielbayley/homebrew-adobe):
```bash
brew tap danielbayley/adobe
brew cask install lottie
```
### After installing
- **Windows:** Go to Edit > Preferences > Scripting & Expressions... > and check on "Allow Scripts to Write Files and Access Network"
- **Mac:** Go to Adobe After Effects > Preferences > Scripting & Expressions... > and check on "Allow Scripts to Write Files and Access Network"
**Old Versions**
- **Windows:** Go to Edit > Preferences > General > and check on "Allow Scripts to Write Files and Access Network"
- **Mac:** Go to Adobe After Effects > Preferences > General > and check on "Allow Scripts to Write Files and Access Network"
# HTML player installation
```bash
# with npm
npm install lottie-web
# with bower
bower install bodymovin
```
Or you can use the script file from here:
https://cdnjs.com/libraries/bodymovin
Or get it directly from the AE plugin clicking on Get Player
# Demo
[See a basic implementation here.](https://codepen.io/airnan/project/editor/ZeNONO/) <br/>
# Examples
[See examples on codepen.](http://codepen.io/collection/nVYWZR/) <br/>
## How it works
[Here's](https://www.youtube.com/watch?v=5XMUJdjI0L8) a video tutorial explaining how to export a basic animation and load it in an html page <br />
### After Effects
- Open your AE project and select the bodymovin extension on Window > Extensions > bodymovin
- A Panel will open with a Compositions tab listing all of your Project Compositions.
- Select the composition you want to export.
- Select a Destination Folder.
- Click Render
- look for the exported json file (if you had images or AI layers on your animation, there will be an images folder with the exported files)
### HTML
- get the lottie.js file from the build/player/ folder for the latest build
- include the .js file on your html (remember to gzip it for production)
```html
<script src="js/lottie.js" type="text/javascript"></script>
```
You can call lottie.loadAnimation() to start an animation.
It takes an object as a unique param with:
- animationData: an Object with the exported animation data.
- path: the relative path to the animation object. (animationData and path are mutually exclusive)
- loop: true / false / number
- autoplay: true / false it will start playing as soon as it is ready
- name: animation name for future reference
- renderer: 'svg' / 'canvas' / 'html' to set the renderer
- container: the dom element on which to render the animation
It returns the animation instance you can control with play, pause, setSpeed, etc.
```js
lottie.loadAnimation({
container: element, // the dom element that will contain the animation
renderer: 'svg',
loop: true,
autoplay: true,
path: 'data.json' // the path to the animation json
});
```
#### Composition Settings:
Check this wiki page for an explanation for each setting.
https://github.com/airbnb/lottie-web/wiki/Composition-Settings
## Usage
Animation instances have these main methods:
### play
***
### stop
***
### pause
***
### setLocationHref(href)
- `href`: usually pass as `location.href`. Its useful when you experience mask issue in safari where your url does not have `#` symbol.
***
### setSpeed(speed)
- `speed`: 1 is normal speed.
***
### goToAndStop(value, isFrame)
- `value`: numeric value.
- `isFrame`: defines if first argument is a time based value or a frame based (default false).
***
### goToAndPlay(value, isFrame)
- `value`: numeric value.
- `isFrame`: defines if first argument is a time based value or a frame based (default false).
***
### setDirection(direction)
- `direction`: 1 is forward, -1 is reverse.
***
### playSegments(segments, forceFlag)
- `segments`: array. Can contain 2 numeric values that will be used as first and last frame of the animation. Or can contain a sequence of arrays each with 2 numeric values.
- `forceFlag`: boolean. If set to false, it will wait until the current segment is complete. If true, it will update values immediately.
***
### setSubframe(useSubFrames)
- `useSubFrames`: If false, it will respect the original AE fps. If true, it will update on every requestAnimationFrame with intermediate values. Default is true.
***
### destroy()
***
### getDuration(inFrames)
- `inFrames`: If true, returns duration in frames, if false, in seconds.
***
### Additional methods:
- updateTextDocumentData -- updates a text layer's data
[More Info](https://github.com/airbnb/lottie-web/wiki/TextLayer.updateDocumentData)
***
### Lottie has 8 global methods that will affect all animations:
**lottie.play()** -- with 1 optional parameter **name** to target a specific animation <br/>
**lottie.stop()** -- with 1 optional parameter **name** to target a specific animation <br/>
**lottie.setSpeed()** -- first argument speed (1 is normal speed) -- with 1 optional parameter **name** to target a specific animation <br/>
**lottie.setDirection()** -- first argument direction (1 is normal direction.) -- with 1 optional parameter **name** to target a specific animation <br/>
**lottie.searchAnimations()** -- looks for elements with class "lottie" or "bodymovin" <br/>
**lottie.loadAnimation()** -- Explained above. returns an animation instance to control individually. <br/>
**lottie.destroy()** -- To destroy and release resources. The DOM element will be emptied.<br />
**lottie.registerAnimation()** -- yo
没有合适的资源?快使用搜索试试~ 我知道了~
Bodymovin是一个AfterEffects插件
共249个文件
js:149个
json:68个
html:9个
1星 需积分: 36 8 下载量 110 浏览量
2019-08-10
04:27:08
上传
评论
收藏 8.74MB ZIP 举报
温馨提示
Bodymovin 是一个 After Effects 插件,用来将动画导出成 svg/canvas/html js ,方便在浏览器上展示。
资源推荐
资源详情
资源评论
收起资源包目录
Bodymovin是一个AfterEffects插件 (249个子文件)
helperProject.aep 96KB
Example2.gif 1.6MB
Community 2_3.gif 1.43MB
Example4.gif 578KB
Example3.gif 323KB
Example1.gif 249KB
.gitignore 165B
index.html 12KB
index.html 708B
index.html 669B
index.html 652B
index.html 607B
index.html 607B
index.html 383B
index.html 229B
index.html 201B
data.js 770KB
lottie.js 517KB
lottie_html.js 470KB
lottie_canvas.js 431KB
lottie_svg.js 431KB
lottie_light_html.js 384KB
lottie_light_canvas.js 346KB
lottie_light.js 345KB
data.js 344KB
data.js 301KB
lottie.min.js 244KB
lottie_html.min.js 218KB
lottie_canvas.min.js 196KB
lottie_svg.min.js 195KB
lottie_light_html.min.js 168KB
lottie_light_canvas.min.js 149KB
lottie_light.min.js 146KB
TextAnimatorProperty.js 24KB
ExpressionManager.js 21KB
ShapeProperty.js 21KB
ShapeInterface.js 20KB
AnimationItem.js 20KB
PropertyFactory.js 17KB
CVShapeElement.js 17KB
ExpressionPropertyDecorator.js 16KB
TextProperty.js 15KB
CanvasRenderer.js 13KB
TrimModifier.js 13KB
transformation-matrix.js 13KB
DataManager.js 12KB
SVGShapeElement.js 11KB
FontManager.js 11KB
HybridRenderer.js 10KB
HTextElement.js 10KB
TransformProperty.js 10KB
bez.js 9KB
seedrandom.js 9KB
mask.js 8KB
CVTextElement.js 8KB
SVGTextElement.js 8KB
RepeaterModifier.js 8KB
SVGRenderer.js 8KB
SVGElementsRenderer.js 8KB
HShapeElement.js 8KB
MouseModifier.js 7KB
SVGBaseElement.js 7KB
SVGProLevelsFilter.js 6KB
AnimationManager.js 6KB
HCameraElement.js 6KB
LayerInterface.js 5KB
BasicPlayer.js 5KB
BezierEaser.js 5KB
build.js 5KB
common.js 5KB
SVGStrokeEffect.js 5KB
TextSelectorProperty.js 5KB
module.js 4KB
BaseRenderer.js 4KB
RoundCornersModifier.js 4KB
TransformInterface.js 4KB
ExpressionValueFactory.js 4KB
SVGDropShadowEffect.js 3KB
EffectInterface.js 3KB
imagePreloader.js 3KB
SVGGradientFillStyleData.js 3KB
RenderableElement.js 3KB
TextElement.js 3KB
TransformElement.js 3KB
HBaseElement.js 3KB
SVGMatte3Effect.js 3KB
CompElement.js 3KB
expressionHelpers.js 2KB
GradientProperty.js 2KB
ShapePath.js 2KB
SVGTritoneFilter.js 2KB
BaseElement.js 2KB
CVMaskElement.js 2KB
RenderableDOMElement.js 2KB
CVBaseElement.js 2KB
TextAnimatorDataProperty.js 2KB
SVGEffects.js 2KB
EffectsManager.js 2KB
SVGTintEffect.js 2KB
ShapeElement.js 2KB
共 249 条
- 1
- 2
- 3
资源评论
- junze_tianjian2022-04-02垃圾,只是二进制的部分,没有源码!
weixin_39841848
- 粉丝: 510
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功