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

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 +9 -2
  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 +209 -0
  9. package/es/components.js +129 -0
  10. package/{dist/src → es}/composition.d.ts +28 -70
  11. package/es/composition.js +12 -0
  12. package/{dist/src → es}/constants.d.ts +23 -0
  13. package/es/constants.js +34 -0
  14. package/{dist/src → es}/image.d.ts +21 -27
  15. package/es/image.js +9 -0
  16. package/{dist/src → es}/index.d.ts +4 -2
  17. package/es/index.js +28 -0
  18. package/{dist/src → es}/item/base-item.d.ts +27 -8
  19. package/es/item/base-item.js +27 -0
  20. package/{dist/src → es}/item/camera-item.d.ts +6 -6
  21. package/es/item/camera-item.js +1 -0
  22. package/{dist/src → es}/item/composition-item.d.ts +4 -4
  23. package/es/item/composition-item.js +1 -0
  24. package/es/item/effect-item.d.ts +35 -0
  25. package/es/item/effect-item.js +1 -0
  26. package/{dist/src → es}/item/interact-item.d.ts +3 -3
  27. package/es/item/interact-item.js +1 -0
  28. package/es/item/model/binary.js +1 -0
  29. package/{dist/src → es}/item/model/camera.d.ts +2 -2
  30. package/es/item/model/camera.js +5 -0
  31. package/es/item/model/index.js +35 -0
  32. package/{dist/src → es}/item/model/light.d.ts +2 -2
  33. package/es/item/model/light.js +19 -0
  34. package/{dist/src → es}/item/model/material.d.ts +3 -3
  35. package/es/item/model/material.js +16 -0
  36. package/{dist/src → es}/item/model/mesh.d.ts +9 -8
  37. package/es/item/model/mesh.js +5 -0
  38. package/es/item/model/render.js +42 -0
  39. package/{dist/src → es}/item/model/skybox.d.ts +9 -3
  40. package/es/item/model/skybox.js +1 -0
  41. package/{dist/src → es}/item/model/tree.d.ts +10 -0
  42. package/es/item/model/tree.js +1 -0
  43. package/es/item/null-item.d.ts +46 -0
  44. package/es/item/null-item.js +1 -0
  45. package/{dist/src → es}/item/particle-item.d.ts +20 -23
  46. package/es/item/particle-item.js +14 -0
  47. package/es/item/particle-shape.js +19 -0
  48. package/{dist/src → es}/item/plugin-item.d.ts +3 -3
  49. package/es/item/plugin-item.js +1 -0
  50. package/{dist/src → es}/item/spine-item.d.ts +44 -20
  51. package/es/item/spine-item.js +1 -0
  52. package/{dist/src → es}/item/sprite-item.d.ts +3 -3
  53. package/es/item/sprite-item.js +1 -0
  54. package/{dist/src → es}/item/text-item.d.ts +3 -3
  55. package/es/item/text-item.js +1 -0
  56. package/{dist/src → es}/item.d.ts +2 -5
  57. package/es/item.js +1 -0
  58. package/{dist/src → es}/number-expression.d.ts +21 -8
  59. package/es/number-expression.js +91 -0
  60. package/{dist/src → es}/scene.d.ts +19 -19
  61. package/es/scene.js +1 -0
  62. package/{dist/src → es}/text.d.ts +3 -55
  63. package/es/text.js +84 -0
  64. package/es/timeline/index.d.ts +5 -0
  65. package/es/timeline/index.js +5 -0
  66. package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
  67. package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
  68. package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
  69. package/es/timeline/playables/transform-playable-asset-data.js +1 -0
  70. package/es/timeline/timeline-asset-data.d.ts +8 -0
  71. package/es/timeline/timeline-asset-data.js +1 -0
  72. package/es/timeline/timeline-clip-data.d.ts +11 -0
  73. package/es/timeline/timeline-clip-data.js +1 -0
  74. package/es/timeline/track/track-asset-data.d.ts +9 -0
  75. package/es/timeline/track/track-asset-data.js +1 -0
  76. package/{dist/src → es}/type.d.ts +45 -20
  77. package/es/type.js +342 -0
  78. package/{dist/src → es}/vfx-item-data.d.ts +10 -11
  79. package/es/vfx-item-data.js +1 -0
  80. package/package.json +26 -47
  81. package/dist/fallback/camera.d.ts +0 -2
  82. package/dist/fallback/filter.d.ts +0 -2
  83. package/dist/fallback/index.d.ts +0 -12
  84. package/dist/fallback/interact.d.ts +0 -2
  85. package/dist/fallback/migration.d.ts +0 -13
  86. package/dist/fallback/particle.d.ts +0 -2
  87. package/dist/fallback/sprite.d.ts +0 -3
  88. package/dist/fallback/utils.d.ts +0 -36
  89. package/dist/fallback.js +0 -2155
  90. package/dist/fallback.js.map +0 -1
  91. package/dist/fallback.mjs +0 -2127
  92. package/dist/fallback.mjs.map +0 -1
  93. package/dist/index.js +0 -758
  94. package/dist/index.js.map +0 -1
  95. package/dist/index.mjs +0 -743
  96. package/dist/index.mjs.map +0 -1
  97. package/dist/src/components.d.ts +0 -93
  98. package/dist/src/item/effect-item.d.ts +0 -17
  99. package/dist/src/item/filter-item.d.ts +0 -99
  100. package/dist/src/item/null-item.d.ts +0 -94
  101. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  102. /package/{dist/src → es}/item/model/index.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
