├── .gitignore
├── .npmignore
├── LICENSE
├── README-zh_CN.md
├── README.md
├── doc
    ├── QA-zh_CN.md
    ├── dragonbones_bin_format_1.0-zh_CN.md
    ├── dragonbones_json_format_5.5-zh_CN.md
    ├── dragonbones_json_format_5.5.md
    └── 如何在 Egret 中使用 Live2D 的动画资源.md
├── out
    └── resource
    │   ├── helper.html
    │   ├── player
    │       ├── alone.html
    │       ├── index.html
    │       └── local.html
    │   └── viewer
    │       ├── alone.html
    │       ├── index.html
    │       └── local.html
├── package.json
├── src
    ├── action
    │   ├── formatFormat.ts
    │   ├── fromLive2D.ts
    │   ├── fromSpine.ts
    │   ├── toBinary.ts
    │   ├── toFormat.ts
    │   ├── toNew.ts
    │   ├── toSpine.ts
    │   └── toWeb.ts
    ├── common
    │   ├── nodeUtils.ts
    │   ├── object.ts
    │   ├── server.ts
    │   ├── types.ts
    │   └── utils.ts
    ├── convertFrom.ts
    ├── convertTo.ts
    ├── format
    │   ├── dragonBonesFormat.ts
    │   ├── dragonBonesFormatV23.ts
    │   ├── geom.ts
    │   ├── live2DFormat.ts
    │   ├── resFormat.ts
    │   ├── spineFormat.ts
    │   └── utils.ts
    ├── helper
    │   ├── helper.ts
    │   └── helperRemote.ts
    ├── remote.ts
    └── test
    │   └── testDemos.ts
