@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.20

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.
Files changed (104) hide show
  1. package/README.md +2 -10
  2. package/es/animation-clip-data.d.ts +26 -0
  3. package/es/animation-clip-data.js +1 -0
  4. package/{dist/src → es}/binary.d.ts +3 -1
  5. package/es/binary.js +1 -0
  6. package/es/buitin-object-guid.d.ts +5 -0
  7. package/es/buitin-object-guid.js +5 -0
  8. package/es/components.d.ts +204 -0
  9. package/es/components.js +129 -0
  10. package/{dist/src → es}/composition.d.ts +32 -46
  11. package/es/composition.js +42 -0
  12. package/es/constants.js +11 -0
  13. package/{dist/src → es}/image.d.ts +21 -27
  14. package/es/image.js +9 -0
  15. package/{dist/src → es}/index.d.ts +4 -2
  16. package/es/index.js +28 -0
  17. package/{dist/src → es}/item/base-item.d.ts +9 -6
  18. package/es/item/base-item.js +11 -0
  19. package/{dist/src → es}/item/camera-item.d.ts +4 -4
  20. package/es/item/camera-item.js +1 -0
  21. package/{dist/src → es}/item/composition-item.d.ts +2 -2
  22. package/es/item/composition-item.js +1 -0
  23. package/es/item/effect-item.d.ts +35 -0
  24. package/es/item/effect-item.js +1 -0
  25. package/{dist/src → es}/item/interact-item.d.ts +1 -1
  26. package/es/item/interact-item.js +1 -0
  27. package/es/item/model/binary.js +1 -0
  28. package/es/item/model/camera.js +5 -0
  29. package/es/item/model/index.js +35 -0
  30. package/es/item/model/light.js +19 -0
  31. package/{dist/src → es}/item/model/material.d.ts +3 -3
  32. package/es/item/model/material.js +16 -0
  33. package/{dist/src → es}/item/model/mesh.d.ts +7 -6
  34. package/es/item/model/mesh.js +5 -0
  35. package/es/item/model/render.js +42 -0
  36. package/{dist/src → es}/item/model/skybox.d.ts +7 -1
  37. package/es/item/model/skybox.js +1 -0
  38. package/{dist/src → es}/item/model/tree.d.ts +10 -0
  39. package/es/item/model/tree.js +1 -0
  40. package/es/item/null-item.d.ts +46 -0
  41. package/es/item/null-item.js +1 -0
  42. package/{dist/src → es}/item/particle-item.d.ts +18 -21
  43. package/es/item/particle-item.js +14 -0
  44. package/es/item/particle-shape.js +19 -0
  45. package/{dist/src → es}/item/plugin-item.d.ts +1 -1
  46. package/es/item/plugin-item.js +1 -0
  47. package/{dist/src → es}/item/spine-item.d.ts +42 -18
  48. package/es/item/spine-item.js +1 -0
  49. package/{dist/src → es}/item/sprite-item.d.ts +1 -1
  50. package/es/item/sprite-item.js +1 -0
  51. package/{dist/src → es}/item/text-item.d.ts +1 -1
  52. package/es/item/text-item.js +1 -0
  53. package/{dist/src → es}/item.d.ts +2 -5
  54. package/es/item.js +1 -0
  55. package/{dist/src → es}/number-expression.d.ts +21 -8
  56. package/es/number-expression.js +91 -0
  57. package/{dist/src → es}/scene.d.ts +19 -19
  58. package/es/scene.js +1 -0
  59. package/{dist/src → es}/text.d.ts +3 -55
  60. package/es/text.js +84 -0
  61. package/es/timeline/index.d.ts +5 -0
  62. package/es/timeline/index.js +5 -0
  63. package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
  64. package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
  65. package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
  66. package/es/timeline/playables/transform-playable-asset-data.js +1 -0
  67. package/es/timeline/timeline-asset-data.d.ts +8 -0
  68. package/es/timeline/timeline-asset-data.js +1 -0
  69. package/es/timeline/timeline-clip-data.d.ts +9 -0
  70. package/es/timeline/timeline-clip-data.js +1 -0
  71. package/es/timeline/track/track-asset-data.d.ts +9 -0
  72. package/es/timeline/track/track-asset-data.js +1 -0
  73. package/{dist/src → es}/type.d.ts +45 -20
  74. package/es/type.js +342 -0
  75. package/{dist/src → es}/vfx-item-data.d.ts +8 -9
  76. package/es/vfx-item-data.js +1 -0
  77. package/package.json +26 -47
  78. package/dist/fallback/camera.d.ts +0 -2
  79. package/dist/fallback/filter.d.ts +0 -2
  80. package/dist/fallback/index.d.ts +0 -12
  81. package/dist/fallback/interact.d.ts +0 -2
  82. package/dist/fallback/migration.d.ts +0 -13
  83. package/dist/fallback/particle.d.ts +0 -2
  84. package/dist/fallback/sprite.d.ts +0 -3
  85. package/dist/fallback/utils.d.ts +0 -36
  86. package/dist/fallback.js +0 -2155
  87. package/dist/fallback.js.map +0 -1
  88. package/dist/fallback.mjs +0 -2127
  89. package/dist/fallback.mjs.map +0 -1
  90. package/dist/index.js +0 -758
  91. package/dist/index.js.map +0 -1
  92. package/dist/index.mjs +0 -743
  93. package/dist/index.mjs.map +0 -1
  94. package/dist/src/components.d.ts +0 -93
  95. package/dist/src/item/effect-item.d.ts +0 -17
  96. package/dist/src/item/filter-item.d.ts +0 -99
  97. package/dist/src/item/null-item.d.ts +0 -94
  98. /package/{dist/src → es}/constants.d.ts +0 -0
  99. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  100. /package/{dist/src → es}/item/model/camera.d.ts +0 -0
  101. /package/{dist/src → es}/item/model/index.d.ts +0 -0
  102. /package/{dist/src → es}/item/model/light.d.ts +0 -0
  103. /package/{dist/src → es}/item/model/render.d.ts +0 -0
  104. /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