package/README.md CHANGED
@@ -8,15 +8,7 @@
8
8
 
9
9
  ``` bash
10
10
  # 1. Install dependencies (first time)
11
- npm install
11
+ pnpm install
12
12
  # 2. Build
13
- npm run build
13
+ pnpm run build
14
14
  ```
15
-
16
- ## Testing
17
-
18
- ``` bash
19
- npm run test
20
- ```
21
-
22
- > Open browser and open: http://localhost:9003/test/
@@ -0,0 +1,26 @@
1
+ import type { EffectsObjectData } from './components';
2
+ import type { FixedNumberExpression, FixedVec3Expression, FixedQuatExpression } from './number-expression';
3
+ export interface AnimationClipData extends EffectsObjectData {
4
+ positionCurves: PositionCurveData[];
5
+ rotationCurves: RotationCurveData[];
6
+ scaleCurves: ScaleCurveData[];
7
+ floatCurves: FloatCurveData[];
8
+ }
9
+ export interface PositionCurveData {
10
+ path: string;
11
+ keyFrames: FixedVec3Expression;
12
+ }
13
+ export interface RotationCurveData {
14
+ path: string;
15
+ keyFrames: FixedQuatExpression;
16
+ }
17
+ export interface ScaleCurveData {
18
+ path: string;
19
+ keyFrames: FixedVec3Expression;
20
+ }
21
+ export interface FloatCurveData {
22
+ path: string;
23
+ property: string;
24
+ className: string;
25
+ keyFrames: FixedNumberExpression;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { DataPath, DataType, EffectsObjectData } from './components';
1
2
  import type { RenderLevel } from './type';
2
3
  import type { ValueType } from './number-expression';
3
4
  /**
@@ -19,14 +20,20 @@ import type { ValueType } from './number-expression';
19
20
  */
20
21
  export type BinaryPointerContent = [index: number, start?: number, byteLength?: number, type?: BinaryType];
21
22
  export type BinaryPointer = [ValueType.BINARY, BinaryPointerContent];
22
- export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | 'f64' | string;
23
+ export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | 'f64' | '';
23
24
  /**
24
25
  * 线上二进制地址
25
26
  */
26
- export interface BinaryFile {
27
+ export interface BinaryFile extends EffectsObjectData {
27
28
  url: string;
29
+ dataType: DataType.BinaryAsset;
28
30
  renderLevel?: RenderLevel;
29
31
  }
32
+ export interface BinaryDataSegment {
33
+ buffer: DataPath;
34
+ offset: number;
35
+ length: number;
36
+ }
30
37
  export type BinaryEnv = 'studio' | 'runtime' | 'json';
31
38
  /**
32
39
  * 类型模板,根据 runtime/studio/json 环境区别类型
package/es/binary.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const BuiltinObjectGUID: {
2
+ WhiteTexture: string;
3
+ PBRShader: string;
4
+ UnlitShader: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ export const BuiltinObjectGUID = {
2
+ WhiteTexture: 'whitetexture00000000000000000000',
3
+ PBRShader: 'pbr00000000000000000000000000000',
4
+ UnlitShader: 'unlit000000000000000000000000000',
5
+ };
@@ -0,0 +1,209 @@
1
+ import type { BinaryDataSegment } from './binary';
2
+ import type { Vector2Data } from './item/base-item';
3
+ export declare enum DataType {
4
+ VFXItemData = "VFXItemData",
5
+ EffectComponent = "EffectComponent",
6
+ Material = "Material",
7
+ Shader = "Shader",
8
+ SpriteComponent = "SpriteComponent",
9
+ ParticleSystem = "ParticleSystem",
10
+ InteractComponent = "InteractComponent",
11
+ CameraController = "CameraController",
12
+ Geometry = "Geometry",
13
+ Texture = "Texture",
14
+ AnimationClip = "AnimationClip",
15
+ TextComponent = "TextComponent",
16
+ BinaryAsset = "BinaryAsset",
17
+ TrackAsset = "TrackAsset",
18
+ TimelineAsset = "TimelineAsset",
19
+ ObjectBindingTrack = "ObjectBindingTrack",
20
+ TransformTrack = "TransformTrack",
21
+ SpriteColorTrack = "SpriteColorTrack",
22
+ ActivationTrack = "ActivationTrack",
23
+ SubCompositionTrack = "SubCompositionTrack",
24
+ TransformPlayableAsset = "TransformPlayableAsset",
25
+ SpriteColorPlayableAsset = "SpriteColorPlayableAsset",
26
+ ActivationPlayableAsset = "ActivationPlayableAsset",
27
+ SubCompositionPlayableAsset = "SubCompositionPlayableAsset",
28
+ MeshComponent = "MeshComponent",
29
+ SkyboxComponent = "SkyboxComponent",
30
+ LightComponent = "LightComponent",
31
+ CameraComponent = "CameraComponent",
32
+ ModelPluginComponent = "ModelPluginComponent",
33
+ TreeComponent = "TreeComponent",
34
+ AnimationComponent = "AnimationComponent",
35
+ SpineComponent = "SpineComponent",
36
+ TimelineClip = "TimelineClip"
37
+ }
38
+ export interface DataPath {
39
+ id: string;
40
+ }
41
+ export interface EffectsObjectData {
42
+ id: string;
43
+ name?: string;
44
+ dataType: DataType;
45
+ }
46
+ export interface ComponentData extends EffectsObjectData {
47
+ item: DataPath;
48
+ }
49
+ export interface ColorData {
50
+ r: number;
51
+ g: number;
52
+ b: number;
53
+ a: number;
54
+ }
55
+ export interface Vector4Data {
56
+ x: number;
57
+ y: number;
58
+ z: number;
59
+ w: number;
60
+ }
61
+ export interface MaterialTextureProperty {
62
+ texture: DataPath;
63
+ offset?: Vector2Data;
64
+ scale?: Vector2Data;
65
+ }
66
+ export interface MaterialData extends EffectsObjectData {
67
+ shader: DataPath;
68
+ blending?: boolean;
69
+ zWrite?: boolean;
70
+ zTest?: boolean;
71
+ stringTags: Record<string, string>;
72
+ macros: string[];
73
+ ints: Record<string, number>;
74
+ floats: Record<string, number>;
75
+ vector4s: Record<string, Vector4Data>;
76
+ colors: Record<string, ColorData>;
77
+ textures: Record<string, MaterialTextureProperty>;
78
+ }
79
+ export interface GeometryData extends EffectsObjectData {
80
+ vertexData: VertexData;
81
+ indexFormat: IndexFormatType;
82
+ indexOffset: number;
83
+ subMeshes: SubMesh[];
84
+ /**
85
+ * 模型绘制模式,默认为 GeometryType.TRIANGLES(三角形)
86
+ * @default GeometryType.TRIANGLES
87
+ */
88
+ mode: GeometryType;
89
+ /**
90
+ * 存放 position, uv, normal, indices 的打包数据
91
+ */
92
+ buffer?: string;
93
+ /**
94
+ * 存放 position, uv, normal, indices 的打包数据二进制资产引用
95
+ */
96
+ bufferAsset?: BinaryDataSegment;
97
+ /**
98
+ * 所有的骨骼名称
99
+ */
100
+ boneNames?: string[];
101
+ rootBoneName?: string;
102
+ inverseBindMatrices?: number[];
103
+ }
104
+ export interface SubMesh {
105
+ offset: number;
106
+ indexCount?: number;
107
+ vertexCount: number;
108
+ }
109
+ export declare enum GeometryType {
110
+ /**
111
+ * Draw single points.
112
+ */
113
+ POINTS = 0,
114
+ /**
115
+ * Draw lines. Each vertex connects to the one after it.
116
+ */
117
+ LINES = 1,
118
+ /**
119
+ * Draw lines. Each set of two vertices is treated as a separate line segment.
120
+ */
121
+ LINE_LOOP = 2,
122
+ /**
123
+ * Draw a connected group of line segments from the first vertex to the last.
124
+ */
125
+ LINE_STRIP = 3,
126
+ /**
127
+ * Draw triangles. Each set of three vertices creates a separate triangle.
128
+ */
129
+ TRIANGLES = 4,
130
+ /**
131
+ * Draw a connected strip of triangles.
132
+ */
133
+ TRIANGLE_STRIP = 5,
134
+ /**
135
+ * Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
136
+ */
137
+ TRIANGLE_FAN = 6
138
+ }
139
+ export interface VertexData {
140
+ vertexCount: number;
141
+ channels: VertexChannel[];
142
+ }
143
+ export declare enum VertexFormatType {
144
+ Float16 = 0,
145
+ Float32 = 1,
146
+ Int8 = 2,
147
+ Int16 = 3,
148
+ Int32 = 4,
149
+ UInt8 = 5,
150
+ UInt16 = 6,
151
+ UInt32 = 7
152
+ }
153
+ export declare enum IndexFormatType {
154
+ None = -1,
155
+ UInt8 = 0,
156
+ UInt16 = 1,
157
+ UInt32 = 2
158
+ }
159
+ export interface VertexChannel {
160
+ semantic: string;
161
+ offset: number;
162
+ format: VertexFormatType;
163
+ dimension: number;
164
+ normalize?: boolean;
165
+ }
166
+ export declare enum VertexBufferSemantic {
167
+ Position = "POSITION",
168
+ Uv = "TEXCOORD0",
169
+ Uv2 = "TEXCOORD1",
170
+ Normal = "NORMAL",
171
+ Tangent = "TANGENT",
172
+ Color = "COLOR",
173
+ Joints = "JOINTS",
174
+ Weights = "WEIGHTS",
175
+ PositionBS0 = "POSITION_BS0",
176
+ PositionBS1 = "POSITION_BS1",
177
+ PositionBS2 = "POSITION_BS2",
178
+ PositionBS3 = "POSITION_BS3",
179
+ PositionBS4 = "POSITION_BS4",
180
+ PositionBS5 = "POSITION_BS5",
181
+ PositionBS6 = "POSITION_BS6",
182
+ PositionBS7 = "POSITION_BS7",
183
+ NormalBS0 = "NORMAL_BS0",
184
+ NormalBS1 = "NORMAL_BS1",
185
+ NormalBS2 = "NORMAL_BS2",
186
+ NormalBS3 = "NORMAL_BS3",
187
+ TangentBS0 = "TANGENT_BS0",
188
+ TangentBS1 = "TANGENT_BS1",
189
+ TangentBS2 = "TANGENT_BS2",
190
+ TangentBS3 = "TANGENT_BS3"
191
+ }
192
+ export interface ShaderData extends EffectsObjectData {
193
+ vertex: string;
194
+ fragment: string;
195
+ properties?: string;
196
+ }
197
+ export interface EffectComponentData extends ComponentData {
198
+ _priority: number;
199
+ materials: DataPath[];
200
+ geometry: DataPath;
201
+ }
202
+ export interface EffectsPackageData {
203
+ fileSummary: FileSummary;
204
+ exportObjects: EffectsObjectData[];
205
+ }
206
+ export interface FileSummary {
207
+ guid: string;
208
+ assetType: string;
209
+ }
@@ -0,0 +1,129 @@
1
+ export var DataType;
2
+ (function (DataType) {
3
+ DataType["VFXItemData"] = "VFXItemData";
4
+ DataType["EffectComponent"] = "EffectComponent";
5
+ DataType["Material"] = "Material";
6
+ DataType["Shader"] = "Shader";
7
+ DataType["SpriteComponent"] = "SpriteComponent";
8
+ DataType["ParticleSystem"] = "ParticleSystem";
9
+ DataType["InteractComponent"] = "InteractComponent";
10
+ DataType["CameraController"] = "CameraController";
11
+ DataType["Geometry"] = "Geometry";
12
+ DataType["Texture"] = "Texture";
13
+ DataType["AnimationClip"] = "AnimationClip";
14
+ DataType["TextComponent"] = "TextComponent";
15
+ DataType["BinaryAsset"] = "BinaryAsset";
16
+ // Timeline
17
+ DataType["TrackAsset"] = "TrackAsset";
18
+ DataType["TimelineAsset"] = "TimelineAsset";
19
+ DataType["ObjectBindingTrack"] = "ObjectBindingTrack";
20
+ DataType["TransformTrack"] = "TransformTrack";
21
+ DataType["SpriteColorTrack"] = "SpriteColorTrack";
22
+ DataType["ActivationTrack"] = "ActivationTrack";
23
+ DataType["SubCompositionTrack"] = "SubCompositionTrack";
24
+ DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
25
+ DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
26
+ DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
27
+ DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
28
+ // FIXME: 先完成ECS的场景转换,后面移到spec中
29
+ DataType["MeshComponent"] = "MeshComponent";
30
+ DataType["SkyboxComponent"] = "SkyboxComponent";
31
+ DataType["LightComponent"] = "LightComponent";
32
+ DataType["CameraComponent"] = "CameraComponent";
33
+ DataType["ModelPluginComponent"] = "ModelPluginComponent";
34
+ DataType["TreeComponent"] = "TreeComponent";
35
+ DataType["AnimationComponent"] = "AnimationComponent";
36
+ DataType["SpineComponent"] = "SpineComponent";
37
+ // Non-EffectObject
38
+ DataType["TimelineClip"] = "TimelineClip";
39
+ })(DataType || (DataType = {}));
40
+ export var GeometryType;
41
+ (function (GeometryType) {
42
+ /**
43
+ * Draw single points.
44
+ */
45
+ GeometryType[GeometryType["POINTS"] = 0] = "POINTS";
46
+ /**
47
+ * Draw lines. Each vertex connects to the one after it.
48
+ */
49
+ GeometryType[GeometryType["LINES"] = 1] = "LINES";
50
+ /**
51
+ * Draw lines. Each set of two vertices is treated as a separate line segment.
52
+ */
53
+ GeometryType[GeometryType["LINE_LOOP"] = 2] = "LINE_LOOP";
54
+ /**
55
+ * Draw a connected group of line segments from the first vertex to the last.
56
+ */
57
+ GeometryType[GeometryType["LINE_STRIP"] = 3] = "LINE_STRIP";
58
+ /**
59
+ * Draw triangles. Each set of three vertices creates a separate triangle.
60
+ */
61
+ GeometryType[GeometryType["TRIANGLES"] = 4] = "TRIANGLES";
62
+ /**
63
+ * Draw a connected strip of triangles.
64
+ */
65
+ GeometryType[GeometryType["TRIANGLE_STRIP"] = 5] = "TRIANGLE_STRIP";
66
+ /**
67
+ * Draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
68
+ */
69
+ GeometryType[GeometryType["TRIANGLE_FAN"] = 6] = "TRIANGLE_FAN";
70
+ })(GeometryType || (GeometryType = {}));
71
+ export var VertexFormatType;
72
+ (function (VertexFormatType) {
73
+ VertexFormatType[VertexFormatType["Float16"] = 0] = "Float16";
74
+ VertexFormatType[VertexFormatType["Float32"] = 1] = "Float32";
75
+ VertexFormatType[VertexFormatType["Int8"] = 2] = "Int8";
76
+ VertexFormatType[VertexFormatType["Int16"] = 3] = "Int16";
77
+ VertexFormatType[VertexFormatType["Int32"] = 4] = "Int32";
78
+ VertexFormatType[VertexFormatType["UInt8"] = 5] = "UInt8";
79
+ VertexFormatType[VertexFormatType["UInt16"] = 6] = "UInt16";
80
+ VertexFormatType[VertexFormatType["UInt32"] = 7] = "UInt32";
81
+ })(VertexFormatType || (VertexFormatType = {}));
82
+ export var IndexFormatType;
83
+ (function (IndexFormatType) {
84
+ IndexFormatType[IndexFormatType["None"] = -1] = "None";
85
+ IndexFormatType[IndexFormatType["UInt8"] = 0] = "UInt8";
86
+ IndexFormatType[IndexFormatType["UInt16"] = 1] = "UInt16";
87
+ IndexFormatType[IndexFormatType["UInt32"] = 2] = "UInt32";
88
+ })(IndexFormatType || (IndexFormatType = {}));
89
+ // BINORMAL[n] Binormal float4
90
+ // BLENDINDICES[n] 混合索引 uint
91
+ // BLENDWEIGHT[n] 混合权重 FLOAT
92
+ // COLOR[n] 漫射和反射颜色 float4
93
+ // NORMAL[n] 法向矢量 float4
94
+ // POSITION[n] 对象空间中的顶点位置。 float4
95
+ // POSITIONT 变换的顶点位置。 float4
96
+ // PSIZE[n] 点大小 FLOAT
97
+ // TANGENT[n] 正切 float4
98
+ // TEXCOORD[n] 纹理坐标 float4
99
+ // POSITION_BS[n] Blend Shape 空间中的顶点位置 float4
100
+ // NORMAL_BS[n] Blend Shape 空间中的法向矢量 float4
101
+ // TANGENT_BS[n] Blend Shape 空间中的正切矢量 float4
102
+ export var VertexBufferSemantic;
103
+ (function (VertexBufferSemantic) {
104
+ VertexBufferSemantic["Position"] = "POSITION";
105
+ VertexBufferSemantic["Uv"] = "TEXCOORD0";
106
+ VertexBufferSemantic["Uv2"] = "TEXCOORD1";
107
+ VertexBufferSemantic["Normal"] = "NORMAL";
108
+ VertexBufferSemantic["Tangent"] = "TANGENT";
109
+ VertexBufferSemantic["Color"] = "COLOR";
110
+ VertexBufferSemantic["Joints"] = "JOINTS";
111
+ VertexBufferSemantic["Weights"] = "WEIGHTS";
112
+ //
113
+ VertexBufferSemantic["PositionBS0"] = "POSITION_BS0";
114
+ VertexBufferSemantic["PositionBS1"] = "POSITION_BS1";
115
+ VertexBufferSemantic["PositionBS2"] = "POSITION_BS2";
116
+ VertexBufferSemantic["PositionBS3"] = "POSITION_BS3";
117
+ VertexBufferSemantic["PositionBS4"] = "POSITION_BS4";
118
+ VertexBufferSemantic["PositionBS5"] = "POSITION_BS5";
119
+ VertexBufferSemantic["PositionBS6"] = "POSITION_BS6";
120
+ VertexBufferSemantic["PositionBS7"] = "POSITION_BS7";
121
+ VertexBufferSemantic["NormalBS0"] = "NORMAL_BS0";
122
+ VertexBufferSemantic["NormalBS1"] = "NORMAL_BS1";
123
+ VertexBufferSemantic["NormalBS2"] = "NORMAL_BS2";
124
+ VertexBufferSemantic["NormalBS3"] = "NORMAL_BS3";
125
+ VertexBufferSemantic["TangentBS0"] = "TANGENT_BS0";
126
+ VertexBufferSemantic["TangentBS1"] = "TANGENT_BS1";
127
+ VertexBufferSemantic["TangentBS2"] = "TANGENT_BS2";
128
+ VertexBufferSemantic["TangentBS3"] = "TANGENT_BS3";
129
+ })(VertexBufferSemantic || (VertexBufferSemantic = {}));
@@ -1,14 +1,15 @@
1
- import type { Item } from './item';
2
1
  import type { DataPath } from './components';
2
+ import type { Item } from './item';
3
+ import type { EndBehavior } from './item/base-item';
3
4
  export declare enum CameraClipMode {
4
5
  /**
5
6
  * 剪裁上下
6
7
  */
7
- portrait,
8
+ portrait = 1,
8
9
  /**
9
10
  * 剪裁左右
10
11
  */
11
- landscape
12
+ landscape = 0
12
13
  }
13
14
  /**
14
15
  * 相机属性
@@ -41,39 +42,7 @@ export interface CameraOptions {
41
42
  */
42
43
  clipMode: CameraClipMode;
43
44
  }
