@galacean/effects-specification 2.0.0-alpha.13 → 2.0.0-alpha.15
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/animation-clip-data.d.ts +4 -4
- package/es/components.d.ts +20 -10
- package/es/components.js +18 -6
- package/es/composition.d.ts +19 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/item/model/tree.d.ts +10 -0
- package/es/item/null-item.d.ts +1 -49
- package/es/item/spine-item.d.ts +7 -0
- package/es/number-expression.d.ts +14 -1
- package/es/number-expression.js +4 -0
- package/es/scene.d.ts +5 -0
- package/es/timeline/index.d.ts +5 -0
- package/es/timeline/index.js +5 -0
- package/es/timeline/sprite-color-playable-asset-data.d.ts +7 -0
- package/es/timeline/sprite-color-playable-asset-data.js +1 -0
- package/es/timeline/timeline-asset-data.d.ts +7 -0
- package/es/timeline/timeline-asset-data.js +1 -0
- package/es/timeline/timeline-clip-data.d.ts +9 -0
- package/es/timeline/timeline-clip-data.js +1 -0
- package/es/timeline/track/track-asset-data.d.ts +9 -0
- package/es/timeline/track/track-asset-data.js +1 -0
- package/es/timeline/transform-playable-asset-data.d.ts +16 -0
- package/es/timeline/transform-playable-asset-data.js +1 -0
- package/es/type.d.ts +5 -1
- package/es/type.js +4 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EffectsObjectData } from './components';
|
|
2
|
-
import type { FixedNumberExpression, FixedVec3Expression } from './number-expression';
|
|
2
|
+
import type { FixedNumberExpression, FixedVec3Expression, FixedQuatExpression } from './number-expression';
|
|
3
3
|
export interface AnimationClipData extends EffectsObjectData {
|
|
4
4
|
positionCurves: PositionCurveData[];
|
|
5
|
-
|
|
5
|
+
rotationCurves: RotationCurveData[];
|
|
6
6
|
scaleCurves: ScaleCurveData[];
|
|
7
7
|
floatCurves: FloatCurveData[];
|
|
8
8
|
}
|
|
@@ -10,9 +10,9 @@ export interface PositionCurveData {
|
|
|
10
10
|
path: string;
|
|
11
11
|
keyFrames: FixedVec3Expression;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface RotationCurveData {
|
|
14
14
|
path: string;
|
|
15
|
-
keyFrames:
|
|
15
|
+
keyFrames: FixedQuatExpression;
|
|
16
16
|
}
|
|
17
17
|
export interface ScaleCurveData {
|
|
18
18
|
path: string;
|
package/es/components.d.ts
CHANGED
|
@@ -12,12 +12,18 @@ export declare enum DataType {
|
|
|
12
12
|
Texture = "Texture",
|
|
13
13
|
AnimationClip = "AnimationClip",
|
|
14
14
|
TextComponent = "TextComponent",
|
|
15
|
+
TrackAsset = "TrackAsset",
|
|
16
|
+
TimelineAsset = "TimelineAsset",
|
|
17
|
+
TransformPlayableAsset = "TransformPlayableAsset",
|
|
18
|
+
SpriteColorPlayableAsset = "SpriteColorPlayableAsset",
|
|
15
19
|
MeshComponent = "MeshComponent",
|
|
16
20
|
SkyboxComponent = "SkyboxComponent",
|
|
17
21
|
LightComponent = "LightComponent",
|
|
18
22
|
CameraComponent = "CameraComponent",
|
|
19
23
|
ModelPluginComponent = "ModelPluginComponent",
|
|
20
|
-
TreeComponent = "TreeComponent"
|
|
24
|
+
TreeComponent = "TreeComponent",
|
|
25
|
+
AnimationComponent = "AnimationComponent",
|
|
26
|
+
TimelineClip = "TimelineClip"
|
|
21
27
|
}
|
|
22
28
|
export interface DataPath {
|
|
23
29
|
id: string;
|
|
@@ -62,7 +68,7 @@ export interface MaterialData extends EffectsObjectData {
|
|
|
62
68
|
}
|
|
63
69
|
export interface GeometryData extends EffectsObjectData {
|
|
64
70
|
vertexData: VertexData;
|
|
65
|
-
indexFormat:
|
|
71
|
+
indexFormat: IndexFormatType;
|
|
66
72
|
indexOffset: number;
|
|
67
73
|
subMeshes: SubMesh[];
|
|
68
74
|
/**
|
|
@@ -81,7 +87,7 @@ export interface GeometryData extends EffectsObjectData {
|
|
|
81
87
|
rootBoneName?: string;
|
|
82
88
|
inverseBindMatrices?: number[];
|
|
83
89
|
}
|
|
84
|
-
interface SubMesh {
|
|
90
|
+
export interface SubMesh {
|
|
85
91
|
offset: number;
|
|
86
92
|
indexCount?: number;
|
|
87
93
|
vertexCount: number;
|
|
@@ -121,15 +127,20 @@ export interface VertexData {
|
|
|
121
127
|
channels: VertexChannel[];
|
|
122
128
|
}
|
|
123
129
|
export declare enum VertexFormatType {
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
Float16 = 0,
|
|
131
|
+
Float32 = 1,
|
|
126
132
|
Int8 = 2,
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
Int16 = 3,
|
|
134
|
+
Int32 = 4,
|
|
135
|
+
UInt8 = 5,
|
|
136
|
+
UInt16 = 6,
|
|
137
|
+
UInt32 = 7
|
|
129
138
|
}
|
|
130
139
|
export declare enum IndexFormatType {
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
None = -1,
|
|
141
|
+
UInt8 = 0,
|
|
142
|
+
UInt16 = 1,
|
|
143
|
+
UInt32 = 2
|
|
133
144
|
}
|
|
134
145
|
export interface VertexChannel {
|
|
135
146
|
semantic: string;
|
|
@@ -182,4 +193,3 @@ export interface FileSummary {
|
|
|
182
193
|
guid: string;
|
|
183
194
|
assetType: string;
|
|
184
195
|
}
|
|
185
|
-
export {};
|
package/es/components.js
CHANGED
|
@@ -12,6 +12,10 @@ export var DataType;
|
|
|
12
12
|
DataType["Texture"] = "Texture";
|
|
13
13
|
DataType["AnimationClip"] = "AnimationClip";
|
|
14
14
|
DataType["TextComponent"] = "TextComponent";
|
|
15
|
+
DataType["TrackAsset"] = "TrackAsset";
|
|
16
|
+
DataType["TimelineAsset"] = "TimelineAsset";
|
|
17
|
+
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
18
|
+
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
15
19
|
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
16
20
|
DataType["MeshComponent"] = "MeshComponent";
|
|
17
21
|
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
@@ -19,6 +23,9 @@ export var DataType;
|
|
|
19
23
|
DataType["CameraComponent"] = "CameraComponent";
|
|
20
24
|
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
21
25
|
DataType["TreeComponent"] = "TreeComponent";
|
|
26
|
+
DataType["AnimationComponent"] = "AnimationComponent";
|
|
27
|
+
// Non-EffectObject
|
|
28
|
+
DataType["TimelineClip"] = "TimelineClip";
|
|
22
29
|
})(DataType || (DataType = {}));
|
|
23
30
|
export var GeometryType;
|
|
24
31
|
(function (GeometryType) {
|
|
@@ -53,16 +60,21 @@ export var GeometryType;
|
|
|
53
60
|
})(GeometryType || (GeometryType = {}));
|
|
54
61
|
export var VertexFormatType;
|
|
55
62
|
(function (VertexFormatType) {
|
|
56
|
-
VertexFormatType[VertexFormatType["
|
|
57
|
-
VertexFormatType[VertexFormatType["
|
|
63
|
+
VertexFormatType[VertexFormatType["Float16"] = 0] = "Float16";
|
|
64
|
+
VertexFormatType[VertexFormatType["Float32"] = 1] = "Float32";
|
|
58
65
|
VertexFormatType[VertexFormatType["Int8"] = 2] = "Int8";
|
|
59
|
-
VertexFormatType[VertexFormatType["
|
|
60
|
-
VertexFormatType[VertexFormatType["
|
|
66
|
+
VertexFormatType[VertexFormatType["Int16"] = 3] = "Int16";
|
|
67
|
+
VertexFormatType[VertexFormatType["Int32"] = 4] = "Int32";
|
|
68
|
+
VertexFormatType[VertexFormatType["UInt8"] = 5] = "UInt8";
|
|
69
|
+
VertexFormatType[VertexFormatType["UInt16"] = 6] = "UInt16";
|
|
70
|
+
VertexFormatType[VertexFormatType["UInt32"] = 7] = "UInt32";
|
|
61
71
|
})(VertexFormatType || (VertexFormatType = {}));
|
|
62
72
|
export var IndexFormatType;
|
|
63
73
|
(function (IndexFormatType) {
|
|
64
|
-
IndexFormatType[IndexFormatType["
|
|
65
|
-
IndexFormatType[IndexFormatType["
|
|
74
|
+
IndexFormatType[IndexFormatType["None"] = -1] = "None";
|
|
75
|
+
IndexFormatType[IndexFormatType["UInt8"] = 0] = "UInt8";
|
|
76
|
+
IndexFormatType[IndexFormatType["UInt16"] = 1] = "UInt16";
|
|
77
|
+
IndexFormatType[IndexFormatType["UInt32"] = 2] = "UInt32";
|
|
66
78
|
})(IndexFormatType || (IndexFormatType = {}));
|
|
67
79
|
// BINORMAL[n] Binormal float4
|
|
68
80
|
// BLENDINDICES[n] 混合索引 uint
|
package/es/composition.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Item } from './item';
|
|
2
1
|
import type { DataPath } from './components';
|
|
2
|
+
import type { Item } from './item';
|
|
3
3
|
export declare enum CameraClipMode {
|
|
4
4
|
/**
|
|
5
5
|
* 剪裁上下
|
|
@@ -157,4 +157,22 @@ export interface CompositionData {
|
|
|
157
157
|
* 降级图
|
|
158
158
|
*/
|
|
159
159
|
fallbackImage?: string;
|
|
160
|
+
/**
|
|
161
|
+
* 时间轴资产(TimelineAssetData)
|
|
162
|
+
*/
|
|
163
|
+
timelineAsset: DataPath;
|
|
164
|
+
/**
|
|
165
|
+
* 轨道的场景绑定
|
|
166
|
+
*/
|
|
167
|
+
sceneBindings: SceneBindingData[];
|
|
168
|
+
}
|
|
169
|
+
export interface SceneBindingData {
|
|
170
|
+
/**
|
|
171
|
+
* 绑定的轨道资产(TrackAssetData)
|
|
172
|
+
*/
|
|
173
|
+
key: DataPath;
|
|
174
|
+
/**
|
|
175
|
+
* 被绑定的场景对象(VFXItemData)
|
|
176
|
+
*/
|
|
177
|
+
value: DataPath;
|
|
160
178
|
}
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/es/item/model/tree.d.ts
CHANGED
|
@@ -85,3 +85,13 @@ export interface ModelAnimationComponentData extends ComponentData {
|
|
|
85
85
|
*/
|
|
86
86
|
animations: ModelAnimationData[];
|
|
87
87
|
}
|
|
88
|
+
export interface AnimationComponentData extends ComponentData {
|
|
89
|
+
/**
|
|
90
|
+
* 默认动画索引,-1表示不播放动画
|
|
91
|
+
*/
|
|
92
|
+
animation?: number;
|
|
93
|
+
/**
|
|
94
|
+
* glTF中所有的动画数据
|
|
95
|
+
*/
|
|
96
|
+
animationClips: DataPath[];
|
|
97
|
+
}
|
package/es/item/null-item.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType } from '../type';
|
|
2
1
|
import type { RGBAColorValue } from '../number-expression';
|
|
2
|
+
import type { ColorOverLifetime, ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
|
|
3
3
|
import type { BaseItem } from './base-item';
|
|
4
|
-
import type { ComponentData, DataPath, EffectsObjectData } from '../components';
|
|
5
4
|
/**
|
|
6
5
|
* 空节点元素
|
|
7
6
|
*/
|
|
@@ -45,50 +44,3 @@ export interface NullContent {
|
|
|
45
44
|
*/
|
|
46
45
|
colorOverLifetime?: ColorOverLifetime;
|
|
47
46
|
}
|
|
48
|
-
export interface TimelineComponentData extends ComponentData {
|
|
49
|
-
/**
|
|
50
|
-
* 轨道数据
|
|
51
|
-
*/
|
|
52
|
-
tracks: TrackAssetData[];
|
|
53
|
-
}
|
|
54
|
-
export interface PlayableAssetData {
|
|
55
|
-
dataType: string;
|
|
56
|
-
}
|
|
57
|
-
export interface TrackAssetData extends PlayableAssetData {
|
|
58
|
-
clips: TimelineClipData[];
|
|
59
|
-
}
|
|
60
|
-
export interface TimelineClipData {
|
|
61
|
-
start: number;
|
|
62
|
-
duration: number;
|
|
63
|
-
clipAsset: DataPath;
|
|
64
|
-
}
|
|
65
|
-
export interface TransformAnimationPlayableAssetData extends PlayableAssetData {
|
|
66
|
-
animationClip: DataPath;
|
|
67
|
-
}
|
|
68
|
-
export interface SpriteColorAnimationPlayableAssetData extends PlayableAssetData {
|
|
69
|
-
animationClip: DataPath;
|
|
70
|
-
}
|
|
71
|
-
export interface TransformAnimationClipData extends EffectsObjectData {
|
|
72
|
-
/**
|
|
73
|
-
* 空节点元素大小变化属性
|
|
74
|
-
*/
|
|
75
|
-
sizeOverLifetime?: SizeOverLifetime;
|
|
76
|
-
/**
|
|
77
|
-
* 空节点元素旋转变化属性
|
|
78
|
-
*/
|
|
79
|
-
rotationOverLifetime?: RotationOverLifetime;
|
|
80
|
-
/**
|
|
81
|
-
* 空节点元素位置变化属性
|
|
82
|
-
*/
|
|
83
|
-
positionOverLifetime?: PositionOverLifetime;
|
|
84
|
-
}
|
|
85
|
-
export interface SpriteColorAnimationClipData extends EffectsObjectData {
|
|
86
|
-
/**
|
|
87
|
-
* 空节点元素色彩变化属性
|
|
88
|
-
*/
|
|
89
|
-
colorOverLifetime?: ColorOverLifetime;
|
|
90
|
-
/**
|
|
91
|
-
* 图层初始颜色
|
|
92
|
-
*/
|
|
93
|
-
startColor?: RGBAColorValue;
|
|
94
|
-
}
|
package/es/item/spine-item.d.ts
CHANGED
|
@@ -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]
|
|
@@ -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;
|
package/es/number-expression.js
CHANGED
|
@@ -71,6 +71,10 @@ export var ValueType;
|
|
|
71
71
|
* 贝塞尔曲线路径
|
|
72
72
|
*/
|
|
73
73
|
ValueType[ValueType["BEZIER_CURVE_PATH"] = 22] = "BEZIER_CURVE_PATH";
|
|
74
|
+
/**
|
|
75
|
+
* 贝塞尔曲线四元数
|
|
76
|
+
*/
|
|
77
|
+
ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
|
|
74
78
|
})(ValueType || (ValueType = {}));
|
|
75
79
|
/**
|
|
76
80
|
* 关键帧类型
|
package/es/scene.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { FontBase, FontDefine } from './text';
|
|
|
6
6
|
import type { BinaryFile } from './binary';
|
|
7
7
|
import type { ComponentData, 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
|
* 素材信息存放于统一数据结构中
|
|
@@ -188,4 +189,8 @@ export interface JSONScene {
|
|
|
188
189
|
* 几何体数据
|
|
189
190
|
*/
|
|
190
191
|
geometries: GeometryData[];
|
|
192
|
+
/**
|
|
193
|
+
* 动画数据
|
|
194
|
+
*/
|
|
195
|
+
animations: AnimationClipData[];
|
|
191
196
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EffectsObjectData } from '../components';
|
|
2
|
+
import type { RGBAColorValue } from '../number-expression';
|
|
3
|
+
import type { ColorOverLifetime } from '../type';
|
|
4
|
+
export interface SpriteColorPlayableAssetData extends EffectsObjectData {
|
|
5
|
+
colorOverLifetime?: ColorOverLifetime;
|
|
6
|
+
startColor?: RGBAColorValue;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DataPath, EffectsObjectData } from '../../components';
|
|
2
|
+
import type { TimelineClipData } from '../timeline-clip-data';
|
|
3
|
+
export interface TrackAssetData extends EffectsObjectData {
|
|
4
|
+
/**
|
|
5
|
+
* 子轨道数据(TrackAssetData)
|
|
6
|
+
*/
|
|
7
|
+
children: DataPath[];
|
|
8
|
+
clips: TimelineClipData;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EffectsObjectData } from '../components';
|
|
2
|
+
import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime } from '../type';
|
|
3
|
+
export interface TransformPlayableAssetData extends EffectsObjectData {
|
|
4
|
+
/**
|
|
5
|
+
* 元素大小变化属性
|
|
6
|
+
*/
|
|
7
|
+
sizeOverLifetime?: SizeOverLifetime;
|
|
8
|
+
/**
|
|
9
|
+
* 元素旋转变化属性
|
|
10
|
+
*/
|
|
11
|
+
rotationOverLifetime?: RotationOverLifetime;
|
|
12
|
+
/**
|
|
13
|
+
* 元素位置变化属性
|
|
14
|
+
*/
|
|
15
|
+
positionOverLifetime?: PositionOverLifetime;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/type.d.ts
CHANGED
package/es/type.js
CHANGED