@@ -2,7 +2,6 @@ import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, Sp
2
2
  import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
3
3
  import type { BaseItem, ItemEndBehavior } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
- import type { DistortionFilterParams } from './filter-item';
6
5
  import type { ComponentData } from '../components';
7
6
  /**
8
7
  * 粒子交互行为
@@ -22,7 +21,7 @@ export declare enum ParticleInteractionBehavior {
22
21
  */
23
22
  export interface ParticleItem extends BaseItem {
24
23
  /**
25
- * 元素类型[指定为particle]
24
+ * 元素类型(指定为 particle
26
25
  */
27
26
  type: ItemType.particle;
28
27
  /**
@@ -58,7 +57,7 @@ export interface ParticleEmission {
58
57
  */
59
58
  cycles?: number;
60
59
  /**
61
- * 爆发时间间隔,单位秒
60
+ * 爆发时间间隔(单位:秒)
62
61
  * @default 0
63
62
  */
64
63
  interval?: number;
@@ -72,15 +71,15 @@ export interface ParticleEmission {
72
71
  */
73
72
  index: number;
74
73
  /**
75
- * x方向偏移值
74
+ * x 方向偏移值
76
75
  */
77
76
  x: number;
78
77
  /**
79
- * y方向偏移值
78
+ * y 方向偏移值
80
79
  */
81
80
  y: number;
82
81
  /**
83
- * z方向偏移值
82
+ * z 方向偏移值
84
83
  */
85
84
  z: number;
86
85
  }[];
@@ -91,15 +90,15 @@ export interface ParticlePositionOverLifetime {
91
90
  */
92
91
  asMovement?: boolean;
93
92
  /**
94
- * x轴位置变化信息
93
+ * x 轴位置变化信息
95
94
  */
96
95
  linearX?: NumberExpression;
97
96
  /**
98
- * y轴位置变化信息
97
+ * y 轴位置变化信息
99
98
  */
100
99
  linearY?: NumberExpression;
101
100
  /**
102
- * z轴位置变化信息
101
+ * z 轴位置变化信息
103
102
  */
104
103
  linearZ?: NumberExpression;
105
104
  /**
@@ -107,15 +106,15 @@ export interface ParticlePositionOverLifetime {
107
106
  */
108
107
  asRotation?: boolean;
109
108
  /**
110
- * x轴环绕角度变化信息
109
+ * x 轴环绕角度变化信息
111
110
  */
112
111
  orbitalX?: NumberExpression;
113
112
  /**
114
- * y轴环绕角度变化信息
113
+ * y 轴环绕角度变化信息
115
114
  */
116
115
  orbitalY?: NumberExpression;
117
116
  /**
118
- * z轴环绕角度变化信息
117
+ * z 轴环绕角度变化信息
119
118
  */
120
119
  orbitalZ?: NumberExpression;
121
120
  /**
@@ -138,7 +137,7 @@ export interface ParticlePositionOverLifetime {
138
137
  */
139
138
  forceCurve?: FunctionExpression;
140
139
  /**
141
- * 增加一个初速度,匀速直线运动,direction为运动方向
140
+ * 增加一个初速度,匀速直线运动,direction 为运动方向
142
141
  * @default 0
143
142
  */
144
143
  startSpeed?: NumberExpression;
@@ -147,7 +146,7 @@ export interface ParticlePositionOverLifetime {
147
146
  */
148
147
  speedOverLifetime?: FixedNumberExpression;
149
148
  /**
150
- * 增加一个重力,gravity为重力方向,gravityModifier为重力大小
149
+ * 增加一个重力,gravity 为重力方向,gravityModifier 为重力大小
151
150
  * @default 0
152
151
  */
153
152
  gravity?: vec3;
@@ -166,15 +165,15 @@ export interface ParticleRotationOverLifetime {
166
165
  */
167
166
  asRotation?: boolean;
168
167
  /**
169
- * x轴旋转函数
168
+ * x 轴旋转函数
170
169
  */
171
170
  x?: NumberExpression;
172
171
  /**
173
- * y轴旋转函数
172
+ * y 轴旋转函数
174
173
  */
175
174
  y?: NumberExpression;
176
175
  /**
177
- * z轴旋转函数(不分轴时,变化z)
176
+ * z 轴旋转函数(不分轴时,变化 z)
178
177
  */
179
178
  z?: NumberExpression;
180
179
  }
@@ -188,11 +187,11 @@ export interface ParticleSizeOverLifetime {
188
187
  */
189
188
  size?: NumberExpression;
190
189
  /**
191
- * x轴大小变化信息(分轴模式)
190
+ * x 轴大小变化信息(分轴模式)
192
191
  */
193
192
  x?: NumberExpression;
194
193
  /**
195
- * y轴大小变化信息(分轴模式)
194
+ * y 轴大小变化信息(分轴模式)
196
195
  */
197
196
  y?: NumberExpression;
198
197
  }
@@ -334,7 +333,6 @@ export interface ParticleContent {
334
333
  */
335
334
  radius?: number;
336
335
  };
337
- filter?: DistortionFilterParams;
338
336
  }
339
337
  /**
340
338
  * 粒子元素渲染属性
@@ -405,7 +403,6 @@ export interface ParticleSystemData extends ComponentData {
405
403
  */
406
404
  radius?: number;
407
405
  };
408
- filter?: DistortionFilterParams;
409
406
  }
