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

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/es/binary.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { DataType } from './components';
1
+ import type { DataType, EffectsObjectData } from './components';
2
2
  import type { RenderLevel } from './type';
3
3
  import type { ValueType } from './number-expression';
4
4
  /**
@@ -24,7 +24,7 @@ export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | '
24
24
  /**
25
25
  * 线上二进制地址
26
26
  */
27
- export interface BinaryFile {
27
+ export interface BinaryFile extends EffectsObjectData {
28
28
  url: string;
29
29
  dataType: DataType.BinaryAsset;
30
30
  renderLevel?: RenderLevel;
@@ -88,7 +88,11 @@ export interface GeometryData extends EffectsObjectData {
88
88
  /**
89
89
  * 存放 position, uv, normal, indices 的打包数据
90
90
  */
91
- buffer: string;
91
+ buffer?: string;
92
+ /**
93
+ * 存放 position, uv, normal, indices 的二进制数据,用于序列化二进制数据
94
+ */
95
+ binaryData?: Uint8Array;
92
96
  /**
93
97
  * 所有的骨骼名称
94
98
  */
@@ -1,5 +1,6 @@
1
1
  import type { DataPath } from './components';
2
2
  import type { Item } from './item';
3
+ import type { EndBehavior } from './item/base-item';
3
4
  export declare enum CameraClipMode {
4
5
  /**
5
6
  * 剪裁上下
@@ -41,35 +42,6 @@ export interface CameraOptions {
41
42
  */
42
43
  clipMode: CameraClipMode;
43
44
  }
44
- /**
45
- * 结束行为
46
- */
47
- export declare enum CompositionEndBehavior {
48
- /**
49
- * 销毁
50
- */
51
- destroy = 0,
52
- /**
53
- * 暂停
54
- */
55
- pause = 1,
56
- /**
57
- * 重播
58
- */
59
- restart = 5,
60
- /**
61
- * 无限播放
62
- */
63
- forward = 2,
64
- /**
65
- * 销毁并保留最后一帧
66
- */
67
- pause_destroy = 3,
68
- /**
69
- * 冻结
70
- */
71
- freeze = 4
72
- }
73
45
  interface CompositionBase {
74
46
  /**
75
47
  * 合成ID
@@ -91,7 +63,7 @@ interface CompositionBase {
91
63
  /**
92
64
  * 合成结束行为
93
65
  */
94
- endBehavior: CompositionEndBehavior;
66
+ endBehavior: EndBehavior;
95
67
  /**
96
68
  * 合成相机信息
97
69
  */
package/es/composition.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CAMERA_CLIP_MODE_NORMAL, CAMERA_CLIP_MODE_VERTICAL, END_BEHAVIOR_DESTROY, END_BEHAVIOR_FORWARD, END_BEHAVIOR_FREEZE, END_BEHAVIOR_PAUSE, END_BEHAVIOR_PAUSE_AND_DESTROY, END_BEHAVIOR_RESTART, } from './constants';
1
+ import { CAMERA_CLIP_MODE_NORMAL, CAMERA_CLIP_MODE_VERTICAL } from './constants';
2
2
  export var CameraClipMode;
3
3
  (function (CameraClipMode) {
4
4
  /**
@@ -10,33 +10,3 @@ export var CameraClipMode;
10
10
  */
11
11
  CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
12
12
  })(CameraClipMode || (CameraClipMode = {}));
13
- /**
14
- * 结束行为
15
- */
16
- export var CompositionEndBehavior;
17
- (function (CompositionEndBehavior) {
18
- /**
19
- * 销毁
20
- */
21
- CompositionEndBehavior[CompositionEndBehavior["destroy"] = 0] = "destroy";
22
- /**
23
- * 暂停
24
- */
25
- CompositionEndBehavior[CompositionEndBehavior["pause"] = 1] = "pause";
26
- /**
27
- * 重播
28
- */
29
- CompositionEndBehavior[CompositionEndBehavior["restart"] = 5] = "restart";
30
- /**
31
- * 无限播放
32
- */
33
- CompositionEndBehavior[CompositionEndBehavior["forward"] = 2] = "forward";
34
- /**
35
- * 销毁并保留最后一帧
36
- */
37
- CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = 3] = "pause_destroy";
38
- /**
39
- * 冻结
40
- */
41
- CompositionEndBehavior[CompositionEndBehavior["freeze"] = 4] = "freeze";
42
- })(CompositionEndBehavior || (CompositionEndBehavior = {}));
package/es/constants.d.ts CHANGED
@@ -1,9 +1,32 @@
1
+ /**
2
+ * 销毁
3
+ */
1
4
  export declare const END_BEHAVIOR_DESTROY = 0;
5
+ /**
6
+ * 暂停
7
+ * @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
8
+ */
2
9
  export declare const END_BEHAVIOR_PAUSE = 1;
10
+ /**
11
+ * 无限播放
12
+ */
3
13
  export declare const END_BEHAVIOR_FORWARD = 2;
14
+ /**
15
+ * 销毁并保留最后一帧
16
+ * @deprecated since 2.0
17
+ */
4
18
  export declare const END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
19
+ /**
20
+ * 冻结
21
+ */
5
22
  export declare const END_BEHAVIOR_FREEZE = 4;
23
+ /**
24
+ * 重播
25
+ */
6
26
  export declare const END_BEHAVIOR_RESTART = 5;
27
+ /**
28
+ *
29
+ */
7
30
  export declare const END_BEHAVIOR_DESTROY_CHILDREN = 6;
8
31
  export declare const CAMERA_CLIP_MODE_VERTICAL = 1;
9
32
  export declare const CAMERA_CLIP_MODE_NORMAL = 0;
package/es/constants.js CHANGED
@@ -1,9 +1,32 @@
1
+ /**
2
+ * 销毁
3
+ */
1
4
  export const END_BEHAVIOR_DESTROY = 0;
5
+ /**
6
+ * 暂停
7
+ * @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
8
+ */
2
9
  export const END_BEHAVIOR_PAUSE = 1;
10
+ /**
11
+ * 无限播放
12
+ */
3
13
  export const END_BEHAVIOR_FORWARD = 2;
14
+ /**
15
+ * 销毁并保留最后一帧
16
+ * @deprecated since 2.0
17
+ */
4
18
  export const END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
19
+ /**
20
+ * 冻结
21
+ */
5
22
  export const END_BEHAVIOR_FREEZE = 4;
23
+ /**
24
+ * 重播
25
+ */
6
26
  export const END_BEHAVIOR_RESTART = 5;
27
+ /**
28
+ *
29
+ */
7
30
  export const END_BEHAVIOR_DESTROY_CHILDREN = 6;
8
31
  export const CAMERA_CLIP_MODE_VERTICAL = 1;
9
32
  export const CAMERA_CLIP_MODE_NORMAL = 0;
@@ -12,9 +12,25 @@ import type { PluginContent } from './plugin-item';
12
12
  import type { SpineContent } from './spine-item';
13
13
  import type { SpriteContent } from './sprite-item';
14
14
  import type { TextContent } from './text-item';
15
- export declare enum ItemEndBehavior {
15
+ /**
16
+ * 结束行为
17
+ */
18
+ export declare enum EndBehavior {
19
+ /**
20
+ * 销毁
21
+ */
16
22
  destroy = 0,
17
- loop = 5,
23
+ /**
24
+ * 重播
25
+ */
26
+ restart = 5,
27
+ /**
28
+ * 无限播放
29
+ */
30
+ forward = 2,
31
+ /**
32
+ * 冻结
33
+ */
18
34
  freeze = 4
19
35
  }
20
36
  export declare enum ParentItemEndBehavior {
@@ -57,7 +73,7 @@ export interface BaseItem {
57
73
  * 元素结束行为
58
74
  * @default destroy
59
75
  */
60
- endBehavior: ItemEndBehavior | ParentItemEndBehavior;
76
+ endBehavior: EndBehavior | ParentItemEndBehavior;
61
77
  /**
62
78
  * 元素播放延时(单位秒)
63
79
  * @default 0
@@ -1,10 +1,26 @@
1
- import { END_BEHAVIOR_DESTROY, END_BEHAVIOR_DESTROY_CHILDREN, END_BEHAVIOR_FREEZE, END_BEHAVIOR_RESTART, } from '../constants';
2
- export var ItemEndBehavior;
3
- (function (ItemEndBehavior) {
4
- ItemEndBehavior[ItemEndBehavior["destroy"] = 0] = "destroy";
5
- ItemEndBehavior[ItemEndBehavior["loop"] = 5] = "loop";
6
- ItemEndBehavior[ItemEndBehavior["freeze"] = 4] = "freeze";
7
- })(ItemEndBehavior || (ItemEndBehavior = {}));
1
+ import { END_BEHAVIOR_DESTROY, END_BEHAVIOR_DESTROY_CHILDREN, END_BEHAVIOR_FORWARD, END_BEHAVIOR_FREEZE, END_BEHAVIOR_RESTART, } from '../constants';
2
+ /**
3
+ * 结束行为
4
+ */
5
+ export var EndBehavior;
6
+ (function (EndBehavior) {
7
+ /**
8
+ * 销毁
9
+ */
10
+ EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
11
+ /**
12
+ * 重播
13
+ */
14
+ EndBehavior[EndBehavior["restart"] = 5] = "restart";
15
+ /**
16
+ * 无限播放
17
+ */
18
+ EndBehavior[EndBehavior["forward"] = 2] = "forward";
19
+ /**
20
+ * 冻结
21
+ */
22
+ EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
23
+ })(EndBehavior || (EndBehavior = {}));
8
24
  export var ParentItemEndBehavior;
9
25
  (function (ParentItemEndBehavior) {
10
26
  ParentItemEndBehavior[ParentItemEndBehavior["destroyChildren"] = 6] = "destroyChildren";
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior } from './base-item';
2
2
  import type { ItemType, RotationOverLifetime } from '../type';
3
3
  import type { FixedNumberExpression, FixedVec3Expression } from '../number-expression';
4
4
  import type { CameraClipMode } from '../composition';
@@ -11,7 +11,7 @@ export interface CameraItem extends BaseItem {
11
11
  * 相机元素渲染信息
12
12
  */
13
13
  content: CameraContent;
14
- endBehavior: ItemEndBehavior;
14
+ endBehavior: EndBehavior;
15
15
  }
16
16
  export interface CameraContent {
17
17
  /**
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, ColorOverLifetime, ItemType } from '../type';
3
3
  import type { RGBAColorValue, vec3 } from '../number-expression';
4
4
  import type { PositionOverLifetime } from '../type';
@@ -14,7 +14,7 @@ export interface CompositionItem extends BaseItem {
14
14
  * 预合成元素渲染信息
15
15
  */
16
16
  content: CompositionContent;
17
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
18
18
  }
19
19
  /**
20
20
  * 预合成元素
@@ -1,12 +1,12 @@
1
1
  import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
2
- import type { BaseItem, ItemEndBehavior } from './base-item';
2
+ import type { BaseItem, EndBehavior } from './base-item';
3
3
  /**
4
4
  * 特效元素
5
5
  */
6
6
  export interface EffectItem extends BaseItem {
7
7
  type: ItemType.effect;
8
8
  content: EffectContent;
9
- endBehavior: ItemEndBehavior;
9
+ endBehavior: EndBehavior;
10
10
  }
11
11
  /**
12
12
  * 特效元素属性
@@ -1,6 +1,6 @@
1
1
  import type { InteractBehavior, InteractType, ItemType } from '../type';
2
2
  import type { RGBAColor } from '../number-expression';
3
- import type { BaseItem, ItemEndBehavior } from './base-item';
3
+ import type { BaseItem, EndBehavior } from './base-item';
4
4
  import type { ComponentData } from '../components';
5
5
  /**
6
6
  * 交互元素
@@ -14,7 +14,7 @@ export interface InteractItem extends BaseItem {
14
14
  * 交互元素渲染信息
15
15
  */
16
16
  content: InteractContent;
17
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
18
18
  }
19
19
  /**
20
20
  * 交互元素渲染属性
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from '../base-item';
1
+ import type { BaseItem, EndBehavior } from '../base-item';
2
2
  import type { CameraClipMode, CameraOptions } from '../../composition';
3
3
  import type { RotationOverLifetime, PositionOverLifetime } from '../../type';
4
4
  import type { ComponentData } from '../../components';
@@ -30,7 +30,7 @@ export interface ModelCameraItem extends BaseItem {
30
30
  type: 'camera';
31
31
  pluginName: 'model';
32
32
  content: ModelCameraContent;
33
- endBehavior: ItemEndBehavior;
33
+ endBehavior: EndBehavior;
34
34
  }
35
35
  export declare enum CameraType {
36
36
  orthographic = "orthographic",
@@ -1,5 +1,5 @@
1
1
  import type { RGBAColorValue } from '../../number-expression';
2
- import type { BaseItem, ItemEndBehavior } from '../base-item';
2
+ import type { BaseItem, EndBehavior } from '../base-item';
3
3
  import type { RotationOverLifetime, PositionOverLifetime, ItemType } from '../../type';
4
4
  import type { ColorData, ComponentData } from '../../components';
5
5
  export interface ModelLightBaseOptions {
@@ -69,7 +69,7 @@ export interface ModelLightItem extends BaseItem {
69
69
  type: ItemType.light;
70
70
  pluginName: 'model';
71
71
  content: ModelLightContent;
72
- endBehavior: ItemEndBehavior;
72
+ endBehavior: EndBehavior;
73
73
  }
74
74
  export declare enum LightType {
75
75
  /**
@@ -1,5 +1,5 @@
1
1
  import type { BinaryEnv } from '../../binary';
2
- import type { BaseItem, ItemEndBehavior } from '../base-item';
2
+ import type { BaseItem, EndBehavior } from '../base-item';
3
3
  import type { MaterialOptions } from './material';
4
4
  import type { GeometryPointer } from './binary';
5
5
  import type { vec3 } from '../../number-expression';
@@ -66,7 +66,7 @@ export interface ModelMeshItem<T extends BinaryEnv> extends BaseItem {
66
66
  type: ItemType.mesh;
67
67
  pluginName: 'model';
68
68
  content: ModelMeshItemContent<T>;
69
- endBehavior: ItemEndBehavior;
69
+ endBehavior: EndBehavior;
70
70
  }
71
71
  export interface PrimitiveData {
72
72
  geometry: DataPath;
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from '../base-item';
1
+ import type { BaseItem, EndBehavior } from '../base-item';
2
2
  import type { BinaryEnv } from '../../binary';
3
3
  import type { SkyboxCubeTexturePointer } from './binary';
4
4
  import type { ItemType } from '../../type';
@@ -29,7 +29,7 @@ export interface ModelSkyboxItem<T extends BinaryEnv> extends BaseItem {
29
29
  type: ItemType.skybox;
30
30
  pluginName: 'model';
31
31
  content: SkyboxContent<T>;
32
- endBehavior: ItemEndBehavior;
32
+ endBehavior: EndBehavior;
33
33
  }
34
34
  /**
35
35
  * 一个 skybox 打包出来:
@@ -1,6 +1,6 @@
1
1
  import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, SplitParameter } from '../type';
2
2
  import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
3
- import type { BaseItem, ItemEndBehavior } from './base-item';
3
+ import type { BaseItem, EndBehavior } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
5
  import type { ComponentData } from '../components';
6
6
  /**
@@ -28,7 +28,7 @@ export interface ParticleItem extends BaseItem {
28
28
  * 粒子元素渲染信息
29
29
  */
30
30
  content: ParticleContent;
31
- endBehavior: ItemEndBehavior;
31
+ endBehavior: EndBehavior;
32
32
  }
33
33
  /**
34
34
  * 发射器参数
@@ -1,5 +1,5 @@
1
1
  import type { ItemType, PluginGyroscopeTarget, PluginType, RendererOptions } from '../type';
2
- import type { BaseItem, ItemEndBehavior } from './base-item';
2
+ import type { BaseItem, EndBehavior } from './base-item';
3
3
  /**
4
4
  * 插件元素
5
5
  */
@@ -12,7 +12,7 @@ export interface PluginItem extends BaseItem {
12
12
  * 插件元素渲染信息
13
13
  */
14
14
  content: PluginContent;
15
- endBehavior: ItemEndBehavior;
15
+ endBehavior: EndBehavior;
16
16
  }
17
17
  /**
18
18
  * 插件元素渲染属性
@@ -1,7 +1,7 @@
1
1
  import type { BinaryPointer } from '../binary';
2
2
  import type { ComponentData, DataPath, DataType } from '../components';
3
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType } from '../type';
4
- import type { BaseItem, ItemEndBehavior } from './base-item';
4
+ import type { BaseItem, EndBehavior } from './base-item';
5
5
  /**
6
6
  * 插件元素
7
7
  */
@@ -14,7 +14,7 @@ export interface SpineItem extends BaseItem {
14
14
  * 插件元素渲染信息
15
15
  */
16
16
  content: SpineContent;
17
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
18
18
  }
19
19
  /**
20
20
  * Spine元素渲染属性
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType, TextureSheetAnimation, RendererOptions, SplitParameter, InteractBehavior } from '../type';
3
3
  import type { RGBAColorValue } from '../number-expression';
4
4
  import type { ComponentData } from '../components';
@@ -14,7 +14,7 @@ export interface SpriteItem extends BaseItem {
14
14
  * 图层元素渲染信息
15
15
  */
16
16
  content: SpriteContent;
17
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
18
18
  }
19
19
  export interface SpriteContentOptions {
20
20
  /**
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType, TextureSheetAnimation, RendererOptions, InteractBehavior } from '../type';
3
3
  import type { RGBAColorValue } from '../number-expression';
4
4
  import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight } from '../text';
@@ -15,7 +15,7 @@ export interface TextItem extends BaseItem {
15
15
  * 文本元素渲染信息
16
16
  */
17
17
  content: TextContent;
18
- endBehavior: ItemEndBehavior;
18
+ endBehavior: EndBehavior;
19
19
  }
20
20
  export interface TextContentOptions {
21
21
  /**
@@ -1,7 +1,9 @@
1
+ import type { EndBehavior } from '../item/base-item';
1
2
  import type { DataPath } from '../components';
2
3
  export interface TimelineClipData {
3
4
  start?: number;
4
5
  duration?: number;
6
+ endBehavior?: EndBehavior;
5
7
  /**
6
8
  * 可播放资产(PlayableAssetData)
7
9
  */
@@ -1,5 +1,5 @@
1
1
  import type { DataPath, EffectsObjectData } from './components';
2
- import type { ItemEndBehavior, ParentItemEndBehavior, BaseContent, TransformData } from './item/base-item';
2
+ import type { EndBehavior, ParentItemEndBehavior, BaseContent, TransformData } from './item/base-item';
3
3
  import type { ItemType, RenderLevel } from './type';
4
4
  export interface VFXItemData extends EffectsObjectData {
5
5
  /**
@@ -37,7 +37,7 @@ export interface VFXItemData extends EffectsObjectData {
37
37
  * 元素结束行为
38
38
  * @default destroy
39
39
  */
40
- endBehavior: ItemEndBehavior | ParentItemEndBehavior;
40
+ endBehavior: EndBehavior | ParentItemEndBehavior;
41
41
  /**
42
42
  * 元素播放延时(单位秒)
43
43
  * @default 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.22",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",