@vvfx/ge-ir 0.0.1-beta.4 → 0.0.1-beta.5
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/dist/index.js +961 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +931 -13
- package/dist/index.mjs.map +1 -1
- package/dist/ir2ge/assembly/generator.d.ts +2 -2
- package/dist/shared/json-value.d.ts +2 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
* Description: Galacean Effects and animation IR bidirectional conversion package
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 澄弈
|
|
6
|
-
* Version: v0.0.1-beta.
|
|
6
|
+
* Version: v0.0.1-beta.5
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
11
|
var animationIr = require('@vvfx/animation-ir');
|
|
12
12
|
var uuid = require('uuid');
|
|
13
|
-
var effectsSpecification = require('@galacean/effects-specification');
|
|
14
13
|
|
|
15
14
|
function _extends() {
|
|
16
15
|
_extends = Object.assign || function assign(target) {
|
|
@@ -260,6 +259,878 @@ function buildSubCompositionTrack(collector, delay, duration, endBehavior) {
|
|
|
260
259
|
return trackId;
|
|
261
260
|
}
|
|
262
261
|
|
|
262
|
+
/**
|
|
263
|
+
* JSON 版本
|
|
264
|
+
*/ var JSONSceneVersion;
|
|
265
|
+
(function(JSONSceneVersion) {
|
|
266
|
+
JSONSceneVersion["1_0"] = "1.0";
|
|
267
|
+
JSONSceneVersion["1_1"] = "1.1";
|
|
268
|
+
JSONSceneVersion["1_2"] = "1.2";
|
|
269
|
+
JSONSceneVersion["1_3"] = "1.3";
|
|
270
|
+
JSONSceneVersion["1_5"] = "1.5";
|
|
271
|
+
JSONSceneVersion["1_8"] = "1.8";
|
|
272
|
+
JSONSceneVersion["2_0"] = "2.0";
|
|
273
|
+
JSONSceneVersion["2_1"] = "2.1";
|
|
274
|
+
JSONSceneVersion["2_2"] = "2.2";
|
|
275
|
+
JSONSceneVersion["2_3"] = "2.3";
|
|
276
|
+
JSONSceneVersion["2_4"] = "2.4";
|
|
277
|
+
JSONSceneVersion["3_0"] = "3.0";
|
|
278
|
+
JSONSceneVersion["3_1"] = "3.1";
|
|
279
|
+
JSONSceneVersion["3_2"] = "3.2";
|
|
280
|
+
JSONSceneVersion["3_3"] = "3.3";
|
|
281
|
+
JSONSceneVersion["3_4"] = "3.4";
|
|
282
|
+
JSONSceneVersion["3_5"] = "3.5";
|
|
283
|
+
JSONSceneVersion["3_6"] = "3.6";
|
|
284
|
+
JSONSceneVersion["3_7"] = "3.7";
|
|
285
|
+
JSONSceneVersion["LATEST"] = "3.7";
|
|
286
|
+
})(JSONSceneVersion || (JSONSceneVersion = {}));
|
|
287
|
+
|
|
288
|
+
/*********************************************/ /* 元素属性参数类型 */ /*********************************************/ /**
|
|
289
|
+
* 渲染等级
|
|
290
|
+
*/ var RenderLevel;
|
|
291
|
+
(function(RenderLevel) {
|
|
292
|
+
RenderLevel["S"] = "S";
|
|
293
|
+
RenderLevel["APlus"] = "A+";
|
|
294
|
+
RenderLevel["A"] = "A";
|
|
295
|
+
RenderLevel["BPlus"] = "B+";
|
|
296
|
+
RenderLevel["B"] = "B";
|
|
297
|
+
})(RenderLevel || (RenderLevel = {}));
|
|
298
|
+
/**
|
|
299
|
+
* 混合模式
|
|
300
|
+
*/ var BlendingMode;
|
|
301
|
+
(function(BlendingMode) {
|
|
302
|
+
/**
|
|
303
|
+
* 普通混合模式
|
|
304
|
+
*/ BlendingMode[BlendingMode["ALPHA"] = 0] = "ALPHA";
|
|
305
|
+
/**
|
|
306
|
+
* 叠加混合模式
|
|
307
|
+
*/ BlendingMode[BlendingMode["ADD"] = 1] = "ADD";
|
|
308
|
+
/**
|
|
309
|
+
* 相乘混合模式
|
|
310
|
+
*/ BlendingMode[BlendingMode["MULTIPLY"] = 2] = "MULTIPLY";
|
|
311
|
+
/**
|
|
312
|
+
* 亮度混合模式
|
|
313
|
+
*/ BlendingMode[BlendingMode["BRIGHTNESS"] = 3] = "BRIGHTNESS";
|
|
314
|
+
/**
|
|
315
|
+
* 减色混合模式
|
|
316
|
+
*/ BlendingMode[BlendingMode["SUBTRACTION"] = 4] = "SUBTRACTION";
|
|
317
|
+
/**
|
|
318
|
+
* 强光混合模式
|
|
319
|
+
*/ BlendingMode[BlendingMode["STRONG_LIGHT"] = 5] = "STRONG_LIGHT";
|
|
320
|
+
/**
|
|
321
|
+
* 弱光混合模式
|
|
322
|
+
*/ BlendingMode[BlendingMode["WEAK_LIGHT"] = 6] = "WEAK_LIGHT";
|
|
323
|
+
/**
|
|
324
|
+
* 亮度叠加混合模式
|
|
325
|
+
*/ BlendingMode[BlendingMode["SUPERPOSITION"] = 7] = "SUPERPOSITION";
|
|
326
|
+
})(BlendingMode || (BlendingMode = {}));
|
|
327
|
+
/**
|
|
328
|
+
* 单双面模式
|
|
329
|
+
*/ var SideMode;
|
|
330
|
+
(function(SideMode) {
|
|
331
|
+
/**
|
|
332
|
+
* 双面模式
|
|
333
|
+
*/ SideMode[SideMode["DOUBLE"] = 1032] = "DOUBLE";
|
|
334
|
+
/**
|
|
335
|
+
* 正面模式
|
|
336
|
+
*/ SideMode[SideMode["FRONT"] = 1028] = "FRONT";
|
|
337
|
+
/**
|
|
338
|
+
* 背面模式
|
|
339
|
+
*/ SideMode[SideMode["BACK"] = 1029] = "BACK";
|
|
340
|
+
})(SideMode || (SideMode = {}));
|
|
341
|
+
/**
|
|
342
|
+
* 元素是否被蒙版遮挡/反向遮挡
|
|
343
|
+
*/ var ObscuredMode;
|
|
344
|
+
(function(ObscuredMode) {
|
|
345
|
+
/**
|
|
346
|
+
* 无
|
|
347
|
+
*/ // NONE = 0,
|
|
348
|
+
// /**
|
|
349
|
+
// * 蒙版
|
|
350
|
+
// */
|
|
351
|
+
// MASK = 1,
|
|
352
|
+
/**
|
|
353
|
+
* 被遮挡
|
|
354
|
+
*/ ObscuredMode[ObscuredMode["OBSCURED"] = 2] = "OBSCURED";
|
|
355
|
+
/**
|
|
356
|
+
* 被反向遮挡
|
|
357
|
+
*/ ObscuredMode[ObscuredMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
|
|
358
|
+
})(ObscuredMode || (ObscuredMode = {}));
|
|
359
|
+
/**
|
|
360
|
+
* 发射器形状
|
|
361
|
+
*/ var ParticleEmitterShapeType;
|
|
362
|
+
(function(ParticleEmitterShapeType) {
|
|
363
|
+
/**
|
|
364
|
+
* 没有类型
|
|
365
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
|
|
366
|
+
/**
|
|
367
|
+
* 圆球
|
|
368
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
|
|
369
|
+
/**
|
|
370
|
+
* 圆锥
|
|
371
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
|
|
372
|
+
/**
|
|
373
|
+
* 半球
|
|
374
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
|
|
375
|
+
/**
|
|
376
|
+
* 圆
|
|
377
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
|
|
378
|
+
/**
|
|
379
|
+
* 圆环
|
|
380
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
|
|
381
|
+
/**
|
|
382
|
+
* 矩形
|
|
383
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
|
|
384
|
+
/**
|
|
385
|
+
* 矩形框
|
|
386
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
|
|
387
|
+
/**
|
|
388
|
+
* 直线
|
|
389
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
|
|
390
|
+
/**
|
|
391
|
+
* 贴图
|
|
392
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
393
|
+
})(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
|
|
394
|
+
/**
|
|
395
|
+
* 插件类型
|
|
396
|
+
*/ var PluginType;
|
|
397
|
+
(function(PluginType) {
|
|
398
|
+
/**
|
|
399
|
+
* 陀螺仪
|
|
400
|
+
*/ PluginType[PluginType["GYROSCOPE"] = 0] = "GYROSCOPE";
|
|
401
|
+
/**
|
|
402
|
+
* Spine
|
|
403
|
+
*/ PluginType[PluginType["SPINE"] = 1] = "SPINE";
|
|
404
|
+
})(PluginType || (PluginType = {}));
|
|
405
|
+
/**
|
|
406
|
+
* 交互类型
|
|
407
|
+
*/ var InteractType;
|
|
408
|
+
(function(InteractType) {
|
|
409
|
+
/**
|
|
410
|
+
* 点击
|
|
411
|
+
*/ InteractType[InteractType["CLICK"] = 0] = "CLICK";
|
|
412
|
+
/**
|
|
413
|
+
* 消息
|
|
414
|
+
* 前端收到 onMessageItem 回调
|
|
415
|
+
*/ InteractType[InteractType["MESSAGE"] = 1] = "MESSAGE";
|
|
416
|
+
/**
|
|
417
|
+
* 拖拽
|
|
418
|
+
*/ InteractType[InteractType["DRAG"] = 2] = "DRAG";
|
|
419
|
+
})(InteractType || (InteractType = {}));
|
|
420
|
+
/**
|
|
421
|
+
* 交互行为
|
|
422
|
+
*/ var InteractBehavior;
|
|
423
|
+
(function(InteractBehavior) {
|
|
424
|
+
/**
|
|
425
|
+
* 无
|
|
426
|
+
*/ InteractBehavior[InteractBehavior["NONE"] = 0] = "NONE";
|
|
427
|
+
/**
|
|
428
|
+
* 通知
|
|
429
|
+
*/ InteractBehavior[InteractBehavior["NOTIFY"] = 1] = "NOTIFY";
|
|
430
|
+
/**
|
|
431
|
+
* 重置播放器
|
|
432
|
+
*/ InteractBehavior[InteractBehavior["RESUME_PLAYER"] = 2] = "RESUME_PLAYER";
|
|
433
|
+
/**
|
|
434
|
+
* 清除元素
|
|
435
|
+
*/ InteractBehavior[InteractBehavior["REMOVE"] = 3] = "REMOVE";
|
|
436
|
+
/**
|
|
437
|
+
* 暂停播放器
|
|
438
|
+
*/ InteractBehavior[InteractBehavior["PAUSE"] = 4] = "PAUSE";
|
|
439
|
+
})(InteractBehavior || (InteractBehavior = {}));
|
|
440
|
+
/**
|
|
441
|
+
* 元素类型
|
|
442
|
+
*/ var ItemType;
|
|
443
|
+
(function(ItemType) {
|
|
444
|
+
/**
|
|
445
|
+
* 错误元素
|
|
446
|
+
*/ ItemType["base"] = "0";
|
|
447
|
+
/**
|
|
448
|
+
* 图层元素
|
|
449
|
+
*/ ItemType["sprite"] = "1";
|
|
450
|
+
/**
|
|
451
|
+
* 粒子元素
|
|
452
|
+
*/ ItemType["particle"] = "2";
|
|
453
|
+
/**
|
|
454
|
+
* 空节点元素
|
|
455
|
+
*/ ItemType["null"] = "3";
|
|
456
|
+
/**
|
|
457
|
+
* 交互元素
|
|
458
|
+
*/ ItemType["interact"] = "4";
|
|
459
|
+
/**
|
|
460
|
+
* 插件元素
|
|
461
|
+
*/ ItemType["plugin"] = "5";
|
|
462
|
+
/**
|
|
463
|
+
* 相机元素
|
|
464
|
+
*/ ItemType["camera"] = "6";
|
|
465
|
+
/**
|
|
466
|
+
* 预合成元素
|
|
467
|
+
*/ ItemType["composition"] = "7";
|
|
468
|
+
/**
|
|
469
|
+
* Spine 元素
|
|
470
|
+
*/ ItemType["spine"] = "spine";
|
|
471
|
+
/**
|
|
472
|
+
* Mesh 元素
|
|
473
|
+
*/ ItemType["mesh"] = "mesh";
|
|
474
|
+
/**
|
|
475
|
+
* 节点树元素
|
|
476
|
+
*/ ItemType["tree"] = "tree";
|
|
477
|
+
/**
|
|
478
|
+
* 文本元素
|
|
479
|
+
*/ ItemType["text"] = "text";
|
|
480
|
+
/**
|
|
481
|
+
* 灯光元素
|
|
482
|
+
*/ ItemType["light"] = "light";
|
|
483
|
+
/**
|
|
484
|
+
* 天空盒元素
|
|
485
|
+
*/ ItemType["skybox"] = "skybox";
|
|
486
|
+
/**
|
|
487
|
+
* 特效元素
|
|
488
|
+
*/ ItemType["effect"] = "effect";
|
|
489
|
+
/**
|
|
490
|
+
* 形状元素
|
|
491
|
+
*/ ItemType["shape"] = "shape";
|
|
492
|
+
/**
|
|
493
|
+
* 后处理元素
|
|
494
|
+
*/ ItemType["postProcessVolume"] = "postProcessVolume";
|
|
495
|
+
/**
|
|
496
|
+
* 节点元素
|
|
497
|
+
*/ ItemType["node"] = "node";
|
|
498
|
+
/**
|
|
499
|
+
* 视频元素
|
|
500
|
+
*/ ItemType["video"] = "video";
|
|
501
|
+
/**
|
|
502
|
+
* 音频元素
|
|
503
|
+
*/ ItemType["audio"] = "audio";
|
|
504
|
+
/**
|
|
505
|
+
* 富文本元素
|
|
506
|
+
*/ ItemType["richtext"] = "richtext";
|
|
507
|
+
})(ItemType || (ItemType = {}));
|
|
508
|
+
/**
|
|
509
|
+
* 渲染模式
|
|
510
|
+
*/ var RenderMode;
|
|
511
|
+
(function(RenderMode) {
|
|
512
|
+
/**
|
|
513
|
+
* 广告牌模式
|
|
514
|
+
*/ RenderMode[RenderMode["BILLBOARD"] = 0] = "BILLBOARD";
|
|
515
|
+
/**
|
|
516
|
+
* 网格模式
|
|
517
|
+
*/ RenderMode[RenderMode["MESH"] = 1] = "MESH";
|
|
518
|
+
/**
|
|
519
|
+
* 垂直广告牌模式
|
|
520
|
+
*/ RenderMode[RenderMode["VERTICAL_BILLBOARD"] = 2] = "VERTICAL_BILLBOARD";
|
|
521
|
+
/**
|
|
522
|
+
* 水平广告牌模式
|
|
523
|
+
*/ RenderMode[RenderMode["HORIZONTAL_BILLBOARD"] = 3] = "HORIZONTAL_BILLBOARD";
|
|
524
|
+
})(RenderMode || (RenderMode = {}));
|
|
525
|
+
/**
|
|
526
|
+
* 变换中心
|
|
527
|
+
*/ var ParticleOrigin;
|
|
528
|
+
(function(ParticleOrigin) {
|
|
529
|
+
/**
|
|
530
|
+
* 水平和垂直中点
|
|
531
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER"] = 0] = "PARTICLE_ORIGIN_CENTER";
|
|
532
|
+
/**
|
|
533
|
+
* 水平左侧 垂直顶部
|
|
534
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_TOP"] = 1] = "PARTICLE_ORIGIN_LEFT_TOP";
|
|
535
|
+
/**
|
|
536
|
+
* 水平左侧 垂直中间
|
|
537
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_CENTER"] = 2] = "PARTICLE_ORIGIN_LEFT_CENTER";
|
|
538
|
+
/**
|
|
539
|
+
* 水平左侧 垂直底部
|
|
540
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_LEFT_BOTTOM"] = 3] = "PARTICLE_ORIGIN_LEFT_BOTTOM";
|
|
541
|
+
/**
|
|
542
|
+
* 水平中间 垂直顶部
|
|
543
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER_TOP"] = 4] = "PARTICLE_ORIGIN_CENTER_TOP";
|
|
544
|
+
/**
|
|
545
|
+
* 水平中间 垂直底部
|
|
546
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_CENTER_BOTTOM"] = 5] = "PARTICLE_ORIGIN_CENTER_BOTTOM";
|
|
547
|
+
/**
|
|
548
|
+
* 水平右侧 垂直顶部
|
|
549
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_TOP"] = 6] = "PARTICLE_ORIGIN_RIGHT_TOP";
|
|
550
|
+
/**
|
|
551
|
+
* 水平右侧 垂直中间
|
|
552
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_CENTER"] = 7] = "PARTICLE_ORIGIN_RIGHT_CENTER";
|
|
553
|
+
/**
|
|
554
|
+
* 水平右侧 垂直底部
|
|
555
|
+
*/ ParticleOrigin[ParticleOrigin["PARTICLE_ORIGIN_RIGHT_BOTTOM"] = 8] = "PARTICLE_ORIGIN_RIGHT_BOTTOM";
|
|
556
|
+
})(ParticleOrigin || (ParticleOrigin = {}));
|
|
557
|
+
var RenderType;
|
|
558
|
+
(function(RenderType) {
|
|
559
|
+
RenderType["Opaque"] = "Opaque";
|
|
560
|
+
RenderType["Transparent"] = "Transparent";
|
|
561
|
+
})(RenderType || (RenderType = {}));
|
|
562
|
+
var RenderFace;
|
|
563
|
+
(function(RenderFace) {
|
|
564
|
+
RenderFace["Both"] = "Both";
|
|
565
|
+
RenderFace["Back"] = "Back";
|
|
566
|
+
RenderFace["Front"] = "Front";
|
|
567
|
+
})(RenderFace || (RenderFace = {}));
|
|
568
|
+
|
|
569
|
+
var CameraClipMode;
|
|
570
|
+
(function(CameraClipMode) {
|
|
571
|
+
/**
|
|
572
|
+
* 剪裁上下
|
|
573
|
+
*/ CameraClipMode[CameraClipMode["portrait"] = 1] = "portrait";
|
|
574
|
+
/**
|
|
575
|
+
* 剪裁左右
|
|
576
|
+
*/ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
|
|
577
|
+
})(CameraClipMode || (CameraClipMode = {}));
|
|
578
|
+
|
|
579
|
+
/*********************************************/ /* 基本数值属性参数 */ /*********************************************/ var ValueType;
|
|
580
|
+
(function(ValueType) {
|
|
581
|
+
/**
|
|
582
|
+
* 常数
|
|
583
|
+
*/ ValueType[ValueType["CONSTANT"] = 0] = "CONSTANT";
|
|
584
|
+
/**
|
|
585
|
+
* 二维常数向量
|
|
586
|
+
*/ ValueType[ValueType["CONSTANT_VEC2"] = 1] = "CONSTANT_VEC2";
|
|
587
|
+
/**
|
|
588
|
+
* 三维常数向量
|
|
589
|
+
*/ ValueType[ValueType["CONSTANT_VEC3"] = 2] = "CONSTANT_VEC3";
|
|
590
|
+
/**
|
|
591
|
+
* 四维常数向量
|
|
592
|
+
*/ ValueType[ValueType["CONSTANT_VEC4"] = 3] = "CONSTANT_VEC4";
|
|
593
|
+
/**
|
|
594
|
+
* 随机数
|
|
595
|
+
*/ ValueType[ValueType["RANDOM"] = 4] = "RANDOM";
|
|
596
|
+
/**
|
|
597
|
+
* 直线
|
|
598
|
+
*/ ValueType[ValueType["LINE"] = 5] = "LINE";
|
|
599
|
+
/**
|
|
600
|
+
* 曲线(Hermite 曲线)
|
|
601
|
+
* @deprecated 使用 BEZIER_CURVE 替代,此类型仅用于旧数据迁移兼容
|
|
602
|
+
*/ ValueType[ValueType["CURVE"] = 6] = "CURVE";
|
|
603
|
+
/**
|
|
604
|
+
* 贝塞尔路径
|
|
605
|
+
* @deprecated 使用 BEZIER_CURVE_PATH 替代,此类型仅用于旧数据迁移兼容
|
|
606
|
+
*/ ValueType[ValueType["BEZIER_PATH"] = 7] = "BEZIER_PATH";
|
|
607
|
+
/**
|
|
608
|
+
* 颜色
|
|
609
|
+
*/ ValueType[ValueType["RGBA_COLOR"] = 8] = "RGBA_COLOR";
|
|
610
|
+
/**
|
|
611
|
+
* 渐变色
|
|
612
|
+
*/ ValueType[ValueType["GRADIENT_COLOR"] = 9] = "GRADIENT_COLOR";
|
|
613
|
+
/**
|
|
614
|
+
* 蒙版形状点集
|
|
615
|
+
*/ ValueType[ValueType["SHAPE_POINTS"] = 10] = "SHAPE_POINTS";
|
|
616
|
+
/**
|
|
617
|
+
* 蒙版形状切分
|
|
618
|
+
*/ ValueType[ValueType["SHAPE_SPLITS"] = 11] = "SHAPE_SPLITS";
|
|
619
|
+
/**
|
|
620
|
+
* 直线路径
|
|
621
|
+
*/ ValueType[ValueType["LINEAR_PATH"] = 12] = "LINEAR_PATH";
|
|
622
|
+
/**
|
|
623
|
+
* 多色
|
|
624
|
+
*/ ValueType[ValueType["COLORS"] = 13] = "COLORS";
|
|
625
|
+
/**
|
|
626
|
+
* 二进制指针
|
|
627
|
+
*/ ValueType[ValueType["BINARY"] = 20] = "BINARY";
|
|
628
|
+
/**
|
|
629
|
+
* 贝塞尔曲线
|
|
630
|
+
*/ ValueType[ValueType["BEZIER_CURVE"] = 21] = "BEZIER_CURVE";
|
|
631
|
+
/**
|
|
632
|
+
* 贝塞尔曲线路径
|
|
633
|
+
*/ ValueType[ValueType["BEZIER_CURVE_PATH"] = 22] = "BEZIER_CURVE_PATH";
|
|
634
|
+
/**
|
|
635
|
+
* 贝塞尔曲线四元数
|
|
636
|
+
*/ ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
|
|
637
|
+
/**
|
|
638
|
+
* 颜色曲线
|
|
639
|
+
*/ ValueType[ValueType["COLOR_CURVE"] = 24] = "COLOR_CURVE";
|
|
640
|
+
/**
|
|
641
|
+
* Vector4 曲线
|
|
642
|
+
*/ ValueType[ValueType["VECTOR4_CURVE"] = 25] = "VECTOR4_CURVE";
|
|
643
|
+
/**
|
|
644
|
+
* Vector2 曲线
|
|
645
|
+
*/ ValueType[ValueType["VECTOR2_CURVE"] = 26] = "VECTOR2_CURVE";
|
|
646
|
+
/**
|
|
647
|
+
* Vector3 曲线
|
|
648
|
+
*/ ValueType[ValueType["VECTOR3_CURVE"] = 27] = "VECTOR3_CURVE";
|
|
649
|
+
})(ValueType || (ValueType = {}));
|
|
650
|
+
/**
|
|
651
|
+
* 关键帧类型
|
|
652
|
+
*/ var BezierKeyframeType;
|
|
653
|
+
(function(BezierKeyframeType) {
|
|
654
|
+
BezierKeyframeType[BezierKeyframeType["AUTO"] = 0] = "AUTO";
|
|
655
|
+
BezierKeyframeType[BezierKeyframeType["EASE"] = 1] = "EASE";
|
|
656
|
+
BezierKeyframeType[BezierKeyframeType["EASE_IN"] = 2] = "EASE_IN";
|
|
657
|
+
BezierKeyframeType[BezierKeyframeType["EASE_OUT"] = 3] = "EASE_OUT";
|
|
658
|
+
BezierKeyframeType[BezierKeyframeType["LINE"] = 4] = "LINE";
|
|
659
|
+
BezierKeyframeType[BezierKeyframeType["HOLD"] = 5] = "HOLD";
|
|
660
|
+
BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
|
|
661
|
+
})(BezierKeyframeType || (BezierKeyframeType = {}));
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* 结束行为
|
|
665
|
+
*/ var EndBehavior;
|
|
666
|
+
(function(EndBehavior) {
|
|
667
|
+
/**
|
|
668
|
+
* 销毁
|
|
669
|
+
*/ EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
|
|
670
|
+
/**
|
|
671
|
+
* 重播
|
|
672
|
+
*/ EndBehavior[EndBehavior["restart"] = 5] = "restart";
|
|
673
|
+
/**
|
|
674
|
+
* 无限播放
|
|
675
|
+
*/ EndBehavior[EndBehavior["forward"] = 2] = "forward";
|
|
676
|
+
/**
|
|
677
|
+
* 冻结
|
|
678
|
+
*/ EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
|
|
679
|
+
})(EndBehavior || (EndBehavior = {}));
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* 粒子交互行为
|
|
683
|
+
*/ var ParticleInteractionBehavior;
|
|
684
|
+
(function(ParticleInteractionBehavior) {
|
|
685
|
+
/**
|
|
686
|
+
* 无
|
|
687
|
+
*/ ParticleInteractionBehavior[ParticleInteractionBehavior["none"] = 0] = "none";
|
|
688
|
+
/**
|
|
689
|
+
* 移出粒子
|
|
690
|
+
*/ ParticleInteractionBehavior[ParticleInteractionBehavior["removeParticle"] = 1] = "removeParticle";
|
|
691
|
+
})(ParticleInteractionBehavior || (ParticleInteractionBehavior = {}));
|
|
692
|
+
|
|
693
|
+
var ShapeArcMode;
|
|
694
|
+
(function(ShapeArcMode) {
|
|
695
|
+
/**
|
|
696
|
+
* 随机
|
|
697
|
+
*/ ShapeArcMode[ShapeArcMode["RANDOM"] = 0] = "RANDOM";
|
|
698
|
+
/**
|
|
699
|
+
* 单向循环
|
|
700
|
+
*/ ShapeArcMode[ShapeArcMode["UNIDIRECTIONAL_CYCLE"] = 1] = "UNIDIRECTIONAL_CYCLE";
|
|
701
|
+
/**
|
|
702
|
+
* 双向循环
|
|
703
|
+
*/ ShapeArcMode[ShapeArcMode["BIDIRECTIONAL_CYCLE"] = 2] = "BIDIRECTIONAL_CYCLE";
|
|
704
|
+
/**
|
|
705
|
+
* 均匀爆发
|
|
706
|
+
*/ ShapeArcMode[ShapeArcMode["UNIFORM_BURST"] = 3] = "UNIFORM_BURST";
|
|
707
|
+
})(ShapeArcMode || (ShapeArcMode = {}));
|
|
708
|
+
|
|
709
|
+
var LightType;
|
|
710
|
+
(function(LightType) {
|
|
711
|
+
/**
|
|
712
|
+
* 点光源
|
|
713
|
+
*/ LightType["point"] = "point";
|
|
714
|
+
/**
|
|
715
|
+
* 聚光灯
|
|
716
|
+
*/ LightType["spot"] = "spot";
|
|
717
|
+
/**
|
|
718
|
+
* 方向光
|
|
719
|
+
*/ LightType["directional"] = "directional";
|
|
720
|
+
/**
|
|
721
|
+
* 环境光
|
|
722
|
+
*/ LightType["ambient"] = "ambient";
|
|
723
|
+
})(LightType || (LightType = {}));
|
|
724
|
+
|
|
725
|
+
var ModelBoundingType;
|
|
726
|
+
(function(ModelBoundingType) {
|
|
727
|
+
ModelBoundingType[ModelBoundingType["box"] = 2] = "box";
|
|
728
|
+
ModelBoundingType[ModelBoundingType["sphere"] = 3] = "sphere";
|
|
729
|
+
})(ModelBoundingType || (ModelBoundingType = {}));
|
|
730
|
+
|
|
731
|
+
var CameraType;
|
|
732
|
+
(function(CameraType) {
|
|
733
|
+
CameraType["orthographic"] = "orthographic";
|
|
734
|
+
CameraType["perspective"] = "perspective";
|
|
735
|
+
})(CameraType || (CameraType = {}));
|
|
736
|
+
|
|
737
|
+
// 材质类型
|
|
738
|
+
var MaterialType;
|
|
739
|
+
(function(MaterialType) {
|
|
740
|
+
MaterialType["unlit"] = "unlit";
|
|
741
|
+
MaterialType["pbr"] = "pbr";
|
|
742
|
+
// 头发材质,在 pbr 材质基础上扩展
|
|
743
|
+
MaterialType["hair"] = "hair";
|
|
744
|
+
})(MaterialType || (MaterialType = {}));
|
|
745
|
+
// 混合模式
|
|
746
|
+
var MaterialBlending;
|
|
747
|
+
(function(MaterialBlending) {
|
|
748
|
+
MaterialBlending[MaterialBlending["opaque"] = 100] = "opaque";
|
|
749
|
+
MaterialBlending[MaterialBlending["masked"] = 101] = "masked";
|
|
750
|
+
MaterialBlending[MaterialBlending["translucent"] = 102] = "translucent";
|
|
751
|
+
MaterialBlending[MaterialBlending["additive"] = 103] = "additive";
|
|
752
|
+
})(MaterialBlending || (MaterialBlending = {}));
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* 3D渲染模式:将渲染过程中的中间结果输出,主要用于排查渲染效果问题,支持 pbr 和 unlit 材质
|
|
756
|
+
*/ var RenderMode3D;
|
|
757
|
+
(function(RenderMode3D) {
|
|
758
|
+
/**
|
|
759
|
+
* 正常渲染
|
|
760
|
+
*/ RenderMode3D["none"] = "none";
|
|
761
|
+
/**
|
|
762
|
+
* 纹理坐标
|
|
763
|
+
*/ RenderMode3D["uv"] = "uv";
|
|
764
|
+
/**
|
|
765
|
+
* 世界坐标法线
|
|
766
|
+
*/ RenderMode3D["normal"] = "normal";
|
|
767
|
+
/**
|
|
768
|
+
* 基础颜色
|
|
769
|
+
*/ RenderMode3D["basecolor"] = "basecolor";
|
|
770
|
+
/**
|
|
771
|
+
* 基础颜色 Alpha
|
|
772
|
+
*/ RenderMode3D["alpha"] = "alpha";
|
|
773
|
+
/**
|
|
774
|
+
* 金属度
|
|
775
|
+
*/ RenderMode3D["metallic"] = "metallic";
|
|
776
|
+
/**
|
|
777
|
+
* 粗超度
|
|
778
|
+
*/ RenderMode3D["roughness"] = "roughness";
|
|
779
|
+
/**
|
|
780
|
+
* 环境遮蔽
|
|
781
|
+
*/ RenderMode3D["ao"] = "ao";
|
|
782
|
+
/**
|
|
783
|
+
* 自发光
|
|
784
|
+
*/ RenderMode3D["emissive"] = "emissive";
|
|
785
|
+
/**
|
|
786
|
+
* 漫反射
|
|
787
|
+
*/ RenderMode3D["diffuse"] = "diffuse";
|
|
788
|
+
})(RenderMode3D || (RenderMode3D = {}));
|
|
789
|
+
|
|
790
|
+
var TextOverflow;
|
|
791
|
+
(function(TextOverflow) {
|
|
792
|
+
/**
|
|
793
|
+
* visible 模式下,文本内容超出边界框时,会继续显示内容,不进行裁剪或缩放。
|
|
794
|
+
*/ TextOverflow[TextOverflow["visible"] = 0] = "visible";
|
|
795
|
+
/**
|
|
796
|
+
* display 模式下,会显示所有文本,文本字号大小会根据边界框调整。
|
|
797
|
+
*/ TextOverflow[TextOverflow["display"] = 1] = "display";
|
|
798
|
+
/**
|
|
799
|
+
* clip 模式下,当文本内容超出边界框时,多余的会被截断。
|
|
800
|
+
*/ TextOverflow[TextOverflow["clip"] = 2] = "clip";
|
|
801
|
+
/**
|
|
802
|
+
* ellipsis 模式下,会使用(...)来代替超出边界框的内容。
|
|
803
|
+
*/ TextOverflow[TextOverflow["ellipsis"] = 3] = "ellipsis";
|
|
804
|
+
})(TextOverflow || (TextOverflow = {}));
|
|
805
|
+
var TextSizeMode;
|
|
806
|
+
(function(TextSizeMode) {
|
|
807
|
+
/**
|
|
808
|
+
* 自适应宽度
|
|
809
|
+
*/ TextSizeMode[TextSizeMode["autoWidth"] = 0] = "autoWidth";
|
|
810
|
+
/**
|
|
811
|
+
* 自适应高度
|
|
812
|
+
*/ TextSizeMode[TextSizeMode["autoHeight"] = 1] = "autoHeight";
|
|
813
|
+
/**
|
|
814
|
+
* 固定宽高
|
|
815
|
+
*/ TextSizeMode[TextSizeMode["fixed"] = 2] = "fixed";
|
|
816
|
+
})(TextSizeMode || (TextSizeMode = {}));
|
|
817
|
+
var TextBaseline;
|
|
818
|
+
(function(TextBaseline) {
|
|
819
|
+
/**
|
|
820
|
+
* 文本顶对齐。
|
|
821
|
+
*/ TextBaseline[TextBaseline["top"] = 0] = "top";
|
|
822
|
+
/**
|
|
823
|
+
* 文本垂直居中对齐。
|
|
824
|
+
*/ TextBaseline[TextBaseline["middle"] = 1] = "middle";
|
|
825
|
+
/**
|
|
826
|
+
* 文本底对齐。
|
|
827
|
+
*/ TextBaseline[TextBaseline["bottom"] = 2] = "bottom";
|
|
828
|
+
})(TextBaseline || (TextBaseline = {}));
|
|
829
|
+
var TextAlignment;
|
|
830
|
+
(function(TextAlignment) {
|
|
831
|
+
/**
|
|
832
|
+
* text alignment starts from(x,y) to right direction
|
|
833
|
+
* 从 (x,y) 开始第一个字符,向右边延伸
|
|
834
|
+
*/ TextAlignment[TextAlignment["left"] = 0] = "left";
|
|
835
|
+
/**
|
|
836
|
+
* (x,y) is middle position of text, where (left + right)/2 =(x,y)
|
|
837
|
+
* (x,y) 为文字中间位置,(最左位置 + 最右位置)/2 = (x,y)
|
|
838
|
+
*/ TextAlignment[TextAlignment["middle"] = 1] = "middle";
|
|
839
|
+
/**
|
|
840
|
+
* text alignment ends with(x,y) from left direction
|
|
841
|
+
* 从 (x,y) 结束最后一个字符,向左边延伸
|
|
842
|
+
*/ TextAlignment[TextAlignment["right"] = 2] = "right";
|
|
843
|
+
})(TextAlignment || (TextAlignment = {}));
|
|
844
|
+
var TextVerticalAlign;
|
|
845
|
+
(function(TextVerticalAlign) {
|
|
846
|
+
/**
|
|
847
|
+
* 文本顶对齐。
|
|
848
|
+
*/ TextVerticalAlign[TextVerticalAlign["top"] = 0] = "top";
|
|
849
|
+
/**
|
|
850
|
+
* 文本垂直居中对齐。
|
|
851
|
+
*/ TextVerticalAlign[TextVerticalAlign["middle"] = 1] = "middle";
|
|
852
|
+
/**
|
|
853
|
+
* 文本底对齐。
|
|
854
|
+
*/ TextVerticalAlign[TextVerticalAlign["bottom"] = 2] = "bottom";
|
|
855
|
+
})(TextVerticalAlign || (TextVerticalAlign = {}));
|
|
856
|
+
/**
|
|
857
|
+
* 文本字重
|
|
858
|
+
*/ var TextWeight;
|
|
859
|
+
(function(TextWeight) {
|
|
860
|
+
/**
|
|
861
|
+
* 正常
|
|
862
|
+
*/ TextWeight["normal"] = "normal";
|
|
863
|
+
/**
|
|
864
|
+
* 粗体
|
|
865
|
+
*/ TextWeight["bold"] = "bold";
|
|
866
|
+
/**
|
|
867
|
+
* 瘦体
|
|
868
|
+
*/ TextWeight["lighter"] = "lighter";
|
|
869
|
+
})(TextWeight || (TextWeight = {}));
|
|
870
|
+
/**
|
|
871
|
+
* 文本样式
|
|
872
|
+
*/ var FontStyle;
|
|
873
|
+
(function(FontStyle) {
|
|
874
|
+
/**
|
|
875
|
+
* 正常
|
|
876
|
+
*/ FontStyle["normal"] = "normal";
|
|
877
|
+
/**
|
|
878
|
+
* 斜体
|
|
879
|
+
*/ FontStyle["italic"] = "italic";
|
|
880
|
+
/**
|
|
881
|
+
* 倾斜体
|
|
882
|
+
*/ FontStyle["oblique"] = "oblique";
|
|
883
|
+
})(FontStyle || (FontStyle = {}));
|
|
884
|
+
|
|
885
|
+
var FillType;
|
|
886
|
+
(function(FillType) {
|
|
887
|
+
FillType[FillType["Solid"] = 0] = "Solid";
|
|
888
|
+
FillType[FillType["GradientLinear"] = 1] = "GradientLinear";
|
|
889
|
+
FillType[FillType["GradientRadial"] = 2] = "GradientRadial";
|
|
890
|
+
FillType[FillType["GradientAngular"] = 3] = "GradientAngular";
|
|
891
|
+
FillType[FillType["Texture"] = 4] = "Texture";
|
|
892
|
+
})(FillType || (FillType = {}));
|
|
893
|
+
var TexturePaintScaleMode;
|
|
894
|
+
(function(TexturePaintScaleMode) {
|
|
895
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Fill"] = 0] = "Fill";
|
|
896
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Fit"] = 1] = "Fit";
|
|
897
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Crop"] = 2] = "Crop";
|
|
898
|
+
TexturePaintScaleMode[TexturePaintScaleMode["Tile"] = 3] = "Tile";
|
|
899
|
+
})(TexturePaintScaleMode || (TexturePaintScaleMode = {}));
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* 矢量图形类型
|
|
903
|
+
*/ var ShapePrimitiveType;
|
|
904
|
+
(function(ShapePrimitiveType) {
|
|
905
|
+
/**
|
|
906
|
+
* 自定义图形
|
|
907
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
908
|
+
/**
|
|
909
|
+
* 矩形
|
|
910
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
911
|
+
/**
|
|
912
|
+
* 椭圆
|
|
913
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
914
|
+
/**
|
|
915
|
+
* 多边形
|
|
916
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
917
|
+
/**
|
|
918
|
+
* 星形
|
|
919
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
920
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
921
|
+
|
|
922
|
+
var LineCap;
|
|
923
|
+
(function(LineCap) {
|
|
924
|
+
/** 默认值。向线条的每个末端添加平直的边缘 */ LineCap[LineCap["Butt"] = 0] = "Butt";
|
|
925
|
+
/** 向线条的每个末端添加圆形线帽 */ LineCap[LineCap["Round"] = 1] = "Round";
|
|
926
|
+
/** 向线条的每个末端添加正方形线帽 */ LineCap[LineCap["Square"] = 2] = "Square";
|
|
927
|
+
})(LineCap || (LineCap = {}));
|
|
928
|
+
var LineJoin;
|
|
929
|
+
(function(LineJoin) {
|
|
930
|
+
/** 创建圆角 */ LineJoin[LineJoin["Round"] = 0] = "Round";
|
|
931
|
+
/** 创建斜角 */ LineJoin[LineJoin["Bevel"] = 1] = "Bevel";
|
|
932
|
+
/** 创建尖角 */ LineJoin[LineJoin["Miter"] = 2] = "Miter";
|
|
933
|
+
})(LineJoin || (LineJoin = {}));
|
|
934
|
+
|
|
935
|
+
var NodeDataType;
|
|
936
|
+
(function(NodeDataType) {
|
|
937
|
+
NodeDataType["AnimationClipNodeData"] = "AnimationClipNodeData";
|
|
938
|
+
NodeDataType["BlendNodeData"] = "BlendNodeData";
|
|
939
|
+
NodeDataType["ApplyAdditiveNodeData"] = "ApplyAdditiveNodeData";
|
|
940
|
+
NodeDataType["LayerBlendNodeData"] = "LayerBlendNodeData";
|
|
941
|
+
NodeDataType["StateMachineNodeData"] = "StateMachineNodeData";
|
|
942
|
+
NodeDataType["TransitionNodeData"] = "TransitionNodeData";
|
|
943
|
+
NodeDataType["StateNodeData"] = "StateNodeData";
|
|
944
|
+
NodeDataType["ConstFloatNodeData"] = "ConstFloatNodeData";
|
|
945
|
+
NodeDataType["ConstBoolNodeData"] = "ConstBoolNodeData";
|
|
946
|
+
NodeDataType["ControlParameterBoolNodeData"] = "ControlParameterBoolNodeData";
|
|
947
|
+
NodeDataType["ControlParameterFloatNodeData"] = "ControlParameterFloatNodeData";
|
|
948
|
+
NodeDataType["ControlParameterTriggerNodeData"] = "ControlParameterTriggerNodeData";
|
|
949
|
+
NodeDataType["NotNodeData"] = "NotNodeData";
|
|
950
|
+
NodeDataType["AndNodeData"] = "AndNodeData";
|
|
951
|
+
NodeDataType["OrNodeData"] = "OrNodeData";
|
|
952
|
+
NodeDataType["EqualNodeData"] = "EqualNodeData";
|
|
953
|
+
NodeDataType["GreaterNodeData"] = "GreaterNodeData";
|
|
954
|
+
NodeDataType["LessNodeData"] = "LessNodeData";
|
|
955
|
+
})(NodeDataType || (NodeDataType = {}));
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* 动态换图类型
|
|
959
|
+
* @since 1.1.0
|
|
960
|
+
*/ var BackgroundType;
|
|
961
|
+
(function(BackgroundType) {
|
|
962
|
+
BackgroundType["video"] = "video";
|
|
963
|
+
BackgroundType["image"] = "image";
|
|
964
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
965
|
+
/**
|
|
966
|
+
* 多媒体资源类型
|
|
967
|
+
* @since 2.1.0
|
|
968
|
+
*/ var MultimediaType;
|
|
969
|
+
(function(MultimediaType) {
|
|
970
|
+
MultimediaType["video"] = "video";
|
|
971
|
+
MultimediaType["audio"] = "audio";
|
|
972
|
+
})(MultimediaType || (MultimediaType = {}));
|
|
973
|
+
var HevcVideoCodec;
|
|
974
|
+
(function(HevcVideoCodec) {
|
|
975
|
+
HevcVideoCodec["L30"] = "hev1.1.0.L30.B0";
|
|
976
|
+
HevcVideoCodec["L60"] = "hev1.1.0.L60.B0";
|
|
977
|
+
HevcVideoCodec["L63"] = "hev1.1.0.L63.B0";
|
|
978
|
+
HevcVideoCodec["L90"] = "hev1.1.0.L90.B0";
|
|
979
|
+
HevcVideoCodec["L93"] = "hev1.1.0.L93.B0";
|
|
980
|
+
HevcVideoCodec["L120"] = "hev1.1.0.L120.B0";
|
|
981
|
+
HevcVideoCodec["L150"] = "hev1.1.0.L150.B0";
|
|
982
|
+
HevcVideoCodec["L180"] = "hev1.1.0.L180.B0";
|
|
983
|
+
})(HevcVideoCodec || (HevcVideoCodec = {}));
|
|
984
|
+
|
|
985
|
+
var DataType;
|
|
986
|
+
(function(DataType) {
|
|
987
|
+
DataType["VFXItemData"] = "VFXItemData";
|
|
988
|
+
// Assets
|
|
989
|
+
DataType["Material"] = "Material";
|
|
990
|
+
DataType["Shader"] = "Shader";
|
|
991
|
+
DataType["Geometry"] = "Geometry";
|
|
992
|
+
DataType["Texture"] = "Texture";
|
|
993
|
+
DataType["Image"] = "Image";
|
|
994
|
+
DataType["AnimationClip"] = "AnimationClip";
|
|
995
|
+
DataType["BinaryAsset"] = "BinaryAsset";
|
|
996
|
+
// Timeline
|
|
997
|
+
DataType["TrackAsset"] = "TrackAsset";
|
|
998
|
+
DataType["TimelineAsset"] = "TimelineAsset";
|
|
999
|
+
DataType["ObjectBindingTrack"] = "ObjectBindingTrack";
|
|
1000
|
+
DataType["TransformTrack"] = "TransformTrack";
|
|
1001
|
+
DataType["SpriteColorTrack"] = "SpriteColorTrack";
|
|
1002
|
+
DataType["ActivationTrack"] = "ActivationTrack";
|
|
1003
|
+
DataType["SubCompositionTrack"] = "SubCompositionTrack";
|
|
1004
|
+
DataType["FloatPropertyTrack"] = "FloatPropertyTrack";
|
|
1005
|
+
DataType["ColorPropertyTrack"] = "ColorPropertyTrack";
|
|
1006
|
+
DataType["Vector2PropertyTrack"] = "Vector2PropertyTrack";
|
|
1007
|
+
DataType["Vector3PropertyTrack"] = "Vector3PropertyTrack";
|
|
1008
|
+
DataType["Vector4PropertyTrack"] = "Vector4PropertyTrack";
|
|
1009
|
+
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
1010
|
+
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
1011
|
+
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
1012
|
+
DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
|
|
1013
|
+
DataType["FloatPropertyPlayableAsset"] = "FloatPropertyPlayableAsset";
|
|
1014
|
+
DataType["ColorPropertyPlayableAsset"] = "ColorPropertyPlayableAsset";
|
|
1015
|
+
DataType["Vector2PropertyPlayableAsset"] = "Vector2PropertyPlayableAsset";
|
|
1016
|
+
DataType["Vector3PropertyPlayableAsset"] = "Vector3PropertyPlayableAsset";
|
|
1017
|
+
DataType["Vector4PropertyPlayableAsset"] = "Vector4PropertyPlayableAsset";
|
|
1018
|
+
// Components
|
|
1019
|
+
DataType["MeshComponent"] = "MeshComponent";
|
|
1020
|
+
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
1021
|
+
DataType["LightComponent"] = "LightComponent";
|
|
1022
|
+
DataType["CameraComponent"] = "CameraComponent";
|
|
1023
|
+
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
1024
|
+
DataType["TreeComponent"] = "TreeComponent";
|
|
1025
|
+
DataType["AnimationComponent"] = "AnimationComponent";
|
|
1026
|
+
DataType["SpineComponent"] = "SpineComponent";
|
|
1027
|
+
DataType["VideoComponent"] = "VideoComponent";
|
|
1028
|
+
DataType["AudioComponent"] = "AudioComponent";
|
|
1029
|
+
DataType["RichTextComponent"] = "RichTextComponent";
|
|
1030
|
+
DataType["OrientationComponent"] = "OrientationComponent";
|
|
1031
|
+
DataType["ShapeComponent"] = "ShapeComponent";
|
|
1032
|
+
DataType["SpriteComponent"] = "SpriteComponent";
|
|
1033
|
+
DataType["ParticleSystem"] = "ParticleSystem";
|
|
1034
|
+
DataType["InteractComponent"] = "InteractComponent";
|
|
1035
|
+
DataType["CameraController"] = "CameraController";
|
|
1036
|
+
DataType["PostProcessVolume"] = "PostProcessVolume";
|
|
1037
|
+
DataType["EffectComponent"] = "EffectComponent";
|
|
1038
|
+
DataType["TextComponent"] = "TextComponent";
|
|
1039
|
+
DataType["AnimationGraphAsset"] = "AnimationGraphAsset";
|
|
1040
|
+
DataType["CompositionComponent"] = "CompositionComponent";
|
|
1041
|
+
DataType["FFDComponent"] = "FFDComponent";
|
|
1042
|
+
DataType["FrameComponent"] = "FrameComponent";
|
|
1043
|
+
DataType["Animator"] = "Animator";
|
|
1044
|
+
// Non-EffectObject
|
|
1045
|
+
DataType["TimelineClip"] = "TimelineClip";
|
|
1046
|
+
})(DataType || (DataType = {}));
|
|
1047
|
+
|
|
1048
|
+
var GeometryType;
|
|
1049
|
+
(function(GeometryType) {
|
|
1050
|
+
/**
|
|
1051
|
+
* Draw single points.
|
|
1052
|
+
*/ GeometryType[GeometryType["POINTS"] = 0] = "POINTS";
|
|
1053
|
+
/**
|
|
1054
|
+
* Draw lines. Each vertex connects to the one after it.
|
|
1055
|
+
*/ GeometryType[GeometryType["LINES"] = 1] = "LINES";
|
|
1056
|
+
/**
|
|
1057
|
+
* Draw lines. Each set of two vertices is treated as a separate line segment.
|
|
1058
|
+
*/ GeometryType[GeometryType["LINE_LOOP"] = 2] = "LINE_LOOP";
|
|
1059
|
+
/**
|
|
1060
|
+
* Draw a connected group of line segments from the first vertex to the last.
|
|
1061
|
+
*/ GeometryType[GeometryType["LINE_STRIP"] = 3] = "LINE_STRIP";
|
|
1062
|
+
/**
|
|
1063
|
+
* Draw triangles. Each set of three vertices creates a separate triangle.
|
|
1064
|
+
*/ GeometryType[GeometryType["TRIANGLES"] = 4] = "TRIANGLES";
|
|
1065
|
+
/**
|
|
1066
|
+
* Draw a connected strip of triangles.
|
|
1067
|
+
*/ GeometryType[GeometryType["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP";
|
|
1068
|
+
/**
|
|
1069
|
+
* Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
|
|
1070
|
+
*/ GeometryType[GeometryType["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN";
|
|
1071
|
+
})(GeometryType || (GeometryType = {}));
|
|
1072
|
+
var VertexFormatType;
|
|
1073
|
+
(function(VertexFormatType) {
|
|
1074
|
+
VertexFormatType[VertexFormatType["Float16"] = 0] = "Float16";
|
|
1075
|
+
VertexFormatType[VertexFormatType["Float32"] = 1] = "Float32";
|
|
1076
|
+
VertexFormatType[VertexFormatType["Int8"] = 2] = "Int8";
|
|
1077
|
+
VertexFormatType[VertexFormatType["Int16"] = 3] = "Int16";
|
|
1078
|
+
VertexFormatType[VertexFormatType["Int32"] = 4] = "Int32";
|
|
1079
|
+
VertexFormatType[VertexFormatType["UInt8"] = 5] = "UInt8";
|
|
1080
|
+
VertexFormatType[VertexFormatType["UInt16"] = 6] = "UInt16";
|
|
1081
|
+
VertexFormatType[VertexFormatType["UInt32"] = 7] = "UInt32";
|
|
1082
|
+
})(VertexFormatType || (VertexFormatType = {}));
|
|
1083
|
+
var IndexFormatType;
|
|
1084
|
+
(function(IndexFormatType) {
|
|
1085
|
+
IndexFormatType[IndexFormatType["None"] = -1] = "None";
|
|
1086
|
+
IndexFormatType[IndexFormatType["UInt8"] = 0] = "UInt8";
|
|
1087
|
+
IndexFormatType[IndexFormatType["UInt16"] = 1] = "UInt16";
|
|
1088
|
+
IndexFormatType[IndexFormatType["UInt32"] = 2] = "UInt32";
|
|
1089
|
+
})(IndexFormatType || (IndexFormatType = {}));
|
|
1090
|
+
// BINORMAL[n] Binormal float4
|
|
1091
|
+
// BLENDINDICES[n] 混合索引 uint
|
|
1092
|
+
// BLENDWEIGHT[n] 混合权重 FLOAT
|
|
1093
|
+
// COLOR[n] 漫射和反射颜色 float4
|
|
1094
|
+
// NORMAL[n] 法向矢量 float4
|
|
1095
|
+
// POSITION[n] 对象空间中的顶点位置。 float4
|
|
1096
|
+
// POSITIONT 变换的顶点位置。 float4
|
|
1097
|
+
// PSIZE[n] 点大小 FLOAT
|
|
1098
|
+
// TANGENT[n] 正切 float4
|
|
1099
|
+
// TEXCOORD[n] 纹理坐标 float4
|
|
1100
|
+
// POSITION_BS[n] Blend Shape 空间中的顶点位置 float4
|
|
1101
|
+
// NORMAL_BS[n] Blend Shape 空间中的法向矢量 float4
|
|
1102
|
+
// TANGENT_BS[n] Blend Shape 空间中的正切矢量 float4
|
|
1103
|
+
var VertexBufferSemantic;
|
|
1104
|
+
(function(VertexBufferSemantic) {
|
|
1105
|
+
VertexBufferSemantic["Position"] = "POSITION";
|
|
1106
|
+
VertexBufferSemantic["Uv"] = "TEXCOORD0";
|
|
1107
|
+
VertexBufferSemantic["Uv2"] = "TEXCOORD1";
|
|
1108
|
+
VertexBufferSemantic["Normal"] = "NORMAL";
|
|
1109
|
+
VertexBufferSemantic["Tangent"] = "TANGENT";
|
|
1110
|
+
VertexBufferSemantic["Color"] = "COLOR";
|
|
1111
|
+
VertexBufferSemantic["Joints"] = "JOINTS";
|
|
1112
|
+
VertexBufferSemantic["Weights"] = "WEIGHTS";
|
|
1113
|
+
//
|
|
1114
|
+
VertexBufferSemantic["PositionBS0"] = "POSITION_BS0";
|
|
1115
|
+
VertexBufferSemantic["PositionBS1"] = "POSITION_BS1";
|
|
1116
|
+
VertexBufferSemantic["PositionBS2"] = "POSITION_BS2";
|
|
1117
|
+
VertexBufferSemantic["PositionBS3"] = "POSITION_BS3";
|
|
1118
|
+
VertexBufferSemantic["PositionBS4"] = "POSITION_BS4";
|
|
1119
|
+
VertexBufferSemantic["PositionBS5"] = "POSITION_BS5";
|
|
1120
|
+
VertexBufferSemantic["PositionBS6"] = "POSITION_BS6";
|
|
1121
|
+
VertexBufferSemantic["PositionBS7"] = "POSITION_BS7";
|
|
1122
|
+
VertexBufferSemantic["NormalBS0"] = "NORMAL_BS0";
|
|
1123
|
+
VertexBufferSemantic["NormalBS1"] = "NORMAL_BS1";
|
|
1124
|
+
VertexBufferSemantic["NormalBS2"] = "NORMAL_BS2";
|
|
1125
|
+
VertexBufferSemantic["NormalBS3"] = "NORMAL_BS3";
|
|
1126
|
+
VertexBufferSemantic["TangentBS0"] = "TANGENT_BS0";
|
|
1127
|
+
VertexBufferSemantic["TangentBS1"] = "TANGENT_BS1";
|
|
1128
|
+
VertexBufferSemantic["TangentBS2"] = "TANGENT_BS2";
|
|
1129
|
+
VertexBufferSemantic["TangentBS3"] = "TANGENT_BS3";
|
|
1130
|
+
})(VertexBufferSemantic || (VertexBufferSemantic = {}));
|
|
1131
|
+
|
|
1132
|
+
JSONSceneVersion.LATEST;
|
|
1133
|
+
|
|
263
1134
|
var DEFAULT_OUT_TANGENT = {
|
|
264
1135
|
x: 0.33,
|
|
265
1136
|
y: 0.33
|
|
@@ -457,31 +1328,31 @@ function getScalarValue(keyframe, dimensionIndex) {
|
|
|
457
1328
|
// ─── Internal helpers ───────────────────────────────────────
|
|
458
1329
|
function makeEaseOut(seg) {
|
|
459
1330
|
return [
|
|
460
|
-
|
|
1331
|
+
BezierKeyframeType.EASE_OUT,
|
|
461
1332
|
[
|
|
462
1333
|
roundNumber(seg[0], 4),
|
|
463
1334
|
roundNumber(seg[1], 4),
|
|
464
1335
|
roundNumber(seg[2], 4),
|
|
465
1336
|
roundNumber(seg[3], 4)
|
|
466
1337
|
],
|
|
467
|
-
|
|
1338
|
+
BezierKeyframeType.EASE_OUT
|
|
468
1339
|
];
|
|
469
1340
|
}
|
|
470
1341
|
function makeEaseIn(prevSeg) {
|
|
471
1342
|
return [
|
|
472
|
-
|
|
1343
|
+
BezierKeyframeType.EASE_IN,
|
|
473
1344
|
[
|
|
474
1345
|
roundNumber(prevSeg[4], 4),
|
|
475
1346
|
roundNumber(prevSeg[5], 4),
|
|
476
1347
|
roundNumber(prevSeg[6], 4),
|
|
477
1348
|
roundNumber(prevSeg[7], 4)
|
|
478
1349
|
],
|
|
479
|
-
|
|
1350
|
+
BezierKeyframeType.EASE_IN
|
|
480
1351
|
];
|
|
481
1352
|
}
|
|
482
1353
|
function makeEase(prevSeg, currSeg) {
|
|
483
1354
|
return [
|
|
484
|
-
|
|
1355
|
+
BezierKeyframeType.EASE,
|
|
485
1356
|
[
|
|
486
1357
|
roundNumber(prevSeg[4], 4),
|
|
487
1358
|
roundNumber(prevSeg[5], 4),
|
|
@@ -490,7 +1361,7 @@ function makeEase(prevSeg, currSeg) {
|
|
|
490
1361
|
roundNumber(currSeg[2], 4),
|
|
491
1362
|
roundNumber(currSeg[3], 4)
|
|
492
1363
|
],
|
|
493
|
-
|
|
1364
|
+
BezierKeyframeType.EASE
|
|
494
1365
|
];
|
|
495
1366
|
}
|
|
496
1367
|
function buildCurveForDimension(keyframes, timeContext, dimensionIndex) {
|
|
@@ -962,7 +1833,7 @@ function buildPositionAnim(transform, timeContext, ctx) {
|
|
|
962
1833
|
}
|
|
963
1834
|
return {
|
|
964
1835
|
path: [
|
|
965
|
-
|
|
1836
|
+
ValueType.BEZIER_CURVE_PATH,
|
|
966
1837
|
pathPayload
|
|
967
1838
|
]
|
|
968
1839
|
};
|
|
@@ -979,21 +1850,21 @@ function buildRotationAnim(transform, timeContext) {
|
|
|
979
1850
|
var curves = irVectorKeyframesToGE(rotation, timeContext);
|
|
980
1851
|
if (curves != null && axisHasRotationValue(rotation, 0) && ((_curves_ = curves[0]) == null ? void 0 : _curves_.length)) {
|
|
981
1852
|
result['x'] = [
|
|
982
|
-
|
|
1853
|
+
ValueType.BEZIER_CURVE,
|
|
983
1854
|
curves[0]
|
|
984
1855
|
];
|
|
985
1856
|
hasX = true;
|
|
986
1857
|
}
|
|
987
1858
|
if (curves != null && axisHasRotationValue(rotation, 1) && ((_curves_1 = curves[1]) == null ? void 0 : _curves_1.length)) {
|
|
988
1859
|
result['y'] = [
|
|
989
|
-
|
|
1860
|
+
ValueType.BEZIER_CURVE,
|
|
990
1861
|
curves[1]
|
|
991
1862
|
];
|
|
992
1863
|
hasY = true;
|
|
993
1864
|
}
|
|
994
1865
|
if (curves != null && axisHasRotationValue(rotation, 2) && ((_curves_2 = curves[2]) == null ? void 0 : _curves_2.length)) {
|
|
995
1866
|
result['z'] = [
|
|
996
|
-
|
|
1867
|
+
ValueType.BEZIER_CURVE,
|
|
997
1868
|
curves[2]
|
|
998
1869
|
];
|
|
999
1870
|
hasZ = true;
|
|
@@ -1002,21 +1873,21 @@ function buildRotationAnim(transform, timeContext) {
|
|
|
1002
1873
|
var _rotation_value = rotation.value, tmp = _rotation_value[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _rotation_value[1], y = tmp1 === void 0 ? 0 : tmp1, tmp2 = _rotation_value[2], z = tmp2 === void 0 ? 0 : tmp2;
|
|
1003
1874
|
if (Math.abs(x) > 0.0001) {
|
|
1004
1875
|
result['x'] = [
|
|
1005
|
-
|
|
1876
|
+
ValueType.CONSTANT,
|
|
1006
1877
|
x
|
|
1007
1878
|
];
|
|
1008
1879
|
hasX = true;
|
|
1009
1880
|
}
|
|
1010
1881
|
if (Math.abs(y) > 0.0001) {
|
|
1011
1882
|
result['y'] = [
|
|
1012
|
-
|
|
1883
|
+
ValueType.CONSTANT,
|
|
1013
1884
|
y
|
|
1014
1885
|
];
|
|
1015
1886
|
hasY = true;
|
|
1016
1887
|
}
|
|
1017
1888
|
if (Math.abs(z) > 0.0001) {
|
|
1018
1889
|
result['z'] = [
|
|
1019
|
-
|
|
1890
|
+
ValueType.CONSTANT,
|
|
1020
1891
|
z
|
|
1021
1892
|
];
|
|
1022
1893
|
hasZ = true;
|
|
@@ -1029,14 +1900,14 @@ function buildRotationAnim(transform, timeContext) {
|
|
|
1029
1900
|
var curves1 = irScalarKeyframesToGE(separated.x, timeContext);
|
|
1030
1901
|
if (curves1 != null) {
|
|
1031
1902
|
result['x'] = [
|
|
1032
|
-
|
|
1903
|
+
ValueType.BEZIER_CURVE,
|
|
1033
1904
|
curves1[0]
|
|
1034
1905
|
];
|
|
1035
1906
|
hasX = true;
|
|
1036
1907
|
}
|
|
1037
1908
|
} else if ((separated == null ? void 0 : (_separated_x1 = separated.x) == null ? void 0 : _separated_x1.value) != null && separated.x.value !== 0) {
|
|
1038
1909
|
result['x'] = [
|
|
1039
|
-
|
|
1910
|
+
ValueType.CONSTANT,
|
|
1040
1911
|
separated.x.value
|
|
1041
1912
|
];
|
|
1042
1913
|
hasX = true;
|
|
@@ -1045,14 +1916,14 @@ function buildRotationAnim(transform, timeContext) {
|
|
|
1045
1916
|
var curves2 = irScalarKeyframesToGE(separated.y, timeContext);
|
|
1046
1917
|
if (curves2 != null) {
|
|
1047
1918
|
result['y'] = [
|
|
1048
|
-
|
|
1919
|
+
ValueType.BEZIER_CURVE,
|
|
1049
1920
|
curves2[0]
|
|
1050
1921
|
];
|
|
1051
1922
|
hasY = true;
|
|
1052
1923
|
}
|
|
1053
1924
|
} else if ((separated == null ? void 0 : (_separated_y1 = separated.y) == null ? void 0 : _separated_y1.value) != null && separated.y.value !== 0) {
|
|
1054
1925
|
result['y'] = [
|
|
1055
|
-
|
|
1926
|
+
ValueType.CONSTANT,
|
|
1056
1927
|
separated.y.value
|
|
1057
1928
|
];
|
|
1058
1929
|
hasY = true;
|
|
@@ -1061,14 +1932,14 @@ function buildRotationAnim(transform, timeContext) {
|
|
|
1061
1932
|
var curves3 = irScalarKeyframesToGE(separated.z, timeContext);
|
|
1062
1933
|
if (curves3 != null) {
|
|
1063
1934
|
result['z'] = [
|
|
1064
|
-
|
|
1935
|
+
ValueType.BEZIER_CURVE,
|
|
1065
1936
|
curves3[0]
|
|
1066
1937
|
];
|
|
1067
1938
|
hasZ = true;
|
|
1068
1939
|
}
|
|
1069
1940
|
} else if ((separated == null ? void 0 : (_separated_z1 = separated.z) == null ? void 0 : _separated_z1.value) != null && separated.z.value !== 0) {
|
|
1070
1941
|
result['z'] = [
|
|
1071
|
-
|
|
1942
|
+
ValueType.CONSTANT,
|
|
1072
1943
|
separated.z.value
|
|
1073
1944
|
];
|
|
1074
1945
|
hasZ = true;
|
|
@@ -1108,16 +1979,16 @@ function buildSizeAnim(transform, timeContext) {
|
|
|
1108
1979
|
return _extends({
|
|
1109
1980
|
separateAxes: true,
|
|
1110
1981
|
x: [
|
|
1111
|
-
|
|
1982
|
+
ValueType.BEZIER_CURVE,
|
|
1112
1983
|
curves[0]
|
|
1113
1984
|
],
|
|
1114
1985
|
y: [
|
|
1115
|
-
|
|
1986
|
+
ValueType.BEZIER_CURVE,
|
|
1116
1987
|
curves[1]
|
|
1117
1988
|
]
|
|
1118
1989
|
}, curves.length >= 3 && {
|
|
1119
1990
|
z: [
|
|
1120
|
-
|
|
1991
|
+
ValueType.BEZIER_CURVE,
|
|
1121
1992
|
curves[2]
|
|
1122
1993
|
]
|
|
1123
1994
|
});
|
|
@@ -1130,15 +2001,15 @@ function buildSizeAnim(transform, timeContext) {
|
|
|
1130
2001
|
return {
|
|
1131
2002
|
separateAxes: true,
|
|
1132
2003
|
x: [
|
|
1133
|
-
|
|
2004
|
+
ValueType.CONSTANT,
|
|
1134
2005
|
scale[0]
|
|
1135
2006
|
],
|
|
1136
2007
|
y: [
|
|
1137
|
-
|
|
2008
|
+
ValueType.CONSTANT,
|
|
1138
2009
|
scale[1]
|
|
1139
2010
|
],
|
|
1140
2011
|
z: [
|
|
1141
|
-
|
|
2012
|
+
ValueType.CONSTANT,
|
|
1142
2013
|
(_scale_ = scale[2]) != null ? _scale_ : 1
|
|
1143
2014
|
]
|
|
1144
2015
|
};
|
|
@@ -1159,7 +2030,7 @@ function buildColorAnimation(layer, ir) {
|
|
|
1159
2030
|
if (timeContext.endFrame - timeContext.startFrame <= 0) {
|
|
1160
2031
|
return {
|
|
1161
2032
|
opacity: [
|
|
1162
|
-
|
|
2033
|
+
ValueType.CONSTANT,
|
|
1163
2034
|
0
|
|
1164
2035
|
]
|
|
1165
2036
|
};
|
|
@@ -1169,7 +2040,7 @@ function buildColorAnimation(layer, ir) {
|
|
|
1169
2040
|
if (curves != null) {
|
|
1170
2041
|
return {
|
|
1171
2042
|
opacity: [
|
|
1172
|
-
|
|
2043
|
+
ValueType.BEZIER_CURVE,
|
|
1173
2044
|
curves[0]
|
|
1174
2045
|
]
|
|
1175
2046
|
};
|
|
@@ -1180,7 +2051,7 @@ function buildColorAnimation(layer, ir) {
|
|
|
1180
2051
|
if (typeof opacityValue === 'number' && opacityValue !== 1) {
|
|
1181
2052
|
return {
|
|
1182
2053
|
opacity: [
|
|
1183
|
-
|
|
2054
|
+
ValueType.CONSTANT,
|
|
1184
2055
|
opacityValue
|
|
1185
2056
|
]
|
|
1186
2057
|
};
|
|
@@ -1525,7 +2396,7 @@ function mapShapePaint(paint, ratio, ctx) {
|
|
|
1525
2396
|
return _extends({
|
|
1526
2397
|
type: FILL_TYPE_TO_GE[paint.type],
|
|
1527
2398
|
gradientStops: [
|
|
1528
|
-
|
|
2399
|
+
ValueType.GRADIENT_COLOR,
|
|
1529
2400
|
paint.gradientStops
|
|
1530
2401
|
],
|
|
1531
2402
|
startPoint: vec2ToGE(paint.gradientStart, ratio),
|
|
@@ -2177,7 +3048,7 @@ var DEFAULT_PLAYER_VERSION = {
|
|
|
2177
3048
|
};
|
|
2178
3049
|
}
|
|
2179
3050
|
return {
|
|
2180
|
-
version:
|
|
3051
|
+
version: JSONSceneVersion['3_6'],
|
|
2181
3052
|
playerVersion: DEFAULT_PLAYER_VERSION,
|
|
2182
3053
|
images: collector.images,
|
|
2183
3054
|
fonts: [],
|
|
@@ -2789,7 +3660,8 @@ function advanceTransformOnlyParentLinkParents(items, itemById, processedByItemI
|
|
|
2789
3660
|
}
|
|
2790
3661
|
}
|
|
2791
3662
|
// Merge all parent IDs that need adjustment.
|
|
2792
|
-
|
|
3663
|
+
// Materialize Map iterators: loose SWC array-spread lowering assumes arrays.
|
|
3664
|
+
var allParentIds = new Set([].concat(Array.from(parentAdvanceMap.keys()), Array.from(parentExtendMap.keys())));
|
|
2793
3665
|
// Apply adjustments: update parent item delay/duration and sync ActivationTrack clips.
|
|
2794
3666
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(allParentIds), _step1; !(_step1 = _iterator1()).done;){
|
|
2795
3667
|
var parentId1 = _step1.value;
|
|
@@ -2939,10 +3811,58 @@ function applyVisibilityStep(ir, state) {
|
|
|
2939
3811
|
});
|
|
2940
3812
|
}
|
|
2941
3813
|
|
|
3814
|
+
var OMIT = Symbol('omit-json-value');
|
|
3815
|
+
/** Return a detached value whose runtime shape is stable across JSON persistence. */ function normalizeJsonValue(value) {
|
|
3816
|
+
var normalized = normalize(value, '$', false);
|
|
3817
|
+
if (normalized === OMIT) {
|
|
3818
|
+
throw new TypeError('[ge-ir] A top-level JSON value cannot be undefined.');
|
|
3819
|
+
}
|
|
3820
|
+
return normalized;
|
|
3821
|
+
}
|
|
3822
|
+
function normalize(value, path, inArray) {
|
|
3823
|
+
if (value === undefined) {
|
|
3824
|
+
return inArray ? null : OMIT;
|
|
3825
|
+
}
|
|
3826
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean') {
|
|
3827
|
+
return value;
|
|
3828
|
+
}
|
|
3829
|
+
if (typeof value === 'number') {
|
|
3830
|
+
if (!Number.isFinite(value)) {
|
|
3831
|
+
throw new TypeError("[ge-ir] Non-finite number at " + path + " is not JSON-compatible.");
|
|
3832
|
+
}
|
|
3833
|
+
return Object.is(value, -0) ? 0 : value;
|
|
3834
|
+
}
|
|
3835
|
+
if (Array.isArray(value)) {
|
|
3836
|
+
return value.map(function(item, index) {
|
|
3837
|
+
var normalizedItem = normalize(item, path + "[" + index + "]", true);
|
|
3838
|
+
if (normalizedItem === OMIT) {
|
|
3839
|
+
throw new TypeError("[ge-ir] Array item at " + path + "[" + index + "] could not be normalized.");
|
|
3840
|
+
}
|
|
3841
|
+
return normalizedItem;
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) !== 'object') {
|
|
3845
|
+
throw new TypeError("[ge-ir] " + (typeof value === "undefined" ? "undefined" : _type_of(value)) + " at " + path + " is not JSON-compatible.");
|
|
3846
|
+
}
|
|
3847
|
+
var prototype = Reflect.getPrototypeOf(value);
|
|
3848
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
3849
|
+
throw new TypeError("[ge-ir] Non-plain object at " + path + " is not JSON-compatible.");
|
|
3850
|
+
}
|
|
3851
|
+
var result = {};
|
|
3852
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(Object.entries(value)), _step; !(_step = _iterator()).done;){
|
|
3853
|
+
var _step_value = _step.value, key = _step_value[0], item = _step_value[1];
|
|
3854
|
+
var normalizedItem = normalize(item, path + "." + key, false);
|
|
3855
|
+
if (normalizedItem !== OMIT) {
|
|
3856
|
+
result[key] = normalizedItem;
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
return result;
|
|
3860
|
+
}
|
|
3861
|
+
|
|
2942
3862
|
/**
|
|
2943
3863
|
* Convert an IR composition to a GE JSONScene.
|
|
2944
3864
|
*
|
|
2945
|
-
* All IR sources (lottie,
|
|
3865
|
+
* All IR sources (lottie, dsl, future) go through this single unified
|
|
2946
3866
|
* pipeline. Source-specific features are gated by data existence (e.g. mask,
|
|
2947
3867
|
* precomp, shape layers are absent in dsl IR and naturally skipped);
|
|
2948
3868
|
* `ir.source` branches are used only for B-class real semantic differences
|
|
@@ -3029,7 +3949,7 @@ function applyVisibilityStep(ir, state) {
|
|
|
3029
3949
|
});
|
|
3030
3950
|
collector.items.reverse();
|
|
3031
3951
|
processedItems.reverse();
|
|
3032
|
-
return mergePreservedPrecompScene(assembleScene(workingIR, collector, processedItems, duration), workingIR);
|
|
3952
|
+
return normalizeJsonValue(mergePreservedPrecompScene(assembleScene(workingIR, collector, processedItems, duration), workingIR));
|
|
3033
3953
|
}
|
|
3034
3954
|
function processLayer(layer, ctx) {
|
|
3035
3955
|
if (layer.type === 'precomp') {
|
|
@@ -3282,10 +4202,7 @@ function indexById(entries) {
|
|
|
3282
4202
|
return map;
|
|
3283
4203
|
}
|
|
3284
4204
|
function cloneJson$1(value) {
|
|
3285
|
-
|
|
3286
|
-
return value;
|
|
3287
|
-
}
|
|
3288
|
-
return JSON.parse(JSON.stringify(value));
|
|
4205
|
+
return normalizeJsonValue(value);
|
|
3289
4206
|
}
|
|
3290
4207
|
function isRecord$2(value) {
|
|
3291
4208
|
return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && !Array.isArray(value);
|
|
@@ -4077,7 +4994,8 @@ function parseScaleAnimation(sizeOverLifetime, startFrame, endFrame) {
|
|
|
4077
4994
|
var kf2 = _step2.value;
|
|
4078
4995
|
allTimes.add(kf2.t);
|
|
4079
4996
|
}
|
|
4080
|
-
|
|
4997
|
+
// Keep Array.from: loose SWC array-spread lowering does not expand Set in dist.
|
|
4998
|
+
var sortedTimes = Array.from(allTimes).sort(function(a, b) {
|
|
4081
4999
|
return a - b;
|
|
4082
5000
|
});
|
|
4083
5001
|
var keyframes = sortedTimes.map(function(t) {
|
|
@@ -4846,7 +5764,7 @@ function convertGEToIR(scene, options) {
|
|
|
4846
5764
|
var layers = merged.map(function(d) {
|
|
4847
5765
|
return d.layer;
|
|
4848
5766
|
});
|
|
4849
|
-
return {
|
|
5767
|
+
return normalizeJsonValue({
|
|
4850
5768
|
source: 'ge',
|
|
4851
5769
|
name: ctx.compositionName,
|
|
4852
5770
|
width: ctx.width,
|
|
@@ -4858,7 +5776,7 @@ function convertGEToIR(scene, options) {
|
|
|
4858
5776
|
endBehavior: ctx.endBehavior,
|
|
4859
5777
|
layers: layers,
|
|
4860
5778
|
metadata: buildCompositionMetadata(scene, ctx.compositionId, itemIds, ctx)
|
|
4861
|
-
};
|
|
5779
|
+
});
|
|
4862
5780
|
}
|
|
4863
5781
|
function parseItemToLayer(item, itemId, index, ctx) {
|
|
4864
5782
|
var _item_name, _item_visible, _ref, _item_delay, _ref1, _item_duration;
|
|
@@ -5115,7 +6033,7 @@ function hasPrecompItem(itemIds, ctx) {
|
|
|
5115
6033
|
});
|
|
5116
6034
|
}
|
|
5117
6035
|
function cloneJson(value) {
|
|
5118
|
-
return
|
|
6036
|
+
return normalizeJsonValue(value);
|
|
5119
6037
|
}
|
|
5120
6038
|
function isRecord(value) {
|
|
5121
6039
|
return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && !Array.isArray(value);
|