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