410
407
  /**
411
408
  * 粒子拖尾参数
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 粒子交互行为
3
+ */
4
+ export var ParticleInteractionBehavior;
5
+ (function (ParticleInteractionBehavior) {
6
+ /**
7
+ * 无
8
+ */
9
+ ParticleInteractionBehavior[ParticleInteractionBehavior["none"] = 0] = "none";
10
+ /**
11
+ * 移出粒子
12
+ */
13
+ ParticleInteractionBehavior[ParticleInteractionBehavior["removeParticle"] = 1] = "removeParticle";
14
+ })(ParticleInteractionBehavior || (ParticleInteractionBehavior = {}));
@@ -0,0 +1,19 @@
1
+ export var ShapeArcMode;
2
+ (function (ShapeArcMode) {
3
+ /**
4
+ * 随机
5
+ */
6
+ ShapeArcMode[ShapeArcMode["RANDOM"] = 0] = "RANDOM";
7
+ /**
8
+ * 单向循环
9
+ */
10
+ ShapeArcMode[ShapeArcMode["UNIDIRECTIONAL_CYCLE"] = 1] = "UNIDIRECTIONAL_CYCLE";
11
+ /**
12
+ * 双向循环
13
+ */
14
+ ShapeArcMode[ShapeArcMode["BIDIRECTIONAL_CYCLE"] = 2] = "BIDIRECTIONAL_CYCLE";
15
+ /**
16
+ * 均匀爆发
17
+ */
18
+ ShapeArcMode[ShapeArcMode["UNIFORM_BURST"] = 3] = "UNIFORM_BURST";
19
+ })(ShapeArcMode || (ShapeArcMode = {}));
@@ -5,7 +5,7 @@ import type { BaseItem, ItemEndBehavior } from './base-item';
5
5
  */
