@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.4
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/index.d.ts +2 -2
- package/dist/fallback.js +173 -195
- package/dist/fallback.js.map +1 -1
- package/dist/fallback.mjs +173 -195
- package/dist/fallback.mjs.map +1 -1
- package/dist/index.js +42 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -2
- package/dist/index.mjs.map +1 -1
- package/dist/src/components.d.ts +38 -0
- package/dist/src/image.d.ts +9 -4
- package/dist/src/index.d.ts +1 -0
- package/dist/src/item/effect-item.d.ts +20 -2
- package/dist/src/item/model/mesh.d.ts +3 -3
- package/dist/src/scene.d.ts +2 -1
- package/dist/src/type.d.ts +20 -4
- package/dist/src/vfx-item-data.d.ts +2 -2
- package/package.json +2 -2
package/dist/fallback.mjs
CHANGED
|
@@ -2,9 +2,79 @@
|
|
|
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.
|
|
5
|
+
* Version: v2.0.0-alpha.4
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/******************************************************************************
|
|
9
|
+
Copyright (c) Microsoft Corporation.
|
|
10
|
+
|
|
11
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12
|
+
purpose with or without fee is hereby granted.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
+
***************************************************************************** */
|
|
22
|
+
|
|
23
|
+
var __assign = function() {
|
|
24
|
+
__assign = Object.assign || function __assign(t) {
|
|
25
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
26
|
+
s = arguments[i];
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
31
|
+
return __assign.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function __values(o) {
|
|
35
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
36
|
+
if (m) return m.call(o);
|
|
37
|
+
if (o && typeof o.length === "number") return {
|
|
38
|
+
next: function () {
|
|
39
|
+
if (o && i >= o.length) o = void 0;
|
|
40
|
+
return { value: o && o[i++], done: !o };
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function __read(o, n) {
|
|
47
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
48
|
+
if (!m) return o;
|
|
49
|
+
var i = m.call(o), r, ar = [], e;
|
|
50
|
+
try {
|
|
51
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
52
|
+
}
|
|
53
|
+
catch (error) { e = { error: error }; }
|
|
54
|
+
finally {
|
|
55
|
+
try {
|
|
56
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
57
|
+
}
|
|
58
|
+
finally { if (e) throw e.error; }
|
|
59
|
+
}
|
|
60
|
+
return ar;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function __spreadArray(to, from, pack) {
|
|
64
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
65
|
+
if (ar || !(i in from)) {
|
|
66
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
67
|
+
ar[i] = from[i];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
74
|
+
var e = new Error(message);
|
|
75
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
76
|
+
};
|
|
77
|
+
|
|
8
78
|
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
9
79
|
var native = {
|
|
10
80
|
randomUUID
|
|
@@ -454,6 +524,16 @@ var CompositionEndBehavior;
|
|
|
454
524
|
CompositionEndBehavior[CompositionEndBehavior["freeze"] = END_BEHAVIOR_FREEZE] = "freeze";
|
|
455
525
|
})(CompositionEndBehavior || (CompositionEndBehavior = {}));
|
|
456
526
|
|
|
527
|
+
/**
|
|
528
|
+
* 动态换图类型
|
|
529
|
+
* @since 1.3.0
|
|
530
|
+
*/
|
|
531
|
+
var BackgroundType;
|
|
532
|
+
(function (BackgroundType) {
|
|
533
|
+
BackgroundType["video"] = "video";
|
|
534
|
+
BackgroundType["image"] = "image";
|
|
535
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
536
|
+
|
|
457
537
|
/*********************************************/
|
|
458
538
|
/* 基本数值属性参数 */
|
|
459
539
|
/*********************************************/
|
|
@@ -786,76 +866,37 @@ var DataType;
|
|
|
786
866
|
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
787
867
|
DataType["TreeComponent"] = "TreeComponent";
|
|
788
868
|
})(DataType || (DataType = {}));
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
next: function () {
|
|
821
|
-
if (o && i >= o.length) o = void 0;
|
|
822
|
-
return { value: o && o[i++], done: !o };
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
function __read(o, n) {
|
|
829
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
830
|
-
if (!m) return o;
|
|
831
|
-
var i = m.call(o), r, ar = [], e;
|
|
832
|
-
try {
|
|
833
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
834
|
-
}
|
|
835
|
-
catch (error) { e = { error: error }; }
|
|
836
|
-
finally {
|
|
837
|
-
try {
|
|
838
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
839
|
-
}
|
|
840
|
-
finally { if (e) throw e.error; }
|
|
841
|
-
}
|
|
842
|
-
return ar;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
function __spreadArray(to, from, pack) {
|
|
846
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
847
|
-
if (ar || !(i in from)) {
|
|
848
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
849
|
-
ar[i] = from[i];
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
856
|
-
var e = new Error(message);
|
|
857
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
858
|
-
};
|
|
869
|
+
var GeometryType;
|
|
870
|
+
(function (GeometryType) {
|
|
871
|
+
/**
|
|
872
|
+
* Draw single points.
|
|
873
|
+
*/
|
|
874
|
+
GeometryType[GeometryType["POINTS"] = 0] = "POINTS";
|
|
875
|
+
/**
|
|
876
|
+
* Draw lines. Each vertex connects to the one after it.
|
|
877
|
+
*/
|
|
878
|
+
GeometryType[GeometryType["LINES"] = 1] = "LINES";
|
|
879
|
+
/**
|
|
880
|
+
* Draw lines. Each set of two vertices is treated as a separate line segment.
|
|
881
|
+
*/
|
|
882
|
+
GeometryType[GeometryType["LINE_LOOP"] = 2] = "LINE_LOOP";
|
|
883
|
+
/**
|
|
884
|
+
* Draw a connected group of line segments from the first vertex to the last.
|
|
885
|
+
*/
|
|
886
|
+
GeometryType[GeometryType["LINE_STRIP"] = 3] = "LINE_STRIP";
|
|
887
|
+
/**
|
|
888
|
+
* Draw triangles. Each set of three vertices creates a separate triangle.
|
|
889
|
+
*/
|
|
890
|
+
GeometryType[GeometryType["TRIANGLES"] = 4] = "TRIANGLES";
|
|
891
|
+
/**
|
|
892
|
+
* Draw a connected strip of triangles.
|
|
893
|
+
*/
|
|
894
|
+
GeometryType[GeometryType["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP";
|
|
895
|
+
/**
|
|
896
|
+
* Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
|
|
897
|
+
*/
|
|
898
|
+
GeometryType[GeometryType["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN";
|
|
899
|
+
})(GeometryType || (GeometryType = {}));
|
|
859
900
|
|
|
860
901
|
var _a;
|
|
861
902
|
function arrAdd(arr, item) {
|
|
@@ -1537,21 +1578,14 @@ function version22Migration(json) {
|
|
|
1537
1578
|
*/
|
|
1538
1579
|
function version30Migration(json) {
|
|
1539
1580
|
var e_1, _a;
|
|
1540
|
-
var _b, _c, _d, _e;
|
|
1541
|
-
var result =
|
|
1542
|
-
items: [],
|
|
1543
|
-
components: [],
|
|
1544
|
-
materials: [],
|
|
1545
|
-
shaders: [],
|
|
1546
|
-
geometries: [],
|
|
1547
|
-
});
|
|
1581
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1582
|
+
var result = __assign(__assign({}, json), { items: [], components: [], materials: [], shaders: [], geometries: [] });
|
|
1548
1583
|
// 兼容老版本数据中不存在textures的情况
|
|
1549
1584
|
(_b = result.textures) !== null && _b !== void 0 ? _b : (result.textures = []);
|
|
1550
1585
|
result.textures.forEach(function (textureOptions) {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
dataType: DataType.Texture
|
|
1554
|
-
});
|
|
1586
|
+
textureOptions = __assign(__assign({}, textureOptions), {
|
|
1587
|
+
// @ts-expect-error
|
|
1588
|
+
id: generateGUID(), dataType: DataType.Texture });
|
|
1555
1589
|
});
|
|
1556
1590
|
if (result.textures.length < result.images.length) {
|
|
1557
1591
|
for (var i = result.textures.length; i < result.images.length; i++) {
|
|
@@ -1565,15 +1599,15 @@ function version30Migration(json) {
|
|
|
1565
1599
|
}
|
|
1566
1600
|
}
|
|
1567
1601
|
var _loop_1 = function (composition) {
|
|
1568
|
-
var e_2,
|
|
1602
|
+
var e_2, _m, e_3, _o;
|
|
1569
1603
|
// composition 的 endbehaviour 兼容
|
|
1570
1604
|
if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
1571
1605
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
1572
1606
|
}
|
|
1573
1607
|
var itemGuidMap = {};
|
|
1574
1608
|
try {
|
|
1575
|
-
for (var
|
|
1576
|
-
var item =
|
|
1609
|
+
for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1610
|
+
var item = _q.value;
|
|
1577
1611
|
itemGuidMap[item.id] = generateGUID();
|
|
1578
1612
|
// TODO: 编辑器测试用,上线后删除
|
|
1579
1613
|
//@ts-expect-error
|
|
@@ -1584,7 +1618,7 @@ function version30Migration(json) {
|
|
|
1584
1618
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1585
1619
|
finally {
|
|
1586
1620
|
try {
|
|
1587
|
-
if (
|
|
1621
|
+
if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
|
|
1588
1622
|
}
|
|
1589
1623
|
finally { if (e_2) throw e_2.error; }
|
|
1590
1624
|
}
|
|
@@ -1605,8 +1639,8 @@ function version30Migration(json) {
|
|
|
1605
1639
|
composition.items[index] = { id: item.id };
|
|
1606
1640
|
});
|
|
1607
1641
|
try {
|
|
1608
|
-
for (var
|
|
1609
|
-
var item =
|
|
1642
|
+
for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1643
|
+
var item = _s.value;
|
|
1610
1644
|
// 原 texture 索引转为统一 guid 索引
|
|
1611
1645
|
if (item.content) {
|
|
1612
1646
|
if (item.content.renderer) {
|
|
@@ -1635,7 +1669,7 @@ function version30Migration(json) {
|
|
|
1635
1669
|
Object.assign(item, {
|
|
1636
1670
|
transform: {
|
|
1637
1671
|
position: { x: position[0], y: position[1], z: position[2] },
|
|
1638
|
-
|
|
1672
|
+
eulerHint: { x: rotation[0], y: rotation[1], z: rotation[2] },
|
|
1639
1673
|
scale: { x: scale[0], y: scale[1], z: scale[0] },
|
|
1640
1674
|
},
|
|
1641
1675
|
});
|
|
@@ -1655,13 +1689,10 @@ function version30Migration(json) {
|
|
|
1655
1689
|
var startSize = item.transform.size;
|
|
1656
1690
|
// 兼容旧JSON(anchor和particleOrigin可能同时存在)
|
|
1657
1691
|
if (!renderer.anchor && renderer.particleOrigin !== undefined) {
|
|
1658
|
-
|
|
1659
|
-
item.transform.position.
|
|
1660
|
-
//@ts-expect-error
|
|
1661
|
-
item.transform.position.y += -realAnchor[1] * startSize.y;
|
|
1692
|
+
item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
|
|
1693
|
+
item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
|
|
1662
1694
|
}
|
|
1663
|
-
|
|
1664
|
-
item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
|
|
1695
|
+
item.transform.anchor = { x: realAnchor[0] * ((_h = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _h !== void 0 ? _h : 1), y: realAnchor[1] * ((_j = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _j !== void 0 ? _j : 1) };
|
|
1665
1696
|
}
|
|
1666
1697
|
}
|
|
1667
1698
|
if (item.type === ItemType.particle) {
|
|
@@ -1708,127 +1739,76 @@ function version30Migration(json) {
|
|
|
1708
1739
|
}
|
|
1709
1740
|
// item 的 content 转为 component data 加入 JSONScene.components
|
|
1710
1741
|
var uuid = generateGUID();
|
|
1711
|
-
if (item.type === ItemType.sprite
|
|
1742
|
+
if (item.type === ItemType.sprite ||
|
|
1743
|
+
item.type === ItemType.particle ||
|
|
1744
|
+
item.type === ItemType.mesh ||
|
|
1745
|
+
item.type === ItemType.skybox ||
|
|
1746
|
+
item.type === ItemType.light ||
|
|
1747
|
+
item.type === 'camera' ||
|
|
1748
|
+
item.type === ItemType.tree ||
|
|
1749
|
+
item.type === ItemType.interact ||
|
|
1750
|
+
item.type === ItemType.camera ||
|
|
1751
|
+
item.type === ItemType.text) {
|
|
1712
1752
|
item.components = [];
|
|
1713
1753
|
result.components.push(item.content);
|
|
1714
1754
|
item.content.id = uuid;
|
|
1715
|
-
item.content.dataType = DataType.SpriteComponent;
|
|
1716
1755
|
item.content.item = { id: item.id };
|
|
1717
1756
|
item.dataType = DataType.VFXItemData;
|
|
1718
|
-
//@ts-expect-error
|
|
1719
|
-
item.components.push({ id: item.content.id });
|
|
1720
|
-
}
|
|
1721
|
-
else if (item.type === ItemType.particle) {
|
|
1722
|
-
item.components = [];
|
|
1723
|
-
result.components.push(item.content);
|
|
1724
|
-
item.content.id = uuid;
|
|
1725
|
-
item.content.dataType = DataType.ParticleSystem;
|
|
1726
|
-
item.content.item = { id: item.id };
|
|
1727
|
-
item.dataType = DataType.VFXItemData;
|
|
1728
|
-
//@ts-expect-error
|
|
1729
1757
|
item.components.push({ id: item.content.id });
|
|
1730
1758
|
}
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
item.components = [];
|
|
1763
|
-
result.components.push(item.content);
|
|
1764
|
-
item.content.id = uuid;
|
|
1765
|
-
item.content.dataType = DataType.CameraComponent;
|
|
1766
|
-
item.content.item = { id: item.id };
|
|
1767
|
-
item.dataType = DataType.VFXItemData;
|
|
1768
|
-
//@ts-expect-error
|
|
1769
|
-
item.components.push({ id: item.content.id });
|
|
1770
|
-
}
|
|
1771
|
-
else if (item.type === ItemType.tree) {
|
|
1772
|
-
item.components = [];
|
|
1773
|
-
result.components.push(item.content);
|
|
1774
|
-
item.content.id = uuid;
|
|
1775
|
-
item.content.dataType = DataType.TreeComponent;
|
|
1776
|
-
item.content.item = { id: item.id };
|
|
1777
|
-
item.dataType = DataType.VFXItemData;
|
|
1778
|
-
//@ts-expect-error
|
|
1779
|
-
item.components.push({ id: item.content.id });
|
|
1780
|
-
}
|
|
1781
|
-
else if (item.type === ItemType.interact) {
|
|
1782
|
-
item.components = [];
|
|
1783
|
-
result.components.push(item.content);
|
|
1784
|
-
item.content.id = uuid;
|
|
1785
|
-
item.content.dataType = DataType.InteractComponent;
|
|
1786
|
-
item.content.item = { id: item.id };
|
|
1787
|
-
item.dataType = DataType.VFXItemData;
|
|
1788
|
-
//@ts-expect-error
|
|
1789
|
-
item.components.push({ id: item.content.id });
|
|
1790
|
-
}
|
|
1791
|
-
else if (item.type === ItemType.camera) {
|
|
1792
|
-
item.components = [];
|
|
1793
|
-
result.components.push(item.content);
|
|
1794
|
-
item.content.id = uuid;
|
|
1795
|
-
item.content.dataType = DataType.CameraController;
|
|
1796
|
-
item.content.item = { id: item.id };
|
|
1797
|
-
item.dataType = DataType.VFXItemData;
|
|
1798
|
-
//@ts-expect-error
|
|
1799
|
-
item.components.push({ id: item.content.id });
|
|
1800
|
-
}
|
|
1801
|
-
else if (item.type === ItemType.text) {
|
|
1802
|
-
item.components = [];
|
|
1803
|
-
result.components.push(item.content);
|
|
1804
|
-
item.content.id = uuid;
|
|
1805
|
-
item.content.dataType = DataType.TextComponent;
|
|
1806
|
-
item.content.item = { id: item.id };
|
|
1807
|
-
item.dataType = DataType.VFXItemData;
|
|
1808
|
-
//@ts-expect-error
|
|
1809
|
-
item.components.push({ id: item.content.id });
|
|
1759
|
+
switch (item.type) {
|
|
1760
|
+
case ItemType.sprite:
|
|
1761
|
+
item.content.dataType = DataType.SpriteComponent;
|
|
1762
|
+
break;
|
|
1763
|
+
case ItemType.particle:
|
|
1764
|
+
item.content.dataType = DataType.ParticleSystem;
|
|
1765
|
+
break;
|
|
1766
|
+
case ItemType.mesh:
|
|
1767
|
+
item.content.dataType = DataType.MeshComponent;
|
|
1768
|
+
break;
|
|
1769
|
+
case ItemType.skybox:
|
|
1770
|
+
item.content.dataType = DataType.SkyboxComponent;
|
|
1771
|
+
break;
|
|
1772
|
+
case ItemType.light:
|
|
1773
|
+
item.content.dataType = DataType.LightComponent;
|
|
1774
|
+
break;
|
|
1775
|
+
case 'camera':
|
|
1776
|
+
item.content.dataType = DataType.CameraComponent;
|
|
1777
|
+
break;
|
|
1778
|
+
case ItemType.tree:
|
|
1779
|
+
item.content.dataType = DataType.TreeComponent;
|
|
1780
|
+
break;
|
|
1781
|
+
case ItemType.interact:
|
|
1782
|
+
item.content.dataType = DataType.InteractComponent;
|
|
1783
|
+
break;
|
|
1784
|
+
case ItemType.camera:
|
|
1785
|
+
item.content.dataType = DataType.CameraController;
|
|
1786
|
+
break;
|
|
1787
|
+
case ItemType.text:
|
|
1788
|
+
item.content.dataType = DataType.TextComponent;
|
|
1789
|
+
break;
|
|
1810
1790
|
}
|
|
1811
1791
|
}
|
|
1812
1792
|
}
|
|
1813
1793
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1814
1794
|
finally {
|
|
1815
1795
|
try {
|
|
1816
|
-
if (
|
|
1796
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
1817
1797
|
}
|
|
1818
1798
|
finally { if (e_3) throw e_3.error; }
|
|
1819
1799
|
}
|
|
1820
1800
|
};
|
|
1821
1801
|
try {
|
|
1822
1802
|
// 更正Composition.endBehavior
|
|
1823
|
-
for (var
|
|
1824
|
-
var composition =
|
|
1803
|
+
for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
1804
|
+
var composition = _l.value;
|
|
1825
1805
|
_loop_1(composition);
|
|
1826
1806
|
}
|
|
1827
1807
|
}
|
|
1828
1808
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1829
1809
|
finally {
|
|
1830
1810
|
try {
|
|
1831
|
-
if (
|
|
1811
|
+
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
1832
1812
|
}
|
|
1833
1813
|
finally { if (e_1) throw e_1.error; }
|
|
1834
1814
|
}
|
|
@@ -1928,11 +1908,9 @@ function getStandardImage(image, index, imageTags) {
|
|
|
1928
1908
|
else if (image.url) {
|
|
1929
1909
|
return {
|
|
1930
1910
|
url: image.url,
|
|
1931
|
-
type: image.type,
|
|
1932
1911
|
webp: image.webp,
|
|
1933
1912
|
renderLevel: renderLevel,
|
|
1934
1913
|
oriY: oriY,
|
|
1935
|
-
loop: image.loop,
|
|
1936
1914
|
};
|
|
1937
1915
|
}
|
|
1938
1916
|
else if (image && image.sourceType) {
|
|
@@ -1945,7 +1923,7 @@ function getStandardComposition(composition, opt) {
|
|
|
1945
1923
|
if (opt === void 0) { opt = {}; }
|
|
1946
1924
|
var ret = {
|
|
1947
1925
|
id: composition.id + '',
|
|
1948
|
-
camera:
|
|
1926
|
+
camera: __assign({ clipMode: CAMERA_CLIP_MODE_NORMAL }, composition.camera),
|
|
1949
1927
|
duration: composition.duration,
|
|
1950
1928
|
endBehavior: composition.endBehavior,
|
|
1951
1929
|
items: composition.items.map(function (item) { return getStandardItem(item, opt); }),
|