├── tsconfig.json
├── tslint.json
└── typings.json
/.gitignore:
--------------------------------------------------------------------------------
 1 | # Logs
 2 | logs
 3 | *.log
 4 | npm-debug.log*
 5 | yarn-debug.log*
 6 | yarn-error.log*
 7 | 
 8 | # Runtime data
 9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 | 
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 | 
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 | 
20 | # nyc test coverage
21 | .nyc_output
22 | 
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 | 
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 | 
29 | # node-waf configuration
30 | .lock-wscript
31 | 
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 | 
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 | 
39 | # Typescript v1 declaration files
40 | typings/
41 | 
42 | # Optional npm cache directory
43 | .npm
44 | 
45 | # Optional eslint cache
46 | .eslintcache
47 | 
48 | # Optional REPL history
49 | .node_repl_history
50 | 
51 | # Output of 'npm pack'
52 | *.tgz
53 | 
54 | # Yarn Integrity file
55 | .yarn-integrity
56 | 
57 | # dotenv environment variables file
58 | .env
59 | 
60 | .vscode
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | src
3 | backup
4 | .vscode
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
 1 | MIT License
 2 | 
 3 | Copyright (c) 2017 DragonBones
 4 | 
 5 | Permission is hereby granted, free of charge, to any person obtaining a copy
 6 | of this software and associated documentation files (the "Software"), to deal
 7 | in the Software without restriction, including without limitation the rights
 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | 
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 | 
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 | 
--------------------------------------------------------------------------------
/README-zh_CN.md:
--------------------------------------------------------------------------------
 1 | # DragonBones tools
 2 | [README in English](./README.md)
 3 | ## [常见问题](./doc/QA-zh_CN.md)
 4 | 
 5 | ## JSON 格式文档
 6 | * [V 5.5](./doc/dragonbones_json_format_5.5-zh_CN.md)
 7 | 
 8 | ## 如何安装
 9 | * 安装 [Node.JS](https://nodejs.org/)。
10 | * 安装支持 html5 的浏览器,并且该浏览器是默认浏览器。
11 | * 命令行执行如下命令:
12 |     * $ `npm install dragonbones-tools --global`
13 | 
14 | ## 帮助
15 | * 使用 `2db` 命令将其他动画格式文件转换为龙骨 JSON 格式文件,使用 `--help` 命令查看 api 帮助。
16 |     
17 |     $ `2db --help`
18 | * use `db2` 命令将龙骨 JSON 格式文件转换为其他动画格式文件,使用 `--help` 命令查看 api 帮助。
19 |     
20 |     $ `db2 --help`
21 | 
22 | ## 如何使用
23 | * 将当面目录下所有的 Spine JSON 格式文件转换为龙骨 JSON 格式文件。
24 |     
25 |     $ `2db -t spine`
26 | * 将当面目录下所有的 Live2d JSON 格式文件转换为龙骨 JSON 格式文件。
27 |     
28 |     $ `2db -t live2d`
29 | * 将当面目录下所有的龙骨 JSON 格式文件转换为最新的龙骨 JSON 格式文件。
30 |     
31 |     $ `db2 -t new`
32 | * 将当面目录下所有的龙骨 JSON 格式文件转换为 Spine JSON 格式文件。
33 |     
34 |     $ `db2 -t spine`
35 | * 将当面目录下所有包含 `hero` 关键字的龙骨 JSON 格式文件转换为龙骨二进制格式文件。
36 |     
37 |     $ `db2 -t binary -f hero`
38 | * 将输入目录所有的龙骨 JSON 格式文件转换为龙骨二进制格式文件并输出到指定目录。
39 |     
40 |     $ `db2 -t binary -i d:/input -o d:/output -d`
41 | 
42 | ## 注意事项
43 | * 请确认在转换文件之前备份原始文件。
44 | 
45 | ## 如何编译
46 | * $ `npm install`
47 | * $ `npm install typescript --global`
48 | * $ `tsc`
49 | * $ `npm link`
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
 1 | # DragonBones tools
 2 | [中文 README](./README-zh_CN.md)
 3 | ## JSON format
 4 | * [V 5.5](./doc/dragonbones_json_format_5.5.md)
 5 | 
 6 | ## Installation
 7 | * Install [Node.JS](https://nodejs.org/).
 8 | * Install a browser that supports html5.
 9 | * Execute the following command from the command line:
10 | * $ `npm install dragonbones-tools --global`
11 | 
12 | ## Help
13 | * use `2db` convert other format files to DragonBones json format files.
14 |     
15 |     $ `2db --help`
16 | * use `db2` convert DragonBones json format files to other format files.
17 |     
18 |     $ `db2 --help`
19 | 
20 | ## How to use
21 | * Convert Spine json format files to DragonBones json format files in current path.
22 |     
23 |     $ `2db -t spine`
24 | * Convert Live2d json format files to DragonBones json format files in current path.
25 |     
26 |     $ `2db -t live2d`
27 | * Convert old DragonBones json format files to new DragonBones json format files in current path.
28 |     
29 |     $ `db2 -t new`
30 | * Convert DragonBones json format files to Spine json format files in current path.
31 |     
32 |     $ `db2 -t spine`
33 | * Convert DragonBones json format files (file path contains "hero" key word) to DragonBones binary format files in current path.
34 |     
35 |     $ `db2 -t binary -f hero`
36 | * Convert DragonBones json format files to DragonBones binary format files from input path to output path and delete raw files.
37 |     
38 |     $ `db2 -t binary -i d:/input -o d:/output -d`
39 | 
40 | ## Notice
41 | * Make sure backup your raw resources before convert.
42 | 
43 | ## How to build
44 | * $ `npm install`
45 | * $ `npm install typescript --global`
46 | * $ `tsc`
47 | * $ `npm link`
--------------------------------------------------------------------------------
/doc/QA-zh_CN.md:
--------------------------------------------------------------------------------
 1 | * 问:龙骨的官网在哪里?
 2 | * 答:
 3 |     * 龙骨官网:http://dragonbones.com/ (仅仅做为官网,维护稍慢)
 4 |     * github 龙骨官网:https://github.com/DragonBones/ (源码和例子都在这里,维护良好,建议以此为准)
 5 | 
 6 | * 问:为什么 PS 导出插件会报各种莫名其妙的错误?
 7 | * 答:建议使用完整版的 PS 而不是各种精简版的 PS。
 8 | 
 9 | * 问:为什么无法导出文件或无法预览?
10 | * 答:确保设备的浏览器是支持 html5 的浏览器。项目名称不可含有特殊符号等,例如空格、小数点。
11 | 
12 | * 问:文件、骨架、骨骼、插槽、显示资源、动画的命名有什么规范吗?
13 | * 答:为了不给程序开发带来不必要的麻烦,尽量只使用英文,尽量不要使用奇怪的符号。
14 | 
15 | * 问:库的文件结构有什么特殊要求吗?
16 | * 答:某些引擎可能不支持多级文件夹,而找不到贴图,这个时候将贴图资源都放到库的根目录可以解决这类问题。
17 | 
18 | * 问:为什么浏览器支持 html5 仍然无法导出文件或无法预览?
19 | * 答:可能由于 DragonBones Pro 的缓存损坏造成的,建议删除缓存文件夹 `C:\Users\{你的用户名}\AppData\Roaming\DragonBonesPro\Local Store`。
20 | 
21 | * 问:为什么导入的 Spine 文件不太正确?
22 | * 答:DragonBones Pro 的导入插件有一些兼容问题,可以尝试全新的转换方式 [DragonBones Tools](https://github.com/DragonBones/Tools) ,该转换插件需要依赖 NodeJS 和 npm。转换后的文件可以在 [DragonBones Viewer](https://dbplayer.egret-labs.org/viewer/v1/index.html) 中查看(将转换的文件全选,并拖拽到浏览器窗口即可),这些文件可以在龙骨运行时中良好的运行,但目前还无法在 DragonBones Pro 中运行,DragonBones Pro 有一些兼容问题。
23 | 
24 | * 问:为什么修改项目的 library 后,会出现各种错误?比如找不到图片等?
25 | * 答:因为 DragonBonesPro 的 library 功能开发的不够完善,为了保证工程地安全,建议不要使用此功能。
26 | 
27 | * 问:为什么我修改了图片名后,可能出现找不到图片的情况?
28 | * 答:因为 DragonBonesPro 的 library 功能开发的不够完善,为了保证工程地安全,建议不要使用此功能。
29 | 
30 | * 问:Flash 动画怎么导入 DragonBones Pro?
31 | * 答:可部分参考[这篇文章](http://dragonbones.com/2015/getting_startedV20_cn.htmlhttp://dragonbones.com/2015/getting_startedV20_cn.html),将插件导出的 JSON 导入到 DragonBones Pro 即可。
32 | 
33 | * 问:为什么导出的动画贴图在游戏引擎会有黑边?
34 | * 答:Cocos Creater 的[解决办法](http://forum.cocos.com/t/creater-blend-premultiply-alpha/43260/3),Unity 同理。
35 | 
--------------------------------------------------------------------------------
/doc/dragonbones_bin_format_1.0-zh_CN.md:
--------------------------------------------------------------------------------
  1 | # DragonBones 5.1 二进制数据格式标准说明
  2 | 
  3 | ##
  4 | * 不需要反序列化
  5 | * 运行效率
  6 | * 扩展性
  7 | * 结构复杂度
  8 | * 文件尺寸
  9 | 
 10 | 
 11 | ## Data Fromat
 12 | * [Data Tag](#data_tag)
 13 | * [Header](#header)
 14 | * [Color](#color)
 15 | * [Weights](#weights)
 16 | * [Surface](#surface)
 17 | * [Mesh](#mesh)
 18 | * [Timeline](#timeline)
 19 | * [Frame](#frame)
 20 | * [Tween Frame](#tween_frame)
 21 | * [Action Frame](#action_frame)
 22 | * [ZOrder Frame](#zorder_frame)
 23 | * [FFD Frame](#ffd_frame)
 24 | * [Tween Type](#tween_type)
 25 | 
 26 | 
 27 | 
Data Tag
 28 | 
 29 | Name | Data Type | Size (Bytes)
 30 | :---:|:---------:|:-----------:
 31 | Tag | Uint32 | 4
 32 | Version | Uint32 | 4
 33 |   |  |
 34 | 
 35 | 
 36 | 
 37 | 
 38 | Name | Data Type | Size (Bytes)
 39 | :---:|:---------:|:-----------:
 40 | Header Length | Uint32 | 4
 41 | Header | Uint16 | 2
 42 | ... | ... | ...
 43 |   |  |
 44 | 
 45 | ```javascript
 46 | {
 47 |     // DragonBones 数据名称(请区分 DragonBones 数据名称和骨架名称,一个 DragonBones 数据可包含多个骨架)
 48 |     "name": "dragonBonesName",
 49 |     // 数据版本
 50 |     "version": "5.0",
 51 |     // 最低兼容版本
 52 |     "compatibleVersion": "4.5",
 53 |     // 动画帧频
 54 |     "frameRate": 24,
 55 |     // 自定义数据 (可选属性 默认: null)
 56 |     "userData": null,
 57 | 
 58 |      // 区块偏移和长度
 59 |     "offset":[
 60 |         IntOffset, length, 
 61 |         FloatOffset, length, 
 62 |         FrameIntOffset, length, 
 63 |         FrameFloatOffset, length, 
 64 |         FrameOffset, length, 
 65 |         TimelineOffset, length, 
 66 |         ColorOffset, length
 67 |     ],
 68 | 
 69 |     "search":{
 70 |         "color": 0;
 71 |     }
 72 | 
 73 |     // 骨架列表
 74 |     "armature": [{
 75 |         // 骨架名称
 76 |         "name": "armatureName",
 77 |         // 动画帧频 (可选属性 默认: 使用 DragonBones 数据的动画帧频)
 78 |         "frameRate": 24,
 79 |         // 骨架类型 (可选属性 默认: "Armature")
 80 |         // ["Armature": 骨骼动画, "MovieClip": 基本动画, "Stage": 场景动画]
 81 |         "type": "Armature",
 82 |         // 自定义数据 (可选属性 默认: null)
 83 |         "userData": null,
 84 | 
 85 |         // 区块偏移
 86 |         "offset":[IntOffset, FloatOffset, FrameOffset],
 87 | 
 88 |         // 骨骼列表
 89 |         "bone": [{
 90 |             // 骨骼名称
 91 |             "name": "boneName",
 92 |             // 父级骨骼名称
 93 |             "parent": "parentBoneName",
 94 |             // 是否继承移动 (可选属性 默认: true)
 95 |             "inheritTranslation": true,
 96 |             // 是否继承旋转 (可选属性 默认: true)
 97 |             "inheritRotation": true,
 98 |             // 是否继承缩放 (可选属性 默认: true)
 99 |             "inheritScale": true,
100 |             // 是否继承镜像 (可选属性 默认: true)
101 |             "inheritReflection": true,
102 |             // 长度 (可选属性 默认: 0.00)
103 |             "length": 0.00,
104 |             // 自定义数据 (可选属性 默认: null)
105 |             "userData": null,
106 | 
107 |             // 注册到骨架的位移/ 旋转/ 斜切/ 缩放 (可选属性 默认: null)
108 |             "transform": {
109 |                 "x": 0.0000,
110 |                 "y": 0.0000,
111 |                 "r": 0.0000,
112 |                 "sk": 0.0000,
113 |                 "scX": 1.0000,
114 |                 "scY": 1.0000
115 |             }
116 |         }],
117 | 
118 |         // 插槽列表
119 |         "slot": [{
120 |             // 插槽名称
121 |             "name": "slotName",
122 |             // 插槽所属骨骼名称
123 |             "parent": "parentBoneName",
124 |             // 插槽默认显示对象
125 |             "displayIndex": 0,
126 |             // 插槽显示混合模式
127 |             "blendMode": null,
128 |             // 自定义数据 (可选属性 默认: null)
129 |             "userData": null,
130 |             // 插槽默认颜色
131 |             "color": {
132 |                 "aM": 100,
133 |                 "rM": 100,
134 |                 "gM": 100,
135 |                 "bM": 100,
136 |                 "aO": 0,
137 |                 "rO": 0,
138 |                 "gO": 0,
139 |                 "bO": 0,
140 |             }
141 |         }],
142 | 
143 |         // 皮肤列表
144 |         "skin": [{
145 |             // 皮肤名称
146 |             "name": "skinName",
147 |             
148 |             // 皮肤插槽配置列表
149 |             "slot": {
150 |                 "name": [{
151 |                     // 显示对象名称
152 |                     "name": "displayName",
153 |                     // 显示对象类型
154 |                     "type": "image",
155 | 
156 |                     "subType": "rectangle",
157 |                     // 如果共享网格是否继承 FFD 动画
158 |                     "inheritFFD": true,
159 |                     // 数据地址
160 |                     "offset": 10000,
161 |                     // 矩形或椭圆的宽高 (可选属性 默认: 0, 仅对边界框有效),
162 |                     "width": 100, "height": 100
163 |                     // 
164 |                     "share": "meshName",
165 |                     // 子骨架指向的骨架名称或网格包含的贴图名称 (可选属性 默认: null, 仅对子骨架、网格有效)
166 |                     "path": "path",
167 | 
168 |                     // 图片显示对象的轴点 (可选属性 默认: null)
169 |                     "pivot": {
170 |                         "x": 0.50, // 水平轴点 [0.00~1.00] (可选属性 默认: 0.50)
171 |                         "y": 0.50, // 垂直轴点 [0.00~1.00] (可选属性 默认: 0.50)
172 |                     },
173 | 
174 |                     // 注册到骨骼的位移/ 旋转/ 斜切/ 缩放 (可选属性 默认: null)
175 |                     "transform": {
176 |                         "x": 0.0000,
177 |                         "y": 0.0000,
178 |                         "rt": 0.0000,
179 |                         "sk": 0.0000,
180 |                         "scX": 1.0000,
181 |                         "scY": 1.0000
182 |                     },
183 | 
184 |                     // 添加到舞台后的默认行为列表 (可选属性 默认: null)
185 |                     "actions":[{
186 |                         "type": "play",
187 |                         "name": "animationName"
188 |                     }]
189 |                 }]
190 |             }
191 |         }],
192 | 
193 |         // ik 约束列表
194 |         "ik": [{
195 |             // ik 约束名称
196 |             "name": "ikName",
197 |             // 绑定骨骼名称
198 |             "bone": "boneName",
199 |             // 目标骨骼名称
200 |             "target": "ikBoneName",
201 |             // 弯曲方向 (可选属性 默认: true)
202 |             // [true: 正方向/ 顺时针, false: 反方向/ 逆时针]
203 |             "bendPositive": true,
204 |             // 骨骼链的长度 (可选属性 默认: 0)
205 |             // [0: 只约束 bone, n: 约束 bone 及 bone 向上 n 级的父骨骼]
206 |             "chain": 0,
207 |             // 权重 [0.00: 不约束 ~ 1.00: 完全约束] (可选属性 默认: 1.00)
208 |             "weight": 1.00
209 |         }],
210 | 
211 |         // 添加到舞台后的默认行为列表 (可选属性 默认: null)
212 |         "defaultActions":[{
213 |             "type": "play",
214 |             "name": "animationName"
215 |         }],
216 | 
217 |         // 动画列表
218 |         "animation": [{
219 |             // 动画名称
220 |             "name": "animationName",
221 |             // 持续的帧 (可选属性 默认: 1)
222 |             "duration": 1,
223 |             // 循环播放次数 [0: 循环播放无限次, n: 循环播放 n 次] (可选属性 默认: 1)
224 |             "playTimes": 1,
225 |             // 动画淡入时间 (以秒为单位,可选属性 默认: 0)
226 |             "fadeInTime": 1.00,
227 |             // 动画时间的缩放
228 |             "scale": 1.00,
229 |             // 自定义数据 (可选属性 默认: null)
230 |             "userData": null,
231 | 
232 |             // 行为时间轴地址
233 |             "action": 00000,
234 |             // 层级时间轴地址
235 |             "zOrder": 00001,
236 | 
237 |             // 区块偏移
238 |             "offset":[FrameIntOffset, FrameFloatOffset, FrameOffset],
239 |             
240 |             "bone": {
241 |                 "name": [TimelineTag, TimelineOffset, TimelineTag, TimelineOffset, ...]
242 |             },
243 | 
244 |             "slot": {
245 |                 "name": [TimelineTag, TimelineOffset, TimelineTag, TimelineOffset, ...]
246 |             },
247 | 
248 |             "animation": {
249 |                 "name": [TimelineTag, TimelineOffset, TimelineTag, TimelineOffset, ...]
250 |             }
251 |         }]
252 |     }]
253 | }
254 | ```
255 | 
256 | 
257 | Color (Int Array)
258 | 
259 | Name | Data Type | Size (Bytes) | Value range
260 | :---:|:---------:|:------------:|:----------:
261 | Alpha Multiplier | Int16 | 2 | 0 ~ 100
262 | Red Multiplier | Int16 | 2 | 0 ~ 100
263 | Greed Multiplier | Int16 | 2 | 0 ~ 100
264 | Blue Multiplier | Int16 | 2 | 0 ~ 100
265 | Alpha Offset | Int16 | 2 | -256 ~ 256
266 | Red Offset | Int16 | 2 | -256 ~ 256
267 | Greed Offset | Int16 | 2 | -256 ~ 256
268 | Blue Offset | Int16 | 2 | -256 ~ 256
269 |  |  |
270 | 
271 | 
272 | Weights (Int Array)
273 | 
274 | Name | Data Type | Size (Bytes) | Value range
275 | :---:|:---------:|:------------:|:-----------:
276 | Bone Count | Int16 | 2 |
277 | Float Array Offset | Int16 | 2 |
278 | Bone Indices | Int16 | 2 |
279 | ... | ... | ...
280 | Vertex Bone Count, Vertex Bone Indices | Int16 | 2 | 3, 4, 7, 6
281 | ... | ... | ...
282 |  |  |
283 | Weight, X, Y (Float Array) | Float32 | 4 | 1.0, 12.3, 45.6
284 | ... | ... | ...
285 |  |  |
286 | 
287 | 
288 | Surface (Int Array)
289 | 
290 | Name | Data Type | Size (Bytes) | Value range
291 | :---:|:---------:|:------------:|:-----------:
292 | Vertex Count | Int16 | 2 |
293 | Empty | Int16 | 2 | 0
294 | Float Array Offset | Int16 | 2 |
295 | Empty | Int16 | 2 | -1
296 |  |  | 
297 | Vertices (Float Array) | Float32 | 4 |
298 | ... | ... | ...
299 |  |  |
300 | 
301 | 
302 | Mesh (Int Array)
303 | 
304 | Name | Data Type | Size (Bytes) | Value range
305 | :---:|:---------:|:------------:|:-----------:
306 | Vertex Count | Int16 | 2 |
307 | Triangle Count | Int16 | 2 |
308 | Float Array Offset | Int16 | 2 |
309 | Weight Offset | Int16 | 2 | -1: No Weights, N: [Weights](#weidhts) Offset
310 | Vertex indices | Int16 | 2 |
311 | ... | ... | ...
312 |  |  |
313 | Vertices (Float Array) | Float32 | 4 |
314 | ... | ... | ...
315 | UVs (Float Array) | Float32 | 4 |
316 | ... | ... | ...
317 |  |  |
318 | 
319 | 
320 | Path / Polygon BoundingBox (Int Array)
321 | 
322 | Name | Data Type | Size (Bytes) | Value range
323 | :---:|:---------:|:------------:|:-----------:
324 | Vertex Count | Int16 | 2 | 
325 | Empty | Int16 | 2 | 0
326 | Float Array Offset | Int16 | 2 |
327 | Weight Offset | Int16 | 2 | -1: No Weights, N: [Weights](#weidhts) Offset
328 |  |  | 
329 | Vertices (Float Array) | Float32 | 4 |
330 | ... | ... | ...
331 |  |  |
332 | 
333 | 
334 | Timeline (Uint Array)
335 | 
336 | Name | Data Type | Size (Bytes)
337 | :---:|:---------:|:-----------:
338 | Scale | Uint16 | 2
339 | Offset | Uint16 | 2
340 | Key Frame Count | Uint16 | 2
341 | Frame Value Count or Value Offset (Int Array or Float Array) | Uint16 | 2
342 | Frame Value Offset (Frame Int Array or Frame Float Array) | Uint16 | 2
343 | Frame Array Offsets | Uint16 | 2
344 | ... | ... | ...
345 |   |  |
346 | 
347 | 
348 | Frame (Frame Array)
349 | 
350 | Name | Data Type | Size (Bytes)
351 | :---:|:---------:|:-----------:
352 | Position | Int16 | 2
353 |   |  |
354 | 
355 | 
356 | Tween Frame (Frame Array)
357 | 
358 | Name | Data Type | Size (Bytes) | Value range
359 | :---:|:---------:|:------------:|:----------:
360 | Tween Type | Int16 | 2 | [Tween Type](#tween_type)
361 | Tween Easing or Curve Sample Count | Int16 | 2 | 0 ~ 100 or Count
362 | Curve Samples | Int16 | 2
363 | ... | ... | ...
364 |   |  |
365 | 
366 | 
367 | Action Frame (Frame Array)
368 | 
369 | Name | Data Type | Size (Bytes)
370 | :---:|:---------:|:-----------:
371 | Action Count | Int16 | 2
372 | Action Indices | Int16 | 2
373 | ... | ... | ...
374 |   |  |
375 | 
376 | 
377 | ZOrder Frame (Frame Array)
378 | 
379 | Name | Data Type | Size (Bytes)
380 | :---:|:---------:|:-----------:
381 | ZOrder Count | Int16 | 2
382 | ZOrders | Int16 | 2
383 | ... | ... | ...
384 |   |  |
385 | 
386 | 
387 | Tween Type
388 | 
389 | Value | Type
390 | :----:|:---:
391 | 0 | None
392 | 1 | Linear
393 | 2 | Curve
394 | 3 | EaseInQuad
395 | 4 | EaseOutQuad
396 | 5 | EaseInOutQuad
397 | ... | ...
398 |   | 
--------------------------------------------------------------------------------
/doc/dragonbones_json_format_5.5-zh_CN.md:
--------------------------------------------------------------------------------
  1 | # DragonBones 5.5 JSON 数据格式
  2 | [English](./dragonbones_json_format_5.5.md)
  3 | 
  4 | ```javascript
  5 | {
  6 |     // 龙骨数据名称。
  7 |     "name": "dragonBonesName",
  8 | 
  9 |     // 数据版本。
 10 |     "version": "5.5",
 11 |     
 12 |     // 数据兼容的最低版本。
 13 |     "compatibleVersion": "5.5",
 14 | 
 15 |     // 动画帧率。 (可选属性,默认:24)
 16 |     "frameRate": 24,
 17 | 
 18 |     // 自定义数据。 (可选属性,默认:null)
 19 |     "userData": null,
 20 | 
 21 |     // 骨架列表。 (可选属性,默认:null)
 22 |     "armature": [{
 23 | 
 24 |         // 骨架名称。
 25 |         "name": "armatureName",
 26 | 
 27 |         // 动画帧率。 (可选属性,默认:null)
 28 |         // [null: 使用龙骨数据的帧率, N: 动画帧率]
 29 |         "frameRate": 24,
 30 | 
 31 |         // 非必要。
 32 |         "type": "Armature",
 33 | 
 34 |         // 自定义数据。 (可选属性,默认:null)
 35 |         "userData": null,
 36 | 
 37 |         // 当该骨架做为子骨架加入到父骨架时的默认行为列表。 (可选属性,默认:null)
 38 |         "defaultActions": [
 39 |             {
 40 |                 "gotoAndPlay": "animationName"
 41 |             }
 42 |         ],
 43 | 
 44 |         // 骨骼列表。 (可选属性,默认:null)
 45 |         "bone": [{
 46 | 
 47 |             // 骨骼名称。
 48 |             "name": "boneName",
 49 | 
 50 |             // 父骨骼名称。 (可选属性,默认:null)
 51 |             "parent": "parentBoneName",
 52 | 
 53 |             // 自定义数据。 (可选属性,默认:null)
 54 |             "userData": null,
 55 | 
 56 |             // 该骨骼相对与父骨骼或骨架的基础变换。 (可选属性,默认:null)
 57 |             "transform": {
 58 |                 "x": 0.0, // 水平位移。 (可选属性,默认:0.0)
 59 |                 "y": 0.0, // 垂直位移。 (可选属性,默认:0.0)
 60 |                 "skX": 0.0, // 水平倾斜。 (可选属性,默认:0.0)
 61 |                 "skY": 0.0, // 垂直倾斜。 (可选属性,默认:0.0)
 62 |                 "scX": 1.0, // 水平缩放。 (可选属性,默认:1.0)
 63 |                 "scY": 1.0  // 垂直缩放。 (可选属性,默认:1.0)
 64 |             }
 65 |         }],
 66 | 
 67 |         // 插槽列表。
 68 |         "slot": [{
 69 | 
 70 |             // 插槽名称。
 71 |             "name": "slotName",
 72 | 
 73 |             // 父骨骼名称。
 74 |             "parent": "parentBoneName",
 75 | 
 76 |             // 默认的显示对象索引。 (可选属性,默认:0)
 77 |             "displayIndex": 0,
 78 | 
 79 |             // 混合模式。 (可选属性,默认:null)
 80 |             "blendMode": null,
 81 | 
 82 |             // 自定义数据。 (可选属性,默认:null)
 83 |             "userData": null,
 84 | 
 85 |             // 颜色变换。 (可选属性,默认:null)
 86 |             "color": {
 87 |                 "aM": 100, // 透明相乘因子。 [0~100] (可选属性,默认:100)
 88 |                 "rM": 100, // 红色相乘因子。 [0~100] (可选属性,默认:100)
 89 |                 "gM": 100, // 绿色相乘因子。 [0~100] (可选属性,默认:100)
 90 |                 "bM": 100, // 蓝色相乘因子。 [0~100] (可选属性,默认:100)
 91 |                 "aO": 0, // 透明偏移。 [-255~255] (可选属性,默认:0)
 92 |                 "rO": 0, // 红色偏移。 [-255~255] (可选属性,默认:0)
 93 |                 "gO": 0, // 绿色偏移。 [-255~255] (可选属性,默认:0)
 94 |                 "bO": 0, // 蓝色偏移。 [-255~255] (可选属性,默认:0)
 95 |             }
 96 |         }],
 97 | 
 98 |         // 皮肤列表。
 99 |         "skin": [{
100 | 
101 |             // 皮肤名称。
102 |             "name": "skinName",
103 | 
104 |             // 插槽列表。
105 |             "slot": [{
106 | 
107 |                 // 插槽名称。
108 |                 "name": "slotName",
109 | 
110 |                 // 显示对象列表。
111 |                 "display": [{
112 | 
113 |                     // 显示对象名称。
114 |                     "name": "displayName",
115 | 
116 |                     // 显示对象类型。 (可选属性,默认:"image")
117 |                     // ["image": 贴图的矩形, "armature": 嵌套的子骨架, "mesh": 贴图的网格, "boundingBox": 自定义边界框]
118 |                     "type": "image",
119 | 
120 |                     // 显示对象的资源路径。 (可选属性,默认:null)
121 |                     "path": null,
122 | 
123 |                     // 共享网格的名称。 (可选属性,默认:null)
124 |                     "share": "meshName",
125 | 
126 |                     // 是否继承共享网格的形变动画。 (可选属性,默认:true)
127 |                     "inheritDeform": true,
128 | 
129 |                     // 显示对象的子类型。
130 |                     // 如果是边界框: (可选属性,默认:"rectangle")
131 |                     // ["rectangle": 矩形边界框, "ellipse": 椭圆边界框, "polygon": 多边形边界框]
132 |                     "subType": "rectangle", 
133 | 
134 |                     // 非必要。
135 |                     "color": 0x000000,
136 | 
137 |                     // 相对于骨骼的变换。 (可选属性,默认:null)
138 |                     "transform": {
139 |                         "x": 0.0, // 水平位移。 (可选属性,默认:0.0)
140 |                         "y": 0.0, // 垂直位移。 (可选属性,默认:0.0)
141 |                         "skX": 0.0, // 水平倾斜。 (可选属性,默认:0.0)
142 |                         "skY": 0.0, // 垂直倾斜。 (可选属性,默认:0.0)
143 |                         "scX": 1.0, // 水平缩放。 (可选属性,默认:1.0)
144 |                         "scY": 1.0  // 垂直缩放。 (可选属性,默认:1.0)
145 |                     },
146 | 
147 |                     // 相对轴点。 (可选属性,默认:null)
148 |                     "pivot": {
149 |                         "x": 0.5, // 水平位移。 [0.0~1.0] (可选属性,默认:0.5)
150 |                         "y": 0.5, // 垂直位移。 [0.0~1.0] (可选属性,默认:0.5)
151 |                     },
152 | 
153 |                     // 显示对象的尺寸。 (仅对边界框有效)
154 |                     "width": 100,
155 |                     "height": 100,
156 | 
157 |                     "vertices": [-64.0, -64.0, 64.0, -64.0, 64.0, 64.0, -64.0, 64.0],
158 | 
159 |                     "uvs": [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0],
160 | 
161 |                     "triangles": [0, 1, 2, 2, 3, 0],
162 | 
163 |                     "weights": [1, 0, 1.0, 2, 0, 0.5, 1, 0.5],
164 | 
165 |                     "slotPose": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0],
166 | 
167 |                     "bonePose": [0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0],
168 | 
169 |                     // 替换子骨架的默认行为列表。 (可选属性,默认:null)
170 |                     "actions": [
171 |                         {
172 |                             "gotoAndPlay": "animationName"
173 |                         }
174 |                     ]
175 |                 }]
176 |             }]
177 |         }],
178 | 
179 |         // IK 约束列表。
180 |         "ik": [{
181 | 
182 |             // IK 约束名称。
183 |             "name": "ikContaintName",
184 | 
185 |             // 约束骨骼的名称。
186 |             "bone": "boneName",
187 | 
188 |             // 约束目标骨骼的名称
189 |             "target": "ikBoneName",
190 | 
191 |             // IK 约束的方向。 (可选属性,默认:true)
192 |             // [true: 正方向 / 顺时针, false: 反方向 / 逆时针]
193 |             "bendPositive": true,
194 | 
195 |             // 被约束的骨骼链长度。
196 |             // [0: 至约束骨骼, N: 该骨骼和向上 N 级的父骨骼] (可选属性,默认:0)
197 |             "chain": 0,
198 | 
199 |             // 约束权重。 [0.0~1.0] (可选属性,默认:1.0)
200 |             "weight": 1.0
201 |         }],
202 | 
203 |         // 动画列表。
204 |         "animation": [{
205 | 
206 |             // 动画名称。
207 |             "name": "animationName",
208 | 
209 |             // 动画播放次数。 [0: 循环播放, N: 播放 N 次] (可选属性,默认:1)
210 |             "playTimes": 1,
211 | 
212 |             // 动画长度。 (可选属性,默认:1)
213 |             "duration": 1,
214 | 
215 |             // 行为关键帧列表。 (可选属性,默认:null)
216 |             "frame": [{
217 | 
218 |                 // 关键帧长度。 (可选属性,默认:1)
219 |                 "duration": 1,
220 | 
221 |                 // 该帧的行为列表。 (可选属性,默认:null)
222 |                 "actions": [{
223 | 
224 |                     // 行为类型。 [0: 播放动画, 10: 帧事件, 11: 帧声音事件] (可选属性,默认:0)
225 |                     "type": 0,
226 | 
227 |                     // 行为的名称。 (动画名称或事件名称)
228 |                     "name": "actionName",
229 | 
230 |                     // 骨骼名称。 (可选属性,默认:null)
231 |                     "bone": "boneName",
232 | 
233 |                     // 插槽名称。 (可选属性,默认:null)
234 |                     "slot": "slotName",
235 | 
236 |                     // 自定义数据列表。 (可选属性,默认:null)
237 |                     "ints":[0, 1, 2],
238 |                     "floats":[0.01, 1.01, 2.01],
239 |                     "strings":["a", "b", "c"]
240 |                 }]
241 |             }],
242 | 
243 |             // z 排序时间轴。
244 |             "zOrder": {
245 |                 "frame": [{
246 |                     
247 |                     // 关键帧长度。 (可选属性,默认:1)
248 |                     "duration": 1,
249 | 
250 |                     // 该帧插槽 z 排序偏移列表。 [slotIndexA, offsetA, slotIndexB, offsetB, ...] (可选属性,默认:null)
251 |                     "zOrder": [0, 2, 4, 1, 6, -1]
252 |                 }]
253 |             },
254 | 
255 |             // 骨骼时间轴列表。
256 |             "bone": [{
257 | 
258 |                 // 骨骼名称。
259 |                 "name": "boneName",
260 | 
261 |                 // 时间轴缩放。 (可选属性,默认:0.0)
262 |                 "scale": 1.0,
263 | 
264 |                 // 时间轴偏移。 (可选属性,默认:0.0)
265 |                 "offset": 0.0,
266 | 
267 |                 // 位移关键帧列表。 (可选属性,默认:null)
268 |                 "translateFrame": [{
269 | 
270 |                     // 关键帧长度。 (可选属性,默认:1)
271 |                     "duration": 1,
272 | 
273 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
274 |                     "tweenEasing": 0.0,
275 | 
276 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
277 |                     "curve": [0.0, 0.0, 1.0, 1.0],
278 |                     
279 |                     // 该帧骨骼的水平位移。 (可选属性,默认:0.0)
280 |                     "x": 0.0,
281 | 
282 |                     // 该帧骨骼的垂直位移。 (可选属性,默认:0.0)
283 |                     "y": 0.00,
284 |                 }],
285 | 
286 |                 // 旋转关键帧列表。 (可选属性,默认:null)
287 |                 "rotateFrame": [{
288 | 
289 |                     // 关键帧长度。 (可选属性,默认:1)
290 |                     "duration": 1,
291 | 
292 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
293 |                     "tweenEasing": 0.0,
294 | 
295 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
296 |                     "curve": [0.0, 0.0, 1.0, 1.0],
297 | 
298 |                     // 补间的旋转方式。 (可选属性,默认:0)
299 |                     // [0: 最小角度旋转, 1: 顺时针旋转, -1: 逆时针旋转, N: 至少顺时针旋转 N 圈, -N: 至少逆时针旋转 N 圈]
300 |                     "clockwise": 0,
301 | 
302 |                     // 该帧骨骼的旋转。 [-PI ~ PI] (可选属性,默认:0.0)
303 |                     "rotate": 0.0,
304 | 
305 |                     // 该帧骨骼的倾斜。 [-PI ~ PI] (可选属性,默认:0.0)
306 |                     "skew": 0.0
307 |                 }],
308 | 
309 |                 // 缩放关键帧列表。 (可选属性,默认:null)
310 |                 "scaleFrame": [{
311 | 
312 |                     // 关键帧长度。 (可选属性,默认:1)
313 |                     "duration": 1,
314 | 
315 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
316 |                     "tweenEasing": 0.0,
317 | 
318 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
319 |                     "curve": [0.0, 0.0, 1.0, 1.0],
320 | 
321 |                     // 该帧骨骼的水平缩放。 (可选属性,默认:1.0)
322 |                     "x": 1.0,
323 | 
324 |                     // 该帧骨骼的垂直缩放。 (可选属性,默认:1.0)
325 |                     "y": 1.0
326 |                 }]
327 |             }],
328 | 
329 |             // 插槽时间轴列表。
330 |             "slot": [{
331 | 
332 |                 // 时间轴名称。
333 |                 "name": "slotName",
334 | 
335 |                 // 显示关键帧列表。 (可选属性,默认:null)
336 |                 "displayFrame": [{
337 | 
338 |                     // 关键帧长度。 (可选属性,默认:1)
339 |                     "duration": 1,
340 | 
341 |                     // 该帧插槽的显示对象索引。 (可选属性,默认:1)
342 |                     "value": 0,
343 | 
344 |                     // 该帧嵌套子骨架的行为列表。 (可选属性,默认:null)
345 |                     "actions": [
346 |                         {
347 |                             "gotoAndPlay": "animationName"
348 |                         }
349 |                     ]
350 |                 }],
351 |                 
352 |                 // 颜色关键帧列表。 (可选属性,默认:null)
353 |                 "colorFrame": [{
354 | 
355 |                     // 关键帧长度。 (可选属性,默认:1)
356 |                     "duration": 1,
357 | 
358 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
359 |                     "tweenEasing": 0.0,
360 | 
361 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
362 |                     "curve": [0.0, 0.0, 1.0, 1.0],
363 | 
364 |                     // 该帧插槽的颜色变换。 (可选属性,默认:null)
365 |                     "color": {
366 |                         "aM": 100, // 透明相乘因子。 [0~100] (可选属性,默认:100)
367 |                         "rM": 100, // 红色相乘因子。 [0~100] (可选属性,默认:100)
368 |                         "gM": 100, // 绿色相乘因子。 [0~100] (可选属性,默认:100)
369 |                         "bM": 100, // 蓝色相乘因子。 [0~100] (可选属性,默认:100)
370 |                         "aO": 0, // 透明偏移。 [-255~255] (可选属性,默认:0)
371 |                         "rO": 0, // 红色偏移。 [-255~255] (可选属性,默认:0)
372 |                         "gO": 0, // 绿色偏移。 [-255~255] (可选属性,默认:0)
373 |                         "bO": 0, // 蓝色偏移。 [-255~255] (可选属性,默认:0)
374 |                     }
375 |                 }]
376 |             }],
377 | 
378 |             // FFD 时间轴列表。(可选属性,默认:null)
379 |             "ffd": [{
380 | 
381 |                 // 网格名称。
382 |                 "name": "meshName",
383 |                 
384 |                 // 皮肤名称。
385 |                 "skin": "skinName",
386 | 
387 |                 // 插槽名称。
388 |                 "slot": "slotName",
389 | 
390 |                 "frame": [{
391 | 
392 |                     // 关键帧长度。 (可选属性,默认:1)
393 |                     "duration": 1,
394 | 
395 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
396 |                     "tweenEasing": 0.0,
397 | 
398 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
399 |                     "curve": [0.0, 0.0, 1.0, 1.0],
400 | 
401 |                     // 变形顶点列表的索引偏移,偏移之前的数据都是 0。 (可选属性,默认:0)
402 |                     "offset": 0,
403 | 
404 |                     // 变形顶点列表,队尾为 0 的数据会别省略。
405 |                     // [x0, y0, x1, y1, ...] (可选属性,默认:null)
406 |                     "vertices": [0.1, 0.1]
407 |                 }]
408 |             }],
409 | 
410 |             // IK 约束时间轴。 (可选属性,默认:null)
411 |             "ik": [{
412 |                 
413 |                 // IK 约束名称。
414 |                 "name": "meshName",
415 | 
416 |                 "frame": [{
417 | 
418 |                     // 关键帧长度。 (可选属性,默认:1)
419 |                     "duration": 1,
420 | 
421 |                     // 补间类型 [0.0: 线形, null: 不补间]. (可选属性,默认:0)
422 |                     "tweenEasing": 0.0,
423 | 
424 |                     // 补间贝塞尔曲线。 [x1, y1, x2, y2, ...] (可选属性,默认:null)
425 |                     "curve": [0.0, 0.0, 1.0, 1.0],
426 |                     
427 |                     // 该帧 IK 约束的方向。 (可选属性,默认:true)
428 |                     "bendPositive": true,
429 | 
430 |                     // 该帧 IK 约束的权重。 (可选属性,默认:1.0)
431 |                     "weight": 1.0
432 |                 }]
433 |             }]
434 |         }]
435 |     }]
436 | }
437 | ```
--------------------------------------------------------------------------------
/doc/dragonbones_json_format_5.5.md:
--------------------------------------------------------------------------------
  1 | # DragonBones 5.5 JSON format
  2 | [中文](./dragonbones_json_format_5.5-zh_CN.md)
  3 | 
  4 | ```javascript
  5 | {
  6 |     // The name of the DragonBones data.
  7 |     "name": "dragonBonesName",
  8 | 
  9 |     // The version of the DragonBones data.
 10 |     "version": "5.5",
 11 |     
 12 |     // The minimum compatible version of the DragonBones data.
 13 |     "compatibleVersion": "5.5",
 14 | 
 15 |     // The frame rate of animations. (Optional property, default: 24)
 16 |     "frameRate": 24,
 17 | 
 18 |     // The custom user data. (Optional property, default: null)
 19 |     "userData": null,
 20 | 
 21 |     // A list of the armatures. (Optional property, default: null)
 22 |     "armature": [{
 23 | 
 24 |         // The name of the armature.
 25 |         "name": "armatureName",
 26 | 
 27 |         // The frame rate of animations. (Optional property, default: null)
 28 |         // [null: Same as the frame rate of the DragonBones data, N: The frame rate.]
 29 |         "frameRate": 24,
 30 | 
 31 |         // Nonessential.
 32 |         "type": "Armature",
 33 | 
 34 |         // The custom user data. (Optional property, default: null)
 35 |         "userData": null,
 36 | 
 37 |         // A list of default actions when added to a parent armature. (Optional property, default: null)
 38 |         "defaultActions": [
 39 |             {
 40 |                 "gotoAndPlay": "animationName"
 41 |             }
 42 |         ],
 43 | 
 44 |         // A list of the bones. (Optional property, default: null)
 45 |         "bone": [{
 46 | 
 47 |             // The name of the bone.
 48 |             "name": "boneName",
 49 | 
 50 |             // The name of the parent bone. (Optional property, default: null)
 51 |             "parent": "parentBoneName",
 52 | 
 53 |             // The custom user data. (Optional property, default: null)
 54 |             "userData": null,
 55 | 
 56 |             // The transform of the bone relative to the parent bone or the armature for the base pose.
 57 |             // (Optional property, default: null)
 58 |             "transform": {
 59 |                 "x": 0.0, // The horizontal translate. (Optional property, default: 0.0)
 60 |                 "y": 0.0, // The vertical translate. (Optional property, default: 0.0)
 61 |                 "skX": 0.0, // The horizontal skew. (Optional property, default: 0.0)
 62 |                 "skY": 0.0, // The vertical skew. (Optional property, default: 0.0)
 63 |                 "scX": 1.0, // The horizontal scale. (Optional property, default: 1.0)
 64 |                 "scY": 1.0  // The vertical scale. (Optional property, default: 1.0)
 65 |             }
 66 |         }],
 67 | 
 68 |         // A list of the slots.
 69 |         "slot": [{
 70 | 
 71 |             // The name of the slot.
 72 |             "name": "slotName",
 73 | 
 74 |             // The name of the parent bone.
 75 |             "parent": "parentBoneName",
 76 | 
 77 |             // The default display index of the slot. (Optional property, default: 0)
 78 |             "displayIndex": 0,
 79 | 
 80 |             // The blend mode of the slot. (Optional property, default: null)
 81 |             "blendMode": null,
 82 | 
 83 |             // The custom user data. (Optional property, default: null)
 84 |             "userData": null,
 85 | 
 86 |             // The color transform of the slot. (Optional property, default: null)
 87 |             "color": {
 88 |                 "aM": 100, // The alpha multiplier. [0~100] (Optional property, default: 100)
 89 |                 "rM": 100, // The red multiplier. [0~100] (Optional property, default: 100)
 90 |                 "gM": 100, // The green multiplier. [0~100] (Optional property, default: 100)
 91 |                 "bM": 100, // The blue multiplier. [0~100] (Optional property, default: 100)
 92 |                 "aO": 0, // The alpha offset. [-255~255] (Optional property, default: 0)
 93 |                 "rO": 0, // The red offset. [-255~255] (Optional property, default: 0)
 94 |                 "gO": 0, // The green offset. [-255~255] (Optional property, default: 0)
 95 |                 "bO": 0, // The blue offset. [-255~255] (Optional property, default: 0)
 96 |             }
 97 |         }],
 98 | 
 99 |         // A list of the skins.
100 |         "skin": [{
101 | 
102 |             // The name of the skin.
103 |             "name": "skinName",
104 | 
105 |             // A list of the slots.
106 |             "slot": [{
107 | 
108 |                 // The name of the slot.
109 |                 "name": "slotName",
110 | 
111 |                 // A list of the displays.
112 |                 "display": [{
113 | 
114 |                     // The name of the display.
115 |                     "name": "displayName",
116 | 
117 |                     // The type of the display. (Optional property, default: "image")
118 |                     // [
119 |                     //     "image": A textured rectangle, 
120 |                     //     "armature": A nested child armature, 
121 |                     //     "mesh": A textured mesh, 
122 |                     //     "boundingBox": A bounding box
123 |                     // ]
124 |                     "type": "image",
125 | 
126 |                     // The resource path of the display. (Optional property, default: null)
127 |                     "path": null,
128 | 
129 |                     // The name of the shared mesh. (Optional property, default: null)
130 |                     "share": "meshName",
131 | 
132 |                     // Whether to inherit the deform animations of the shared mesh. (Optional property, default: true)
133 |                     "inheritDeform": true,
134 | 
135 |                     // The sub type of the display.
136 |                     // If the display is a bounding box: (Optional property, default: "rectangle")
137 |                     // ["rectangle": A rectangle, "ellipse": An ellipse, "polygon": A pllygon]
138 |                     "subType": "rectangle", 
139 | 
140 |                     // Nonessential.
141 |                     "color": 0x000000,
142 | 
143 |                     // The transform of the display relative to the slot's bone. (Optional property, default: null)
144 |                     "transform": {
145 |                         "x": 0.0, // The horizontal translate. (Optional property, default: 0.0)
146 |                         "y": 0.0, // The vertical translate. (Optional property, default: 0.0)
147 |                         "skX": 0.0, // The horizontal skew. (Optional property, default: 0.0)
148 |                         "skY": 0.0, // The vertical skew. (Optional property, default: 0.0)
149 |                         "scX": 1.0, // The horizontal scale. (Optional property, default: 1.0)
150 |                         "scY": 1.0  // The vertical scale. (Optional property, default: 1.0)
151 |                     },
152 | 
153 |                     // The relative pivot of the display. (Optional property, default: null)
154 |                     "pivot": {
155 |                         "x": 0.5, // The horizontal translate. [0.0~1.0] (Optional property, default: 0.5)
156 |                         "y": 0.5, // The vertical translate. [0.0~1.0] (Optional property, default: 0.5)
157 |                     },
158 | 
159 |                     // The size of display. (Valid for bounding box only)
160 |                     "width": 100,
161 |                     "height": 100,
162 | 
163 |                     "vertices": [-64.0, -64.0, 64.0, -64.0, 64.0, 64.0, -64.0, 64.0],
164 | 
165 |                     "uvs": [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0],
166 | 
167 |                     "triangles": [0, 1, 2, 2, 3, 0],
168 | 
169 |                     "weights": [1, 0, 1.0, 2, 0, 0.5, 1, 0.5],
170 | 
171 |                     "slotPose": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0],
172 | 
173 |                     "bonePose": [0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0],
174 | 
175 |                     // Override the default actions of the nested child armature. (Optional property, default: null)
176 |                     "actions": [
177 |                         {
178 |                             "gotoAndPlay": "animationName"
179 |                         }
180 |                     ]
181 |                 }]
182 |             }]
183 |         }],
184 | 
185 |         // A list of the IK constraints.
186 |         "ik": [{
187 | 
188 |             // The name of the IK constraint.
189 |             "name": "ikName",
190 | 
191 |             // The name of the bone.
192 |             "bone": "boneName",
193 | 
194 |             // The name of the target bone.
195 |             "target": "ikBoneName",
196 | 
197 |             // The IK constraint bend direction. (Optional property, default: true)
198 |             // [true: Positive direction / Clockwise, false: Reverse Direction / Counterclockwise]
199 |             "bendPositive": true,
200 | 
201 |             // The bone count of the bone chain in the constraint.
202 |             // [0: Only the bone, N: The bone and the bone up N-level parent bones] (Optional property, default: 0)
203 |             "chain": 0,
204 | 
205 |             // The weight of the IK constraint. [0.0~1.0] (Optional property, default: 1.0)
206 |             "weight": 1.0
207 |         }],
208 | 
209 |         // A list of the animations.
210 |         "animation": [{
211 | 
212 |             // The name of animation.
213 |             "name": "animationName",
214 | 
215 |             // The play times of the animation. [0: Loop play, N: Play N times] (Optional property, default: 1)
216 |             "playTimes": 1,
217 | 
218 |             // The duration of the animation. (Optional property, default: 1)
219 |             "duration": 1,
220 | 
221 |             // A list of the action keyframes. (Optional property, default: null)
222 |             "frame": [{
223 | 
224 |                 // The duration of the frame. (Optional property, default: 1)
225 |                 "duration": 1,
226 | 
227 |                 // A list of actions. (Optional property, default: null)
228 |                 "actions": [{
229 | 
230 |                     // The type of the action. (Optional property, default: 0)
231 |                     // [0: Play animation, 10: Frame event, 11: Frame sound event]
232 |                     "type": 0,
233 | 
234 |                     // The name of the action. (The name of a animation or an event)
235 |                     "name": "actionName",
236 | 
237 |                     // A bone name. (Optional property, default: null)
238 |                     "bone": "boneName",
239 | 
240 |                     // A slot name. (Optional property, default: null)
241 |                     "slot": "slotName",
242 | 
243 |                     // The list of custom data. (Optional property, default: null)
244 |                     "ints":[0, 1, 2],
245 |                     "floats":[0.01, 1.01, 2.01],
246 |                     "strings":["a", "b", "c"]
247 |                 }]
248 |             }],
249 | 
250 |             // The z order timeline.
251 |             "zOrder": {
252 |                 "frame": [{
253 |                     
254 |                     // The duration of the frame. (Optional property, default: 1)
255 |                     "duration": 1,
256 | 
257 |                     // A list of slot indeices and numeric offsets. [slotIndexA, offsetA, slotIndexB, offsetB, ...]
258 |                     // (Optional property, default: null)
259 |                     "zOrder": [0, 2, 4, 1, 6, -1]
260 |                 }]
261 |             },
262 | 
263 |             // A list of the bone timelines.
264 |             "bone": [{
265 | 
266 |                 // The name of the bone.
267 |                 "name": "boneName",
268 | 
269 |                 // The scale of the timeline. (Optional property, default: 0.0)
270 |                 "scale": 1.0,
271 | 
272 |                 // The offset of the timeline. (Optional property, default: 0.0)
273 |                 "offset": 0.0,
274 | 
275 |                 // A list of the translate keyframes. (Optional property, default: null)
276 |                 "translateFrame": [{
277 | 
278 |                     // The duration of the frame. (Optional property, default: 1)
279 |                     "duration": 1,
280 | 
281 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
282 |                     "tweenEasing": 0.0,
283 | 
284 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
285 |                     // (Optional property, default: null)
286 |                     "curve": [0.0, 0.0, 1.0, 1.0],
287 |                     
288 |                     // The horizontal translate of a bone in the keyframe. (Optional property, default: 0.0)
289 |                     "x": 0.0,
290 | 
291 |                     // The vertical translate of a bone in the keyframe. (Optional property, default: 0.0)
292 |                     "y": 0.00,
293 |                 }],
294 | 
295 |                 // A list of the rotate keyframes. (Optional property, default: null)
296 |                 "rotateFrame": [{
297 | 
298 |                     // The duration of the frame. (Optional property, default: 1)
299 |                     "duration": 1,
300 | 
301 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
302 |                     "tweenEasing": 0.0,
303 | 
304 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
305 |                     // (Optional property, default: null)
306 |                     "curve": [0.0, 0.0, 1.0, 1.0],
307 | 
308 |                     // The rotation behavior during a tween. (Optional property, default: 0)
309 |                     // [
310 |                     //     0: Chooses a direction of rotation that requires the least amount of turning, 
311 |                     //     1: Rotates clockwise, 
312 |                     //     -1: Rotates counterclockwise, 
313 |                     //     N: Rotates clockwise at least N-rings, 
314 |                     //     -N: Rotates counterclockwise at least N-rings
315 |                     // ]
316 |                     "clockwise": 0,
317 | 
318 |                     // The rotation of a bone in the keyframe. [-PI ~ PI] (Optional property, default: 0.0)
319 |                     "rotate": 0.0,
320 | 
321 |                     // The skew of a bone in the keyframe. [-PI ~ PI] (Optional property, default: 0.0)
322 |                     "skew": 0.0
323 |                 }],
324 | 
325 |                 // A list of the scale keyframes. (Optional property, default: null)
326 |                 "scaleFrame": [{
327 | 
328 |                     // The duration of the frame. (Optional property, default: 1)
329 |                     "duration": 1,
330 | 
331 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
332 |                     "tweenEasing": 0.0,
333 | 
334 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
335 |                     // (Optional property, default: null)
336 |                     "curve": [0.0, 0.0, 1.0, 1.0],
337 | 
338 |                     // The horizontal scale of a bone in the keyframe. (Optional property, default: 1.0)
339 |                     "x": 1.0,
340 | 
341 |                     // The vertical scale of a bone in the keyframe. (Optional property, default: 1.0)
342 |                     "y": 1.0
343 |                 }]
344 |             }],
345 | 
346 |             // A list of the slot timelines.
347 |             "slot": [{
348 | 
349 |                 // The name of the slot.
350 |                 "name": "slotName",
351 | 
352 |                 // A list of the display keyframes. (Optional property, default: null)
353 |                 "displayFrame": [{
354 | 
355 |                     // The duration of the frame. (Optional property, default: 1)
356 |                     "duration": 1,
357 | 
358 |                     // The display index of a slot in the keyframe. (Optional property, default: 1)
359 |                     "value": 0,
360 | 
361 |                     // The actions of a slot in the keyframe. (Optional property, default: null)
362 |                     "actions": [
363 |                         {
364 |                             "gotoAndPlay": "animationName"
365 |                         }
366 |                     ]
367 |                 }],
368 |                 
369 |                 // A list of the color keyframes. (Optional property, default: null)
370 |                 "colorFrame": [{
371 | 
372 |                     // The duration of the frame. (Optional property, default: 1)
373 |                     "duration": 1,
374 | 
375 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
376 |                     "tweenEasing": 0.0,
377 | 
378 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
379 |                     // (Optional property, default: null)
380 |                     "curve": [0.0, 0.0, 1.0, 1.0],
381 | 
382 |                     // The color transform of a slot in the frame. (Optional property, default: null)
383 |                     "color": {
384 |                         "aM": 100, // The alpha multiplier. [0~100] (Optional property, default: 100)
385 |                         "rM": 100, // The red multiplier. [0~100] (Optional property, default: 100)
386 |                         "gM": 100, // The green multiplier. [0~100] (Optional property, default: 100)
387 |                         "bM": 100, // The blue multiplier. [0~100] (Optional property, default: 100)
388 |                         "aO": 0, // The alpha offset. [-255~255] (Optional property, default: 0)
389 |                         "rO": 0, // The red offset. [-255~255] (Optional property, default: 0)
390 |                         "gO": 0, // The green offset. [-255~255] (Optional property, default: 0)
391 |                         "bO": 0, // The blue offset. [-255~255] (Optional property, default: 0)
392 |                     }
393 |                 }]
394 |             }],
395 | 
396 |             // A list of the FFD timelines. (Optional property, default: null)
397 |             "ffd": [{
398 | 
399 |                 // The name of the mesh.
400 |                 "name": "meshName",
401 |                 
402 |                 // The name of skin.
403 |                 "skin": "skinName",
404 | 
405 |                 // The name of slot.
406 |                 "slot": "slotName",
407 | 
408 |                 "frame": [{
409 | 
410 |                     // The duration of the frame. (Optional property, default: 1)
411 |                     "duration": 1,
412 | 
413 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
414 |                     "tweenEasing": 0.0,
415 | 
416 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
417 |                     // (Optional property, default: null)
418 |                     "curve": [0.0, 0.0, 1.0, 1.0],
419 | 
420 |                     // The number of vertices to skip before applying vertices. (Optional property, default: 0)
421 |                     "offset": 0,
422 | 
423 |                     // A list of number pairs that are the amounts to add to the setup vertex positions for the keyframe.
424 |                     // (Optional property, default: null)
425 |                     // [x0, y0, x1, y1, ...]
426 |                     "vertices": [0.1, 0.1]
427 |                 }]
428 |             }],
429 | 
430 |             // A list of the IK constraint timelines. (Optional property, default: null)
431 |             "ik": [{
432 |                 
433 |                 // The name of the IK constraint.
434 |                 "name": "meshName",
435 | 
436 |                 "frame": [{
437 | 
438 |                     // The duration of the frame. (Optional property, default: 1)
439 |                     "duration": 1,
440 | 
441 |                     // The tween easing of the frame. [0.0: Linear, null: No easing]. (Optional property, default: 0)
442 |                     "tweenEasing": 0.0,
443 | 
444 |                     // The interpolation to use between this and the next keyframe. [x1, y1, x2, y2, ...]
445 |                     // (Optional property, default: null)
446 |                     "curve": [0.0, 0.0, 1.0, 1.0],
447 | 
448 |                     // The positive direction of the IK constraint in the frame. (Optional property, default: true)
449 |                     "bendPositive": true,
450 | 
451 |                     // The weight of the IK constraint in the frame. (Optional property, default: 1.0)
452 |                     "weight": 1.0
453 |                 }]
454 |             }]
455 |         }]
456 |     }]
457 | }
458 | ```
--------------------------------------------------------------------------------
/doc/如何在 Egret 中使用 Live2D 的动画资源.md:
--------------------------------------------------------------------------------
 1 | # 如何在 Egret 中使用 Live2D 的动画资源
 2 | 
 3 | * 使用[龙骨的运行库](https://github.com/DragonBones/DragonBonesJS/tree/master/Egret/4.x/out)取代 Egret 内置的龙骨运行库。
 4 |   * 该功能稍后会正式加入 Egret 内置库。
 5 | * 使用 Live2D 2.x 版本的模型动画工具制作模型动画并导出 JSON 模型动画数据。
 6 | * 使用 [DragonBones Tools](https://github.com/DragonBones/Tools) 将 Live2D 的 JSON 动画数据转换成龙骨动画数据。
 7 | * 参考下面的例子使用转换后的龙骨动画数据。
 8 |   * [例子源码](https://github.com/DragonBones/DragonBonesJS/blob/master/Egret/Demos/src/demo/EyeTracking.ts)
 9 |   * [在线演示](https://dragonbones.github.io/demo/EyeTracking/index.html)
10 |   
11 | * 如果在开发中对该功能有任何问题或建议,请戳[这里](https://github.com/DragonBones/DragonBonesJS/issues)提交你的问题或建议。
12 | 
--------------------------------------------------------------------------------
/out/resource/helper.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
 5 |     
 6 |     
 7 |     
 8 |     
 9 |     
10 |     
11 |     
12 |     
13 |     
14 |     
24 | 
25 | 
26 | 
27 |     
28 |         
29 |     
30 |     
31 |         
32 |     
33 |     
34 |     
37 | 
38 | 
39 | 
--------------------------------------------------------------------------------
/out/resource/player/index.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |     
 5 |     
 6 |     
 7 |     
 8 |     
 9 |     
10 |     
11 |     
12 |     
13 | 
14 |     
24 | 
25 |     
26 | 
27 |     
37 | 
38 | 	
39 |     
40 | 	
41 | 	
42 | 	
43 | 	
44 | 	
45 |     
46 | 	
47 | 	
48 | 	
49 | 	
50 | 	
51 | 
52 | 
53 | 	
54 | 		
55 | 	
56 | 
57 |     
71 |     
72 |     
77 | 
78 | 
79 | 
--------------------------------------------------------------------------------
/out/resource/player/local.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |     
 5 |     
 6 |     
 7 |     
 8 |     
 9 |     
10 |     
11 |     
12 |     
13 | 
14 |     
24 | 
25 |     
26 | 
27 |     
37 | 
38 | 	
39 |     
40 | 	
41 | 	
42 | 	
43 | 	
44 | 	
45 |     
46 | 	
47 | 	
48 | 	
49 | 	
50 | 	
51 | 
52 | 
53 | 	
54 | 		
55 | 	
56 | 
57 |     
71 |     
72 |     
77 | 
78 | 
79 | 
--------------------------------------------------------------------------------
/out/resource/viewer/index.html:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  3 | 
  4 | 	
  5 | 	DragonBones Viewer
  6 | 	
  7 | 	
  8 | 	
  9 | 	
 10 | 	
 11 | 	
 12 | 	
 13 | 	
 14 |     
 15 | 
 16 | 	
 26 | 
 27 | 	
 28 | 	
 29 | 	
 30 | 	
 31 | 	
 32 | 	
 33 | 	
 34 | 	
 35 | 	
 36 | 	
 37 | 	
 38 | 	
 39 | 	
 40 | 	
 41 | 	
 42 | 	
 43 | 	
 44 | 	
 45 | 
 46 | 
 47 | 	
 48 | 		
 49 | 		
 50 | 		

 51 | 	
 69 | 		
 70 | 			 71 |
 71 | 		
 72 | 
 73 | 		
 74 | 			
 75 | 				

 76 | 				
 79 | 			
 80 | 			
 81 | 				

 82 | 				
 85 | 			
 86 | 			
 87 | 				

 88 | 				
 91 | 			
 92 | 			
 93 | 				

 94 | 				
 97 | 			
 98 | 		
 99 | 		
100 | 		
101 | 			
102 | 				
105 | 				
108 | 				
113 | 				
116 | 				
117 | 					
X 1.00
118 | 					
119 | 					
120 | 				
121 | 			
122 | 		
123 | 
124 | 		
125 | 			
Background Color
126 | 			
127 | 				
128 | 				
129 | 				
130 | 				
131 | 				
132 | 			
133 | 			
134 | 				
Show Grid
135 | 				
138 | 			
139 | 			
140 | 				
Show Bone
141 | 				
144 | 			
145 | 		
146 | 
147 | 		
148 | 		
149 | 
150 | 		
153 | 	
 48 | 		
 49 | 		
 50 | 		

 51 | 	
 69 | 		
 70 | 			 71 |
 71 | 		
 72 | 
 73 | 		
 74 | 			
 75 | 				

 76 | 				
 79 | 			
 80 | 			
 81 | 				

 82 | 				
 85 | 			
 86 | 			
 87 | 				

 88 | 				
 91 | 			
 92 | 			
 93 | 				

 94 | 				
 97 | 			
 98 | 		
 99 | 		
100 | 		
101 | 			
102 | 				
105 | 				
108 | 				
113 | 				
116 | 				
117 | 					
X 1.00
118 | 					
119 | 					
120 | 				
121 | 			
122 | 		
123 | 
124 | 		
125 | 			
Background Color
126 | 			
127 | 				
128 | 				
129 | 				
130 | 				
131 | 				
132 | 			
133 | 			
134 | 				
Show Grid
135 | 				
138 | 			
139 | 			
140 | 				
Show Bone
141 | 				
144 | 			
145 | 		
146 | 
147 | 		
148 | 		
149 | 
150 | 		
153 |