6
6
  export interface PluginItem extends BaseItem {
7
7
  /**
8
- * 元素类型[指定为plugin]
8
+ * 元素类型(指定为 plugin
9
9
  */
10
10
  type: ItemType.plugin;
11
11
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { BinaryPointer } from '../binary';
2
+ import type { ComponentData, DataPath, DataType } from '../components';
2
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType } from '../type';
3
4
  import type { BaseItem, ItemEndBehavior } from './base-item';
4
5
  /**
@@ -6,12 +7,12 @@ import type { BaseItem, ItemEndBehavior } from './base-item';
6
7
  */
7
8
  export interface SpineItem extends BaseItem {
8
9
  /**
9
- * 元素类型 "spine"
10
- */
10
+ * 元素类型 "spine"
11
+ */
11
12
  type: ItemType.spine;
12
13
  /**
13
- * 插件元素渲染信息
14
- */
14
+ * 插件元素渲染信息
15
+ */
15
16
  content: SpineContent;
16
17
  endBehavior: ItemEndBehavior;
17
18
  }
@@ -49,16 +50,16 @@ export interface SpineContent {
49
50
  */
50
51
  export interface PluginSpineOption {
51
52
  /**
52
- * 当前使用的皮肤名称
53
- */
53
+ * 当前使用的皮肤名称
54
+ */
54
55
  activeSkin: string;
55
56
  /**
56
- * 当前使用的动画列表,1.5之前为 string
57
- */
57
+ * 当前使用的动画列表,1.5 之前为 string
58
+ */
58
59
  activeAnimation: string[] | string;
59
60
  /**
60
- * 在 spines 资源数组中的索引
61
- */
61
+ * 在 spines 资源数组中的索引
62
+ */
62
63
  spine: number;
63
64
  /**
64
65
  * 默认融合时间
@@ -68,6 +69,13 @@ export interface PluginSpineOption {
68
69
  * 动画播放的速度
69
70
  */
70
71
  speed?: number;
72
+ /**
73
+ * 使用的默认大小计算规则
74
+ * 0 :除以包围盒大小
75
+ * 1 : 相机逆投影 + 固定画布大小
76
+ * @since 1.3.0
77
+ */
78
+ resizeRule: number;
71
79
  }
72
80
  /**
73
81
  * spine资源信息
@@ -75,19 +83,35 @@ export interface PluginSpineOption {
75
83
  export type skeletonFileType = 'json' | 'skel';
76
84
  export interface SpineResource {
77
85
  /**
78
- * atlas 文件在 `bins` 中的指针
79
- */
86
+ * atlas 文件在 `bins` 中的指针
87
+ */
80
88
  atlas: BinaryPointer;
81
89
  /**
82
- * 骨骼文件
83
- */
90
+ * 骨骼文件
91
+ */
84
92
  skeleton: BinaryPointer;
85
93
  /**
86
- * skeleton 文件类型, `.skel/.json`
87
- */
94
+ * skeleton 文件类型, `.skel/.json`
95
+ */
88
96
  skeletonType: skeletonFileType;
89
97
  /**
90
- * 图像文件在 `scene.textures` 数组中的索引
91
- */
98
+ * 图像文件在 `scene.textures` 数组中的索引
99
+ */
92
100
  images: number[];
93
101
  }
