@haiyue/animation-spec 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/SPECIFICATION.md +108 -0
- package/bin/hya-convert.mjs +31 -0
- package/dist/binary.d.ts +7 -0
- package/dist/chunks/types-l6nBVYwx.js +8 -0
- package/dist/chunks/types-l6nBVYwx.js.map +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/extensions.d.ts +19 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2927 -0
- package/dist/index.js.map +1 -0
- package/dist/lottie-merge-path.d.ts +11 -0
- package/dist/lottie.d.ts +62 -0
- package/dist/lottie.js +2642 -0
- package/dist/lottie.js.map +1 -0
- package/dist/native3d/Animation3DError.d.ts +8 -0
- package/dist/native3d/Animation3DParser.d.ts +7 -0
- package/dist/native3d/Animation3DTypes.d.ts +285 -0
- package/dist/native3d/index.d.ts +5 -0
- package/dist/native3d.d.ts +2 -0
- package/dist/native3d.js +907 -0
- package/dist/native3d.js.map +1 -0
- package/dist/parser.d.ts +2 -0
- package/dist/state-machine.d.ts +130 -0
- package/dist/text-selector.d.ts +2 -0
- package/dist/types.d.ts +419 -0
- package/dist/validation.d.ts +32 -0
- package/package.json +69 -0
- package/schema/animation-3d-carrier.schema.json +73 -0
- package/schema/animation-3d-extension.schema.json +573 -0
- package/schema/animation-3d.contract.json +130 -0
- package/schema/animation.schema.json +611 -0
- package/schema/fixtures/native-3d-mixed-invalid.hya.json +50 -0
- package/schema/fixtures/native-3d-valid.hya.json +284 -0
- package/src/binary.ts +1441 -0
- package/src/errors.ts +18 -0
- package/src/extensions.ts +55 -0
- package/src/index.ts +90 -0
- package/src/lottie-merge-path.ts +204 -0
- package/src/lottie.ts +3073 -0
- package/src/native3d/Animation3DError.ts +20 -0
- package/src/native3d/Animation3DParser.ts +964 -0
- package/src/native3d/Animation3DTypes.ts +322 -0
- package/src/native3d/index.ts +14 -0
- package/src/native3d.ts +2 -0
- package/src/parser.ts +41 -0
- package/src/state-machine.ts +645 -0
- package/src/text-selector.ts +7 -0
- package/src/types.ts +483 -0
- package/src/validation.ts +1286 -0
- package/test/fixtures/basic-lottie.json +31 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://haiyue.dev/schema/animation/extension/animation-3d/1.json",
|
|
4
|
+
"title": "Haiyue native 3D animation extension payload v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["format", "mode", "coordinateSystem", "viewport", "materials", "nodes", "clips"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"format": { "const": "haiyue-animation-3d@1" },
|
|
9
|
+
"mode": { "const": "native-3d" },
|
|
10
|
+
"coordinateSystem": { "$ref": "#/$defs/coordinateSystem" },
|
|
11
|
+
"viewport": { "$ref": "#/$defs/viewport" },
|
|
12
|
+
"materials": { "type": "array", "items": { "$ref": "#/$defs/material" } },
|
|
13
|
+
"nodes": { "type": "array", "items": { "$ref": "#/$defs/node" } },
|
|
14
|
+
"clips": { "type": "array", "items": { "$ref": "#/$defs/clip" } },
|
|
15
|
+
"stateMachine": {
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{ "type": "null" },
|
|
18
|
+
{ "$ref": "#/$defs/stateMachine" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"$defs": {
|
|
24
|
+
"coordinateSystem": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": ["handedness", "upAxis", "forwardAxis", "unit", "angles", "rotationStorage"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"handedness": { "const": "right" },
|
|
29
|
+
"upAxis": { "const": "+y" },
|
|
30
|
+
"forwardAxis": { "const": "-z" },
|
|
31
|
+
"unit": { "const": "meter" },
|
|
32
|
+
"angles": { "const": "radian" },
|
|
33
|
+
"rotationStorage": { "const": "normalized-xyzw-quaternion" }
|
|
34
|
+
},
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
},
|
|
37
|
+
"viewport": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["width", "height"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
42
|
+
"height": { "type": "number", "exclusiveMinimum": 0 }
|
|
43
|
+
},
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
},
|
|
46
|
+
"vec2": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"prefixItems": [{ "type": "number" }, { "type": "number" }],
|
|
49
|
+
"minItems": 2,
|
|
50
|
+
"maxItems": 2
|
|
51
|
+
},
|
|
52
|
+
"vec3": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"prefixItems": [{ "type": "number" }, { "type": "number" }, { "type": "number" }],
|
|
55
|
+
"minItems": 3,
|
|
56
|
+
"maxItems": 3
|
|
57
|
+
},
|
|
58
|
+
"nonNegativeVec3": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"prefixItems": [
|
|
61
|
+
{ "type": "number", "minimum": 0 },
|
|
62
|
+
{ "type": "number", "minimum": 0 },
|
|
63
|
+
{ "type": "number", "minimum": 0 }
|
|
64
|
+
],
|
|
65
|
+
"minItems": 3,
|
|
66
|
+
"maxItems": 3
|
|
67
|
+
},
|
|
68
|
+
"vec4": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"prefixItems": [{ "type": "number" }, { "type": "number" }, { "type": "number" }, { "type": "number" }],
|
|
71
|
+
"minItems": 4,
|
|
72
|
+
"maxItems": 4
|
|
73
|
+
},
|
|
74
|
+
"color3": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": { "type": "number", "minimum": 0 },
|
|
77
|
+
"minItems": 3,
|
|
78
|
+
"maxItems": 3
|
|
79
|
+
},
|
|
80
|
+
"color4": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
83
|
+
"minItems": 4,
|
|
84
|
+
"maxItems": 4
|
|
85
|
+
},
|
|
86
|
+
"range": {
|
|
87
|
+
"oneOf": [
|
|
88
|
+
{ "type": "number" },
|
|
89
|
+
{
|
|
90
|
+
"type": "array",
|
|
91
|
+
"prefixItems": [{ "type": "number" }, { "type": "number" }],
|
|
92
|
+
"minItems": 2,
|
|
93
|
+
"maxItems": 2
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"transform": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"required": ["translation", "rotation", "scale"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"translation": { "$ref": "#/$defs/vec3" },
|
|
102
|
+
"rotation": { "$ref": "#/$defs/vec4" },
|
|
103
|
+
"scale": { "$ref": "#/$defs/vec3" }
|
|
104
|
+
},
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
},
|
|
107
|
+
"material": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"required": ["id", "name", "baseColorFactor", "metallicFactor", "roughnessFactor", "emissiveFactor", "alphaMode", "doubleSided"],
|
|
110
|
+
"properties": {
|
|
111
|
+
"id": { "type": "string", "minLength": 1 },
|
|
112
|
+
"name": { "type": "string" },
|
|
113
|
+
"baseColorFactor": { "$ref": "#/$defs/color4" },
|
|
114
|
+
"metallicFactor": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
115
|
+
"roughnessFactor": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
116
|
+
"emissiveFactor": { "$ref": "#/$defs/color3" },
|
|
117
|
+
"alphaMode": { "enum": ["opaque", "mask", "blend"] },
|
|
118
|
+
"alphaCutoff": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
119
|
+
"doubleSided": { "type": "boolean" },
|
|
120
|
+
"baseColorTexture": { "type": "string", "minLength": 1 },
|
|
121
|
+
"normalTexture": { "type": "string", "minLength": 1 },
|
|
122
|
+
"metallicRoughnessTexture": { "type": "string", "minLength": 1 },
|
|
123
|
+
"emissiveTexture": { "type": "string", "minLength": 1 }
|
|
124
|
+
},
|
|
125
|
+
"additionalProperties": false
|
|
126
|
+
},
|
|
127
|
+
"camera": {
|
|
128
|
+
"oneOf": [
|
|
129
|
+
{
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["kind", "fovYRadians", "near", "far"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"kind": { "const": "perspective" },
|
|
134
|
+
"fovYRadians": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793 },
|
|
135
|
+
"near": { "type": "number", "exclusiveMinimum": 0 },
|
|
136
|
+
"far": { "type": "number", "exclusiveMinimum": 0 }
|
|
137
|
+
},
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "object",
|
|
142
|
+
"required": ["kind", "orthoHeight", "near", "far"],
|
|
143
|
+
"properties": {
|
|
144
|
+
"kind": { "const": "orthographic" },
|
|
145
|
+
"orthoHeight": { "type": "number", "exclusiveMinimum": 0 },
|
|
146
|
+
"near": { "type": "number", "minimum": 0 },
|
|
147
|
+
"far": { "type": "number", "exclusiveMinimum": 0 }
|
|
148
|
+
},
|
|
149
|
+
"additionalProperties": false
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"particle": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"required": ["maxParticles", "emissionRate", "burst", "duration", "loop", "seed", "lifetime", "speed", "direction", "spread", "gravity", "startSize", "endSize", "rotation", "angularVelocity", "startColor", "endColor", "shape", "blendMode", "radial", "opacity", "depthTest", "depthWrite", "sortMode"],
|
|
156
|
+
"properties": {
|
|
157
|
+
"maxParticles": { "type": "integer", "minimum": 1, "maximum": 1000000 },
|
|
158
|
+
"emissionRate": { "type": "number", "minimum": 0 },
|
|
159
|
+
"burst": { "type": "integer", "minimum": 0 },
|
|
160
|
+
"duration": { "type": "number", "exclusiveMinimum": 0 },
|
|
161
|
+
"loop": { "type": "boolean" },
|
|
162
|
+
"seed": { "type": "integer" },
|
|
163
|
+
"lifetime": { "$ref": "#/$defs/range" },
|
|
164
|
+
"speed": { "$ref": "#/$defs/range" },
|
|
165
|
+
"direction": { "$ref": "#/$defs/vec3" },
|
|
166
|
+
"spread": { "type": "number", "minimum": 0, "maximum": 3.141592653589793 },
|
|
167
|
+
"gravity": { "$ref": "#/$defs/vec3" },
|
|
168
|
+
"startSize": { "$ref": "#/$defs/range" },
|
|
169
|
+
"endSize": { "$ref": "#/$defs/range" },
|
|
170
|
+
"rotation": { "$ref": "#/$defs/range" },
|
|
171
|
+
"angularVelocity": { "$ref": "#/$defs/range" },
|
|
172
|
+
"startColor": { "$ref": "#/$defs/color4" },
|
|
173
|
+
"endColor": { "$ref": "#/$defs/color4" },
|
|
174
|
+
"shape": { "enum": ["point", "box", "sphere"] },
|
|
175
|
+
"shapeSize": { "$ref": "#/$defs/nonNegativeVec3" },
|
|
176
|
+
"shapeRadius": { "type": "number", "minimum": 0 },
|
|
177
|
+
"blendMode": { "enum": ["normal", "additive"] },
|
|
178
|
+
"textureResource": { "type": "string", "minLength": 1 },
|
|
179
|
+
"radial": { "type": "boolean" },
|
|
180
|
+
"opacity": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
181
|
+
"depthTest": { "type": "boolean" },
|
|
182
|
+
"depthWrite": { "type": "boolean" },
|
|
183
|
+
"sortMode": { "enum": ["none", "back-to-front"] }
|
|
184
|
+
},
|
|
185
|
+
"additionalProperties": false
|
|
186
|
+
},
|
|
187
|
+
"component": {
|
|
188
|
+
"oneOf": [
|
|
189
|
+
{
|
|
190
|
+
"type": "object",
|
|
191
|
+
"required": ["id", "kind", "projection"],
|
|
192
|
+
"properties": {
|
|
193
|
+
"id": { "type": "string", "minLength": 1 },
|
|
194
|
+
"kind": { "const": "camera3d" },
|
|
195
|
+
"projection": { "$ref": "#/$defs/camera" }
|
|
196
|
+
},
|
|
197
|
+
"additionalProperties": false
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "object",
|
|
201
|
+
"required": ["id", "kind", "primitive", "materialId"],
|
|
202
|
+
"properties": {
|
|
203
|
+
"id": { "type": "string", "minLength": 1 },
|
|
204
|
+
"kind": { "const": "primitive3d" },
|
|
205
|
+
"primitive": { "enum": ["box", "sphere", "plane", "cylinder", "cone"] },
|
|
206
|
+
"materialId": { "type": "string", "minLength": 1 }
|
|
207
|
+
},
|
|
208
|
+
"additionalProperties": false
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "object",
|
|
212
|
+
"required": ["id", "kind", "resource"],
|
|
213
|
+
"properties": {
|
|
214
|
+
"id": { "type": "string", "minLength": 1 },
|
|
215
|
+
"kind": { "const": "model3d" },
|
|
216
|
+
"resource": { "type": "string", "minLength": 1 },
|
|
217
|
+
"materialOverrides": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"required": ["slot", "materialId"],
|
|
222
|
+
"properties": {
|
|
223
|
+
"slot": { "type": "string", "minLength": 1 },
|
|
224
|
+
"materialId": { "type": "string", "minLength": 1 }
|
|
225
|
+
},
|
|
226
|
+
"additionalProperties": false
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"additionalProperties": false
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"type": "object",
|
|
234
|
+
"required": ["id", "kind", "descriptor"],
|
|
235
|
+
"properties": {
|
|
236
|
+
"id": { "type": "string", "minLength": 1 },
|
|
237
|
+
"kind": { "const": "particle3d" },
|
|
238
|
+
"descriptor": { "$ref": "#/$defs/particle" }
|
|
239
|
+
},
|
|
240
|
+
"additionalProperties": false
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"node": {
|
|
245
|
+
"type": "object",
|
|
246
|
+
"required": ["id", "name", "transform", "components"],
|
|
247
|
+
"properties": {
|
|
248
|
+
"id": { "type": "string", "minLength": 1 },
|
|
249
|
+
"name": { "type": "string" },
|
|
250
|
+
"parent": { "type": "string", "minLength": 1 },
|
|
251
|
+
"start": { "type": "number", "minimum": 0 },
|
|
252
|
+
"duration": { "type": "number", "exclusiveMinimum": 0 },
|
|
253
|
+
"transform": { "$ref": "#/$defs/transform" },
|
|
254
|
+
"components": { "type": "array", "items": { "$ref": "#/$defs/component" } }
|
|
255
|
+
},
|
|
256
|
+
"additionalProperties": false
|
|
257
|
+
},
|
|
258
|
+
"bindingTarget": {
|
|
259
|
+
"oneOf": [
|
|
260
|
+
{
|
|
261
|
+
"type": "object",
|
|
262
|
+
"required": ["kind", "nodeId"],
|
|
263
|
+
"properties": {
|
|
264
|
+
"kind": { "const": "node-id" },
|
|
265
|
+
"nodeId": { "type": "string", "minLength": 1 }
|
|
266
|
+
},
|
|
267
|
+
"additionalProperties": false
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"type": "object",
|
|
271
|
+
"required": ["kind", "segments"],
|
|
272
|
+
"properties": {
|
|
273
|
+
"kind": { "const": "node-path" },
|
|
274
|
+
"segments": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }
|
|
275
|
+
},
|
|
276
|
+
"additionalProperties": false
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"type": "object",
|
|
280
|
+
"required": ["kind", "slot"],
|
|
281
|
+
"properties": {
|
|
282
|
+
"kind": { "const": "slot" },
|
|
283
|
+
"slot": { "type": "string", "minLength": 1 }
|
|
284
|
+
},
|
|
285
|
+
"additionalProperties": false
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"binding": {
|
|
290
|
+
"oneOf": [
|
|
291
|
+
{
|
|
292
|
+
"type": "object",
|
|
293
|
+
"required": ["id", "target", "path", "valueType", "valueSize"],
|
|
294
|
+
"properties": {
|
|
295
|
+
"id": { "type": "string", "minLength": 1 },
|
|
296
|
+
"target": { "$ref": "#/$defs/bindingTarget" },
|
|
297
|
+
"path": { "const": "transform.translation" },
|
|
298
|
+
"valueType": { "const": "vec3" },
|
|
299
|
+
"valueSize": { "const": 3 }
|
|
300
|
+
},
|
|
301
|
+
"additionalProperties": false
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"type": "object",
|
|
305
|
+
"required": ["id", "target", "path", "valueType", "valueSize"],
|
|
306
|
+
"properties": {
|
|
307
|
+
"id": { "type": "string", "minLength": 1 },
|
|
308
|
+
"target": { "$ref": "#/$defs/bindingTarget" },
|
|
309
|
+
"path": { "const": "transform.rotation" },
|
|
310
|
+
"valueType": { "const": "quaternion" },
|
|
311
|
+
"valueSize": { "const": 4 }
|
|
312
|
+
},
|
|
313
|
+
"additionalProperties": false
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"type": "object",
|
|
317
|
+
"required": ["id", "target", "path", "valueType", "valueSize"],
|
|
318
|
+
"properties": {
|
|
319
|
+
"id": { "type": "string", "minLength": 1 },
|
|
320
|
+
"target": { "$ref": "#/$defs/bindingTarget" },
|
|
321
|
+
"path": { "const": "transform.scale" },
|
|
322
|
+
"valueType": { "const": "vec3" },
|
|
323
|
+
"valueSize": { "const": 3 }
|
|
324
|
+
},
|
|
325
|
+
"additionalProperties": false
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"type": "object",
|
|
329
|
+
"required": ["id", "target", "path", "valueType", "valueSize"],
|
|
330
|
+
"properties": {
|
|
331
|
+
"id": { "type": "string", "minLength": 1 },
|
|
332
|
+
"target": { "$ref": "#/$defs/bindingTarget" },
|
|
333
|
+
"path": { "const": "morph.weights" },
|
|
334
|
+
"valueType": { "const": "weights" },
|
|
335
|
+
"valueSize": { "type": "integer", "minimum": 1 }
|
|
336
|
+
},
|
|
337
|
+
"additionalProperties": false
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"type": "object",
|
|
341
|
+
"required": ["id", "target", "path", "component", "property", "valueType", "valueSize"],
|
|
342
|
+
"properties": {
|
|
343
|
+
"id": { "type": "string", "minLength": 1 },
|
|
344
|
+
"target": { "$ref": "#/$defs/bindingTarget" },
|
|
345
|
+
"path": { "const": "property" },
|
|
346
|
+
"component": { "enum": ["material3d", "camera3d"] },
|
|
347
|
+
"property": { "enum": ["baseColorFactor", "metallicFactor", "roughnessFactor", "emissiveFactor", "alphaCutoff", "fovYRadians", "near", "far", "orthoHeight"] },
|
|
348
|
+
"valueType": { "enum": ["scalar", "vec3", "vec4"] },
|
|
349
|
+
"valueSize": { "enum": [1, 3, 4] }
|
|
350
|
+
},
|
|
351
|
+
"additionalProperties": false
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
},
|
|
355
|
+
"track": {
|
|
356
|
+
"type": "object",
|
|
357
|
+
"required": ["id", "binding", "interpolation", "times", "values"],
|
|
358
|
+
"properties": {
|
|
359
|
+
"id": { "type": "string", "minLength": 1 },
|
|
360
|
+
"binding": { "$ref": "#/$defs/binding" },
|
|
361
|
+
"interpolation": { "enum": ["step", "linear", "cubic-spline"] },
|
|
362
|
+
"times": { "type": "array", "minItems": 1, "items": { "type": "number", "minimum": 0 } },
|
|
363
|
+
"values": { "type": "array", "minItems": 1, "items": { "type": "number" } }
|
|
364
|
+
},
|
|
365
|
+
"additionalProperties": false
|
|
366
|
+
},
|
|
367
|
+
"event": {
|
|
368
|
+
"type": "object",
|
|
369
|
+
"required": ["id", "time", "name"],
|
|
370
|
+
"properties": {
|
|
371
|
+
"id": { "type": "string", "minLength": 1 },
|
|
372
|
+
"time": { "type": "number", "minimum": 0 },
|
|
373
|
+
"name": { "type": "string", "minLength": 1 },
|
|
374
|
+
"payload": { "type": "object" }
|
|
375
|
+
},
|
|
376
|
+
"additionalProperties": false
|
|
377
|
+
},
|
|
378
|
+
"clip": {
|
|
379
|
+
"type": "object",
|
|
380
|
+
"required": ["format", "id", "name", "duration", "tracks", "events"],
|
|
381
|
+
"properties": {
|
|
382
|
+
"format": { "const": "haiyue-animation3d-clip@1" },
|
|
383
|
+
"id": { "type": "string", "minLength": 1 },
|
|
384
|
+
"name": { "type": "string" },
|
|
385
|
+
"duration": { "type": "number", "exclusiveMinimum": 0 },
|
|
386
|
+
"tracks": { "type": "array", "items": { "$ref": "#/$defs/track" } },
|
|
387
|
+
"events": { "type": "array", "items": { "$ref": "#/$defs/event" } }
|
|
388
|
+
},
|
|
389
|
+
"additionalProperties": false
|
|
390
|
+
},
|
|
391
|
+
"parameter": {
|
|
392
|
+
"oneOf": [
|
|
393
|
+
{
|
|
394
|
+
"type": "object",
|
|
395
|
+
"required": ["name", "type", "defaultValue"],
|
|
396
|
+
"properties": {
|
|
397
|
+
"name": { "type": "string", "minLength": 1 },
|
|
398
|
+
"type": { "const": "float" },
|
|
399
|
+
"defaultValue": { "type": "number" }
|
|
400
|
+
},
|
|
401
|
+
"additionalProperties": false
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"type": "object",
|
|
405
|
+
"required": ["name", "type", "defaultValue"],
|
|
406
|
+
"properties": {
|
|
407
|
+
"name": { "type": "string", "minLength": 1 },
|
|
408
|
+
"type": { "const": "integer" },
|
|
409
|
+
"defaultValue": { "type": "integer" }
|
|
410
|
+
},
|
|
411
|
+
"additionalProperties": false
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"type": "object",
|
|
415
|
+
"required": ["name", "type", "defaultValue"],
|
|
416
|
+
"properties": {
|
|
417
|
+
"name": { "type": "string", "minLength": 1 },
|
|
418
|
+
"type": { "const": "boolean" },
|
|
419
|
+
"defaultValue": { "type": "boolean" }
|
|
420
|
+
},
|
|
421
|
+
"additionalProperties": false
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "object",
|
|
425
|
+
"required": ["name", "type"],
|
|
426
|
+
"properties": {
|
|
427
|
+
"name": { "type": "string", "minLength": 1 },
|
|
428
|
+
"type": { "const": "trigger" }
|
|
429
|
+
},
|
|
430
|
+
"additionalProperties": false
|
|
431
|
+
}
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
"motion": {
|
|
435
|
+
"oneOf": [
|
|
436
|
+
{
|
|
437
|
+
"type": "object",
|
|
438
|
+
"required": ["kind", "clipId"],
|
|
439
|
+
"properties": {
|
|
440
|
+
"kind": { "const": "clip" },
|
|
441
|
+
"clipId": { "type": "string", "minLength": 1 }
|
|
442
|
+
},
|
|
443
|
+
"additionalProperties": false
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"type": "object",
|
|
447
|
+
"required": ["kind", "parameter", "children"],
|
|
448
|
+
"properties": {
|
|
449
|
+
"kind": { "const": "blend-1d" },
|
|
450
|
+
"parameter": { "type": "string", "minLength": 1 },
|
|
451
|
+
"children": {
|
|
452
|
+
"type": "array",
|
|
453
|
+
"minItems": 1,
|
|
454
|
+
"items": {
|
|
455
|
+
"type": "object",
|
|
456
|
+
"required": ["threshold", "motion"],
|
|
457
|
+
"properties": {
|
|
458
|
+
"threshold": { "type": "number" },
|
|
459
|
+
"motion": { "$ref": "#/$defs/motion" }
|
|
460
|
+
},
|
|
461
|
+
"additionalProperties": false
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"additionalProperties": false
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"type": "object",
|
|
469
|
+
"required": ["kind", "algorithm", "parameterX", "parameterY", "children"],
|
|
470
|
+
"properties": {
|
|
471
|
+
"kind": { "const": "blend-2d" },
|
|
472
|
+
"algorithm": { "enum": ["cartesian", "directional"] },
|
|
473
|
+
"parameterX": { "type": "string", "minLength": 1 },
|
|
474
|
+
"parameterY": { "type": "string", "minLength": 1 },
|
|
475
|
+
"children": {
|
|
476
|
+
"type": "array",
|
|
477
|
+
"minItems": 1,
|
|
478
|
+
"items": {
|
|
479
|
+
"type": "object",
|
|
480
|
+
"required": ["position", "motion"],
|
|
481
|
+
"properties": {
|
|
482
|
+
"position": { "$ref": "#/$defs/vec2" },
|
|
483
|
+
"motion": { "$ref": "#/$defs/motion" }
|
|
484
|
+
},
|
|
485
|
+
"additionalProperties": false
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"additionalProperties": false
|
|
490
|
+
}
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
"condition": {
|
|
494
|
+
"type": "object",
|
|
495
|
+
"required": ["parameter", "operator"],
|
|
496
|
+
"properties": {
|
|
497
|
+
"parameter": { "type": "string", "minLength": 1 },
|
|
498
|
+
"operator": { "enum": ["greater", "greater-or-equal", "less", "less-or-equal", "equal", "not-equal", "is-true", "is-false", "triggered"] },
|
|
499
|
+
"value": { "oneOf": [{ "type": "number" }, { "type": "boolean" }] }
|
|
500
|
+
},
|
|
501
|
+
"additionalProperties": false
|
|
502
|
+
},
|
|
503
|
+
"stateMachine": {
|
|
504
|
+
"type": "object",
|
|
505
|
+
"required": ["format", "id", "name", "parameters", "layers"],
|
|
506
|
+
"properties": {
|
|
507
|
+
"format": { "const": "haiyue-animation3d-state-machine@1" },
|
|
508
|
+
"id": { "type": "string", "minLength": 1 },
|
|
509
|
+
"name": { "type": "string" },
|
|
510
|
+
"parameters": { "type": "array", "items": { "$ref": "#/$defs/parameter" } },
|
|
511
|
+
"layers": {
|
|
512
|
+
"type": "array",
|
|
513
|
+
"items": {
|
|
514
|
+
"type": "object",
|
|
515
|
+
"required": ["id", "name", "initialStateId", "states", "transitions"],
|
|
516
|
+
"properties": {
|
|
517
|
+
"id": { "type": "string", "minLength": 1 },
|
|
518
|
+
"name": { "type": "string" },
|
|
519
|
+
"initialStateId": { "type": "string", "minLength": 1 },
|
|
520
|
+
"states": {
|
|
521
|
+
"type": "array",
|
|
522
|
+
"items": {
|
|
523
|
+
"type": "object",
|
|
524
|
+
"required": ["id", "name", "motion"],
|
|
525
|
+
"properties": {
|
|
526
|
+
"id": { "type": "string", "minLength": 1 },
|
|
527
|
+
"name": { "type": "string" },
|
|
528
|
+
"motion": { "$ref": "#/$defs/motion" },
|
|
529
|
+
"speed": { "type": "number" },
|
|
530
|
+
"speedParameter": { "type": "string", "minLength": 1 },
|
|
531
|
+
"loop": { "enum": ["once", "repeat", "ping-pong"] }
|
|
532
|
+
},
|
|
533
|
+
"additionalProperties": false
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
"transitions": {
|
|
537
|
+
"type": "array",
|
|
538
|
+
"items": {
|
|
539
|
+
"type": "object",
|
|
540
|
+
"required": ["id", "from", "to", "conditions", "duration"],
|
|
541
|
+
"properties": {
|
|
542
|
+
"id": { "type": "string", "minLength": 1 },
|
|
543
|
+
"from": { "type": "string", "minLength": 1 },
|
|
544
|
+
"to": { "type": "string", "minLength": 1 },
|
|
545
|
+
"conditions": { "type": "array", "items": { "$ref": "#/$defs/condition" } },
|
|
546
|
+
"duration": { "type": "number", "minimum": 0 },
|
|
547
|
+
"hasExitTime": { "type": "boolean" },
|
|
548
|
+
"exitTime": { "type": "number", "minimum": 0 },
|
|
549
|
+
"destinationOffset": { "type": "number", "minimum": 0 },
|
|
550
|
+
"interruption": { "enum": ["none", "source", "destination", "source-then-destination", "destination-then-source"] }
|
|
551
|
+
},
|
|
552
|
+
"additionalProperties": false
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
"blendMode": { "enum": ["override", "additive"] },
|
|
556
|
+
"weight": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
557
|
+
"mask": {
|
|
558
|
+
"type": "object",
|
|
559
|
+
"properties": {
|
|
560
|
+
"include": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
561
|
+
"exclude": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }
|
|
562
|
+
},
|
|
563
|
+
"additionalProperties": false
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
"additionalProperties": false
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"additionalProperties": false
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|