44
- /**
45
- * 结束行为
46
- */
47
- export declare enum CompositionEndBehavior {
48
- /**
49
- * 销毁
50
- */
51
- destroy,
52
- /**
53
- * 暂停
54
- */
55
- pause,
56
- /**
57
- * 重播
58
- */
59
- restart,
60
- /**
61
- * 无限播放
62
- */
63
- forward,
64
- /**
65
- * 销毁并保留最后一帧
66
- */
67
- pause_destroy,
68
- /**
69
- * 冻结
70
- */
71
- freeze
72
- }
73
- /**
74
- * 合成信息
75
- */
76
- export interface Composition {
45
+ interface CompositionBase {
77
46
  /**
78
47
  * 合成ID
79
48
  */
@@ -94,15 +63,11 @@ export interface Composition {
94
63
  /**
95
64
  * 合成结束行为
96
65
  */
97
- endBehavior: CompositionEndBehavior;
66
+ endBehavior: EndBehavior;
98
67
  /**
99
68
  * 合成相机信息
100
69
  */
101
70
  camera: CameraOptions;
102
- /**
103
- * 元素信息
104
- */
105
- items: Item[];
106
71
  /**
107
72
  * 合成视窗预览大小
108
73
  * 如果没有提供,默认为 player 的 container 大小
@@ -115,46 +80,39 @@ export interface Composition {
115
80
  fallbackImage?: string;
116
81
  }
117
82
  /**
118
- * 合成数据
83
+ * 合成信息
119
84
  */
120
- export interface CompositionData {
85
+ export interface Composition extends CompositionBase {
121
86
  /**
122
- * 合成ID
123
- */
124
- id: string;
125
- /**
126
- * 合成名称
127
- */
128
- name: string;
129
- /**
130
- * 合成持续时间
131
- */
132
- duration: number;
133
- /**
134
- * 合成开始播放的时间,单位妙
135
- * @default 0
87
+ * 元素信息
136
88
  */
137
- startTime?: number;
89
+ items: Item[];
90
+ }
91
+ /**
92
+ * 合成数据
93
+ */
94
+ export interface CompositionData extends CompositionBase {
138
95
  /**
139
- * 合成结束行为
96
+ * 元素信息
140
97
  */
141
- endBehavior: CompositionEndBehavior;
98
+ items: DataPath[];
142
99
  /**
143
- * 合成相机信息
100
+ * 时间轴资产(TimelineAssetData)
144
101
  */
145
- camera: CameraOptions;
102
+ timelineAsset: DataPath;
146
103
  /**
147
- * 元素信息
104
+ * 轨道的场景绑定
148
105
  */
149
- items: DataPath[];
106
+ sceneBindings: SceneBindingData[];
107
+ }
108
+ export interface SceneBindingData {
150
109
  /**
151
- * 合成视窗预览大小
152
- * 如果没有提供,默认为 player 的 container 大小
153
- * @default [0,0]
110
+ * 绑定的轨道资产(TrackAssetData)
154
111
  */
155
- previewSize?: [width: number, height: number];
112
+ key: DataPath;
156
113
  /**
157
- * 降级图
114
+ * 被绑定的场景对象(VFXItemData)
158
115
  */
159
- fallbackImage?: string;
116
+ value: DataPath;
160
117
  }
118
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CAMERA_CLIP_MODE_NORMAL, CAMERA_CLIP_MODE_VERTICAL } from './constants';
2
+ export var CameraClipMode;
3
+ (function (CameraClipMode) {
4
+ /**
5
+ * 剪裁上下
6
+ */
7
+ CameraClipMode[CameraClipMode["portrait"] = 1] = "portrait";
8
+ /**
9
+ * 剪裁左右
10
+ */
11
+ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
12
+ })(CameraClipMode || (CameraClipMode = {}));
@@ -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;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 销毁
3
+ */
4
+ export const END_BEHAVIOR_DESTROY = 0;
5
+ /**
6
+ * 暂停
7
+ * @deprecated since 2.0 - use `END_BEHAVIOR_FREEZE` instead
8
+ */
9
+ export const END_BEHAVIOR_PAUSE = 1;
10
+ /**
11
+ * 无限播放
12
+ */
13
+ export const END_BEHAVIOR_FORWARD = 2;
14
+ /**
15
+ * 销毁并保留最后一帧
16
+ * @deprecated since 2.0
17
+ */
18
+ export const END_BEHAVIOR_PAUSE_AND_DESTROY = 3;
19
+ /**
20
+ * 冻结
21
+ */
22
+ export const END_BEHAVIOR_FREEZE = 4;
23
+ /**
24
+ * 重播
25
+ */
26
+ export const END_BEHAVIOR_RESTART = 5;
27
+ /**
28
+ *
29
+ */
30
+ export const END_BEHAVIOR_DESTROY_CHILDREN = 6;
31
+ export const CAMERA_CLIP_MODE_VERTICAL = 1;
32
+ export const CAMERA_CLIP_MODE_NORMAL = 0;
33
+ export const MESSAGE_ITEM_PHRASE_BEGIN = 2;
34
+ export const MESSAGE_ITEM_PHRASE_END = 1;