102
+ export interface SpineComponent extends ComponentData {
103
+ dataType: DataType.SpineComponent;
104
+ options: PluginSpineOption;
105
+ resource: {
106
+ atlas: {
107
+ bins: DataPath;
108
+ source: [start: number, length?: number];
109
+ };
110
+ skeleton: {
111
+ bins: DataPath;
112
+ source: [start: number, length?: number];
113
+ };
114
+ images: DataPath[];
115
+ skeletonType: skeletonFileType;
116
+ };
117
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -7,7 +7,7 @@ import type { ComponentData } from '../components';
7
7
  */
8
8
  export interface SpriteItem extends BaseItem {
9
9
  /**
10
- * 元素类型[指定为sprite]
10
+ * 元素类型(指定为 sprite
11
11
  */
12
12
  type: ItemType.sprite;
13
13
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -8,7 +8,7 @@ import type { ComponentData } from '../components';
8
8
  */
9
9
  export interface TextItem extends BaseItem {
10
10
  /**
11
- * 元素类型[指定为text]
11
+ * 元素类型(指定为 text
12
12
  */
13
13
  type: ItemType.text;
14
14
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -5,13 +5,10 @@ import type { PluginItem } from './item/plugin-item';
5
5
  import type { ParticleItem } from './item/particle-item';
6
6
  import type { InteractItem } from './item/interact-item';
7
7
  import type { ModelCameraItem, ModelLightItem, ModelMeshItem, ModelSkyboxItem, ModelTreeItem } from './item/model';
8
- import type { FilterItem } from './item/filter-item';
9
8
  import type { CameraItem } from './item/camera-item';
10
9
  import type { CompositionItem } from './item/composition-item';
11
10
  import type { TextItem } from './item/text-item';
12
11
  /**
13
- * Item Interface,
14
- * 1.0版本
15
- * 基类,无对应元素
12
+ * Item 基类,无对应元素
16
13
  */
17
- export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | FilterItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
14
+ export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
package/es/item.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -50,7 +50,7 @@ export declare enum ValueType {
50
50
  */
51
51
  SHAPE_SPLITS = 11,
52
52
  /**
53
- *直线路径
53
+ * 直线路径
54
54
  */
55
55
  LINEAR_PATH = 12,
56
56
  /**
@@ -68,7 +68,11 @@ export declare enum ValueType {
68
68
  /**
69
69
  * 贝塞尔曲线路径
70
70
  */
71
- BEZIER_CURVE_PATH = 22
71
+ BEZIER_CURVE_PATH = 22,
72
+ /**
73
+ * 贝塞尔曲线四元数
74
+ */
75
+ BEZIER_CURVE_QUAT = 23
72
76
  }
73
77
  export type vec2 = [x: number, y: number];
74
78
  export type vec3 = [x: number, y: number, z: number];
@@ -109,6 +113,7 @@ export type FunctionExpression = LineValue | CurveValue | BezierValue;
109
113
  export type FixedNumberExpression = ConstantNumber | LineValue | CurveValue | BezierValue;
110
114
  export type NumberExpression = FixedNumberExpression | RandomValue;
111
115
  export type FixedVec3Expression = ConstantVec3 | BezierPath | LinearPath | BezierCurvePath;
116
+ export type FixedQuatExpression = BezierCurveQuat;
112
117
  /**
113
118
  * 常数数值
114
119
  * [0,5]
@@ -150,12 +155,12 @@ export type LinearPathValue = [
150
155
  * 关键帧类型
151
156
  */
152
157
  export declare enum BezierKeyframeType {
153
- AUTO = 0,
154
- EASE = 1,
155
- EASE_IN = 2,
156
- EASE_OUT = 3,
157
- LINE = 4,
158
- HOLD = 5,
158
+ AUTO = 0,// 自动
159
+ EASE = 1,// 缓动
160
+ EASE_IN = 2,// 缓入
161
+ EASE_OUT = 3,// 缓出
162
+ LINE = 4,// 线性 (默认进)
163
+ HOLD = 5,// 定格
159
164
  LINE_OUT = 6
160
165
  }
161
166
  /**
@@ -246,10 +251,18 @@ export type BezierValue = [type: ValueType.BEZIER_CURVE, value: BezierKeyframeVa
246
251
  * 贝塞尔曲线路径关键帧值
247
252
  */
248
253
  export type BezierCurvePathValue = [easing: BezierKeyframeValue[], points: vec3[], controlePoints: vec3[]];
254
+ /**
255
+ * 贝塞尔曲线路径关键帧值
256
+ */
257
+ export type BezierCurveQuatValue = [easing: BezierKeyframeValue[], points: vec4[], controlePoints: vec4[]];
249
258
  /**
250
259
  * 贝塞尔曲线路径关键帧
251
260
  */
252
261
  export type BezierCurvePath = [type: ValueType.BEZIER_CURVE_PATH, value: BezierCurvePathValue];
262
+ /**
263
+ * 贝塞尔曲线路径关键帧
264
+ */
265
+ export type BezierCurveQuat = [type: ValueType.BEZIER_CURVE_QUAT, value: BezierCurveQuatValue];
253
266
  /*********************************************/
254
267
  /*********************************************/
255
268
  export type ColorExpression = RGBAColor | GradientColor | RGBAColors;
@@ -0,0 +1,91 @@
1
+ /*********************************************/
2
+ /* 基本数值属性参数 */
3
+ /*********************************************/
4
+ export var ValueType;
5
+ (function (ValueType) {
6
+ /**
7
+ * 常数
8
+ */
9
+ ValueType[ValueType["CONSTANT"] = 0] = "CONSTANT";
10
+ /**
11
+ * 二维常数向量
12
+ */
13
+ ValueType[ValueType["CONSTANT_VEC2"] = 1] = "CONSTANT_VEC2";
14
+ /**
15
+ * 三维常数向量
16
+ */
17
+ ValueType[ValueType["CONSTANT_VEC3"] = 2] = "CONSTANT_VEC3";
18
+ /**
19
+ * 四维常数向量
20
+ */
21
+ ValueType[ValueType["CONSTANT_VEC4"] = 3] = "CONSTANT_VEC4";
22
+ /**
23
+ * 随机数
24
+ */
25
+ ValueType[ValueType["RANDOM"] = 4] = "RANDOM";
26
+ /**
27
+ * 直线
28
+ */
29
+ ValueType[ValueType["LINE"] = 5] = "LINE";
30
+ /**
31
+ * 曲线
32
+ */
33
+ ValueType[ValueType["CURVE"] = 6] = "CURVE";
34
+ /**
35
+ * 贝塞尔路径
36
+ */
37
+ ValueType[ValueType["BEZIER_PATH"] = 7] = "BEZIER_PATH";
38
+ /**
39
+ * 颜色
40
+ */
41
+ ValueType[ValueType["RGBA_COLOR"] = 8] = "RGBA_COLOR";
42
+ /**
43
+ * 渐变色
44
+ */
45
+ ValueType[ValueType["GRADIENT_COLOR"] = 9] = "GRADIENT_COLOR";
46
+ /**
47
+ * 蒙版形状点集
48
+ */
49
+ ValueType[ValueType["SHAPE_POINTS"] = 10] = "SHAPE_POINTS";
50
+ /**
51
+ * 蒙版形状切分
52
+ */
53
+ ValueType[ValueType["SHAPE_SPLITS"] = 11] = "SHAPE_SPLITS";
54
+ /**
55
+ * 直线路径
56
+ */
57
+ ValueType[ValueType["LINEAR_PATH"] = 12] = "LINEAR_PATH";
58
+ /**
59
+ * 多色
60
+ */
61
+ ValueType[ValueType["COLORS"] = 13] = "COLORS";
62
+ /**
63
+ * 二进制指针
64
+ */
65
+ ValueType[ValueType["BINARY"] = 20] = "BINARY";
66
+ /**
67
+ * 贝塞尔曲线
68
+ */
69
+ ValueType[ValueType["BEZIER_CURVE"] = 21] = "BEZIER_CURVE";
70
+ /**
71
+ * 贝塞尔曲线路径
72
+ */
73
+ ValueType[ValueType["BEZIER_CURVE_PATH"] = 22] = "BEZIER_CURVE_PATH";
74
+ /**
75
+ * 贝塞尔曲线四元数
76
+ */
77
+ ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
78
+ })(ValueType || (ValueType = {}));
79
+ /**
80
+ * 关键帧类型
81
+ */
82
+ export var BezierKeyframeType;
83
+ (function (BezierKeyframeType) {
84
+ BezierKeyframeType[BezierKeyframeType["AUTO"] = 0] = "AUTO";
85
+ BezierKeyframeType[BezierKeyframeType["EASE"] = 1] = "EASE";
86
+ BezierKeyframeType[BezierKeyframeType["EASE_IN"] = 2] = "EASE_IN";
87
+ BezierKeyframeType[BezierKeyframeType["EASE_OUT"] = 3] = "EASE_OUT";
88
+ BezierKeyframeType[BezierKeyframeType["LINE"] = 4] = "LINE";
89
+ BezierKeyframeType[BezierKeyframeType["HOLD"] = 5] = "HOLD";
90
+ BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
91
+ })(BezierKeyframeType || (BezierKeyframeType = {}));
@@ -1,11 +1,12 @@
1
- import type { Composition } from './composition';
1
+ import type { Composition, CompositionData } from './composition';
2
2
  import type { SpineResource } from './item/spine-item';
3
3
  import type { PlayerVersion, Shape } from './type';
4
4
  import type { TemplateImage, Image, CompressedImage, TextureDefine } from './image';
5
5
  import type { FontBase, FontDefine } from './text';
6
6
  import type { BinaryFile } from './binary';
7
- import type { ComponentData, GeometryData, MaterialData, ShaderData } from './components';
7
+ import type { ComponentData, EffectsObjectData, GeometryData, MaterialData, ShaderData } from './components';
8
8
  import type { VFXItemData } from './vfx-item-data';
9
+ import type { AnimationClipData } from './animation-clip-data';
9
10
  /**
10
11
  * runtime 2.0 之前的场景信息
11
12
  * 素材信息存放于统一数据结构中
@@ -23,8 +24,10 @@ export interface JSONSceneLegacy {
23
24
  * 2.0 改造升级
24
25
  * 2.1 增加文本元素
25
26
  * 2.2 数据类型兼容
27
+ * 2.3 新增动态视频、陀螺仪支持旋转
28
+ * 2.4 支持贝塞尔曲线
26
29
  */
27
- version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2';
30
+ version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2' | '2.3' | '2.4';
28
31
  /**
29
32
  * 播放器版本信息
30
33
  */
@@ -103,7 +106,7 @@ export interface JSONScene {
103
106
  /**
104
107
  * JSON 版本
105
108
  *
106
- * 3.0 EC 改造
109
+ * 3.0 EC 改造、移除滤镜元素
107
110
  */
108
111
  version: string;
109
112
  /**
@@ -116,25 +119,25 @@ export interface JSONScene {
116
119
  type: string;
117
120
  /*************************************** 用于加载 json 后复原合成 **************************************/
118
121
  /**
119
- * 选中合成ID
122
+ * 选中合成 ID
120
123
  * 如果没有设置,选择合成中的第一个
121
124
  */
122
125
  compositionId?: string;
123
126
  /**
124
127
  * 渲染所需合成列表
125
128
  */
126
- compositions: Composition[];
129
+ compositions: CompositionData[];
127
130
  /******************************** 以下皆为可复用信息,加载在对应 Manager 中 *******************************/
128
131
  /**
129
132
  * 贴图信息
130
133
  */
131
134
  images: (TemplateImage | Image | CompressedImage)[];
132
135
  /**
133
- * 根据合成ID,每个合成用到的 image 的数组索引
136
+ * 根据合成 ID,每个合成用到的 image 的数组索引
134
137
  */
135
138
  imgUsage?: Record<string, number[]>;
136
139
  /**
137
- * 根据合成id,每个合成用到的 bin 的数组索引
140
+ * 根据合成 ID,每个合成用到的 bin 的数组索引
138
141
  */
139
142
  binUsage?: Record<string, number[]>;
140
143
  /**
@@ -146,28 +149,17 @@ export interface JSONScene {
146
149
  * 'model@1.0'
147
150
  */
148
151
  plugins: string[];
149
- /**
150
- * 保留字段
151
- */
152
- requires: SceneRequire[];
153
152
  /**
154
153
  * 字体资源
155
154
  * 数据模板下掉可以不要 FontBase[]
156
155
  */
157
156
  fonts?: FontBase[] | FontDefine[];
158
- /**
159
- * spine 资源
160
- * @version 1.5
161
- */
162
- spines?: SpineResource[];
163
157
  /**
164
158
  * 二进制文件地址
165
- * @version 1.3
166
159
  */
167
160
  bins?: BinaryFile[];
168
161
  /**
169
162
  * textures 配置
170
- * 从 v1.3 开始,images 数组会对应创建 textures 数组
171
163
  */
172
164
  textures?: TextureDefine[];
173
165
  /**
@@ -190,4 +182,12 @@ export interface JSONScene {
190
182
  * 几何体数据
191
183
  */
192
184
  geometries: GeometryData[];
185
+ /**
186
+ * 动画数据
187
+ */
188
+ animations: AnimationClipData[];
189
+ /**
190
+ * 分类外的资产数据
191
+ */
192
+ miscs: EffectsObjectData[];
193
193
  }
package/es/scene.js ADDED
@@ -0,0 +1 @@
1
+ export {};