@galacean/effects-specification 2.0.0-alpha.6 → 2.0.0-alpha.7

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/fallback.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @galacean/effects-specification
3
3
  * Description: Galacean Effects JSON Specification
4
4
  * Author: Ant Group CO., Ltd.
5
- * Version: v2.0.0-alpha.6
5
+ * Version: v2.0.0-alpha.7
6
6
  */
7
7
 
8
8
  /******************************************************************************
@@ -374,10 +374,6 @@ var ItemType;
374
374
  * 预合成元素
375
375
  */
376
376
  ItemType["composition"] = "7";
377
- /**
378
- * 滤镜图层
379
- */
380
- ItemType["filter"] = "8";
381
377
  /**
382
378
  * Spine 元素
383
379
  */
@@ -526,7 +522,7 @@ var CompositionEndBehavior;
526
522
 
527
523
  /**
528
524
  * 动态换图类型
529
- * @since 1.3.0
525
+ * @since 1.1.0
530
526
  */
531
527
  var BackgroundType;
532
528
  (function (BackgroundType) {
@@ -1218,14 +1214,6 @@ function getStandardParticleContent(particle) {
1218
1214
  ret.options.startRotationX = ensureNumberExpression(options.startRotationX);
1219
1215
  ret.options.startRotationY = ensureNumberExpression(options.startRotationY);
1220
1216
  }
1221
- if (particle.filter) {
1222
- var filter_1 = {};
1223
- forEach(particle.filter, function (val, key) {
1224
- // @ts-expect-error
1225
- filter_1[key] = ensureValueGetter(val);
1226
- });
1227
- ret.filter = filter_1;
1228
- }
1229
1217
  if (transform && transform.path) {
1230
1218
  ret.emitterTransform = {
1231
1219
  path: ensureFixedVec3(transform.path),
@@ -1509,36 +1497,6 @@ function getStandardCameraContent(model) {
1509
1497
  return ret;
1510
1498
  }
1511
1499
 
1512
- var convertParams = [
1513
- 'strength',
1514
- 'bloomAddon',
1515
- 'colorAddon',
1516
- 'period',
1517
- 'waveMovement',
1518
- 'colorThreshold',
1519
- 'xOpacity',
1520
- 'yOpacity',
1521
- 'feather',
1522
- ];
1523
- var pathParams = [
1524
- 'path', 'position',
1525
- ];
1526
- function getStandardFilterContent(filter) {
1527
- var ret = {};
1528
- forEach(filter, function (val, key) {
1529
- if (convertParams.includes(key)) {
1530
- ret[key] = ensureFixedNumber(val);
1531
- }
1532
- else if (pathParams.includes(key)) {
1533
- ret[key] = ensureFixedVec3(val);
1534
- }
1535
- else {
1536
- ret[key] = val;
1537
- }
1538
- });
1539
- return ret;
1540
- }
1541
-
1542
1500
  /**
1543
1501
  * 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
1544
1502
  */
@@ -1603,14 +1561,28 @@ function version30Migration(json) {
1603
1561
  if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
1604
1562
  composition.endBehavior = END_BEHAVIOR_FREEZE;
1605
1563
  }
1564
+ // 过滤掉滤镜元素
1565
+ composition.items = composition.items.filter(function (item) { return item.type !== '8'; });
1566
+ // 过滤掉粒子滤镜(扭曲)
1567
+ composition.items.forEach(function (item) {
1568
+ if (item.type === ItemType.particle) {
1569
+ // @ts-expect-error
1570
+ var filterData = item.content['filter'];
1571
+ if (filterData) {
1572
+ // @ts-expect-error
1573
+ delete item.content['filter'];
1574
+ }
1575
+ }
1576
+ });
1577
+ var itemGuidMap_1 = {};
1606
1578
  try {
1607
1579
  for (var _r = (e_3 = void 0, __values(composition.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
1608
1580
  var item = _s.value;
1609
- itemGuidMap[item.id] = generateGUID();
1581
+ itemGuidMap_1[item.id] = generateGUID();
1610
1582
  // TODO: 编辑器测试用,上线后删除
1611
1583
  //@ts-expect-error
1612
1584
  item.oldId = item.id;
1613
- item.id = itemGuidMap[item.id];
1585
+ item.id = itemGuidMap_1[item.id];
1614
1586
  }
1615
1587
  }
1616
1588
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -1625,10 +1597,10 @@ function version30Migration(json) {
1625
1597
  if (item.parentId.includes('^')) {
1626
1598
  var parentId = (item.parentId).split('^')[0];
1627
1599
  var nodeId = (item.parentId).split('^')[1];
1628
- item.parentId = itemGuidMap[parentId] + '^' + nodeId;
1600
+ item.parentId = itemGuidMap_1[parentId] + '^' + nodeId;
1629
1601
  }
1630
1602
  else {
1631
- item.parentId = itemGuidMap[item.parentId];
1603
+ item.parentId = itemGuidMap_1[item.parentId];
1632
1604
  }
1633
1605
  }
1634
1606
  // @ts-expect-error fix item type
@@ -1965,14 +1937,6 @@ function getStandardItem(item, opt) {
1965
1937
  duration = item.duration;
1966
1938
  }
1967
1939
  transform = item.transform || getTransform(originContent.transform);
1968
- if (type === ItemType.filter) {
1969
- if (currentVersion < '1.1') {
1970
- currentVersion = '1.1';
1971
- }
1972
- content = getStandardSpriteContent(originContent, transform);
1973
- // @ts-expect-error
1974
- content.filter = getStandardFilterContent(originContent.filter);
1975
- }
1976
1940
  }
1977
1941
  else if (item.particle) {
1978
1942
  type = ItemType.particle;