@galacean/effects-specification 2.8.0-alpha.0 → 2.8.0

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.
@@ -1,5 +1,6 @@
1
- import type { EffectsObjectData } from './effects-object-data';
2
- import type { ColorCurveValue, Vector3CurveValue, BezierValue, BezierCurvePath, BezierCurveQuat } from './number-expression';
1
+ import type { EffectsObjectData } from '../effects-object-data';
2
+ import type { ColorCurveValue, Vector3CurveValue, BezierValue, BezierCurvePath, BezierCurveQuat } from '../number-expression';
3
+ import type { AnimationEventInfoData } from './animation-event';
3
4
  export interface AnimationClipData extends EffectsObjectData {
4
5
  duration?: number;
5
6
  positionCurves?: PositionCurveData[];
@@ -8,6 +9,7 @@ export interface AnimationClipData extends EffectsObjectData {
8
9
  scaleCurves?: ScaleCurveData[];
9
10
  floatCurves?: AnimationCurveFloatData[];
10
11
  colorCurves?: AnimationCurveColorData[];
12
+ events?: AnimationEventInfoData[];
11
13
  }
12
14
  export interface PositionCurveData {
13
15
  path: string;
@@ -0,0 +1,5 @@
1
+ export interface AnimationEventInfoData {
2
+ name: string;
3
+ startTime: number;
4
+ duration?: number;
5
+ }
@@ -0,0 +1,4 @@
1
+ // export interface AnimationEventData {
2
+ // typeName?: string,
3
+ // }
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './animation-clip-data';
2
+ export * from './animation-event';
@@ -0,0 +1,2 @@
1
+ export * from './animation-clip-data';
2
+ export * from './animation-event';
@@ -1,6 +1,6 @@
1
1
  export declare const BuiltinObjectGUID: {
2
2
  WhiteTexture: string;
3
- TransparentTexture: string;
3
+ EmptyTexture: string;
4
4
  PBRShader: string;
5
5
  UnlitShader: string;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  export const BuiltinObjectGUID = {
2
2
  WhiteTexture: 'whitetexture00000000000000000000',
3
- TransparentTexture: 'transparenttexture00000000000000000000',
3
+ EmptyTexture: 'emptyTexture00000000000000000000',
4
4
  PBRShader: 'pbr00000000000000000000000000000',
5
5
  UnlitShader: 'unlit000000000000000000000000000',
6
6
  };
@@ -0,0 +1,7 @@
1
+ import type { ComponentData } from './component-data';
2
+ import type { ColorData } from '../math/color-data';
3
+ import type { DataType } from 'src/data-type';
4
+ export interface FrameComponentData extends ComponentData {
5
+ dataType: DataType.FrameComponent;
6
+ color?: ColorData;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,6 @@
1
1
  export * from './component-data';
2
2
  export * from './post-process-volume-data';
3
3
  export * from './ffd-data';
4
+ export * from './frame-component-data';
5
+ export * from './maskable-graphic-data';
6
+ export * from './orientation-component-data';
@@ -1,3 +1,6 @@
1
1
  export * from './component-data';
2
2
  export * from './post-process-volume-data';
3
3
  export * from './ffd-data';
4
+ export * from './frame-component-data';
5
+ export * from './maskable-graphic-data';
6
+ export * from './orientation-component-data';
@@ -0,0 +1,7 @@
1
+ import type { ComponentData } from './component-data';
2
+ import type { RendererOptions } from '../type';
3
+ import type { MaskOptions } from '../item/base-item';
4
+ export interface MaskableGraphicData extends ComponentData {
5
+ renderer: RendererOptions;
6
+ mask?: MaskOptions;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ComponentData } from './component-data';
2
+ import type { PluginGyroscopeTarget } from '../type';
3
+ export interface OrientationComponentData extends ComponentData {
4
+ options: {
5
+ targets?: PluginGyroscopeTarget[];
6
+ };
7
+ }
@@ -0,0 +1 @@
1
+ export {};
package/es/data-type.d.ts CHANGED
@@ -51,6 +51,7 @@ export declare enum DataType {
51
51
  AnimationGraphAsset = "AnimationGraphAsset",
52
52
  CompositionComponent = "CompositionComponent",
53
53
  FFDComponent = "FFDComponent",
54
+ FrameComponent = "FrameComponent",
54
55
  Animator = "Animator",
55
56
  TimelineClip = "TimelineClip"
56
57
  }
package/es/data-type.js CHANGED
@@ -55,6 +55,7 @@ export var DataType;
55
55
  DataType["AnimationGraphAsset"] = "AnimationGraphAsset";
56
56
  DataType["CompositionComponent"] = "CompositionComponent";
57
57
  DataType["FFDComponent"] = "FFDComponent";
58
+ DataType["FrameComponent"] = "FrameComponent";
58
59
  DataType["Animator"] = "Animator";
59
60
  // Non-EffectObject
60
61
  DataType["TimelineClip"] = "TimelineClip";
package/es/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export * from './item/video-item';
24
24
  export * from './item/audio-item';
25
25
  export * from './item/model';
26
26
  export * from './vfx-item-data';
27
- export * from './animation-clip-data';
27
+ export * from './animation';
28
28
  export * from './binary';
29
29
  export * from './text';
30
30
  export * from './components';
package/es/index.js CHANGED
@@ -24,7 +24,7 @@ export * from './item/video-item';
24
24
  export * from './item/audio-item';
25
25
  export * from './item/model';
26
26
  export * from './vfx-item-data';
27
- export * from './animation-clip-data';
27
+ export * from './animation';
28
28
  export * from './binary';
29
29
  export * from './text';
30
30
  export * from './components';
@@ -2,6 +2,7 @@ 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';
5
+ import type { ComponentData } from '../components/component-data';
5
6
  export interface CameraItem extends BaseItem {
6
7
  /**
7
8
  * 元素类型[指定为model]
@@ -67,3 +68,5 @@ export interface CameraPositionOverLifetime {
67
68
  */
68
69
  path?: FixedVec3Expression;
69
70
  }
71
+ export interface CameraControllerData extends ComponentData, CameraContent {
72
+ }
@@ -95,3 +95,5 @@ export interface AnimationComponentData extends ComponentData {
95
95
  */
96
96
  animationClips: DataPath[];
97
97
  }
98
+ export interface ModelTreeComponentData<T extends BinaryEnv> extends ComponentData, ModelTreeContent<T> {
99
+ }
@@ -1,4 +1,4 @@
1
- import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, SplitParameter, ObscuredMode } from '../type';
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
3
  import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
@@ -229,6 +229,10 @@ export interface ParticleTextureSheetAnimation extends TextureSheetAnimation {
229
229
  animationDuration: NumberExpression;
230
230
  }
231
231
  export interface ParticleOptions {
232
+ /**
233
+ * 发射循环开关
234
+ */
235
+ looping?: boolean;
232
236
  /**
233
237
  * 最大粒子数
234
238
  */
@@ -417,8 +421,4 @@ export interface ParticleTrail {
417
421
  * 拖尾+图层绑定同一个父节点时使用
418
422
  */
419
423
  parentAffectsPosition?: boolean;
420
- /**
421
- * 拖尾蒙版属性,传入表示需要被遮挡/反向遮挡
422
- */
423
- mask?: ObscuredMode;
424
424
  }
@@ -1,7 +1,7 @@
1
1
  import type { BaseItem, EndBehavior, MaskOptions } 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
- import type { ComponentData } from '../components';
4
+ import type { ComponentData, DataPath } from '../components';
5
5
  /**
6
6
  * 图层元素
7
7
  */
@@ -79,4 +79,8 @@ export interface SpriteContent {
79
79
  * 图层组件属性
80
80
  */
81
81
  export interface SpriteComponentData extends ComponentData, SpriteContent {
82
+ /**
83
+ * 自定义几何体数据
84
+ */
85
+ geometry?: DataPath;
82
86
  }
@@ -27,11 +27,13 @@ export declare enum ValueType {
27
27
  */
28
28
  LINE = 5,
29
29
  /**
30
- * 曲线
30
+ * 曲线(Hermite 曲线)
31
+ * @deprecated 使用 BEZIER_CURVE 替代,此类型仅用于旧数据迁移兼容
31
32
  */
32
33
  CURVE = 6,
33
34
  /**
34
35
  * 贝塞尔路径
36
+ * @deprecated 使用 BEZIER_CURVE_PATH 替代,此类型仅用于旧数据迁移兼容
35
37
  */
36
38
  BEZIER_PATH = 7,
37
39
  /**
@@ -129,6 +131,10 @@ export type mat4 = [
129
131
  export type FunctionExpression = LineValue | CurveValue | BezierValue;
130
132
  export type FixedNumberExpression = ConstantNumber | LineValue | CurveValue | BezierValue;
131
133
  export type NumberExpression = FixedNumberExpression | RandomValue;
134
+ /**
135
+ * 固定 vec3 表达式
136
+ * @deprecated BezierPath 和 LinearPath 仅用于旧数据迁移兼容,推荐使用 BezierCurvePath
137
+ */
132
138
  export type FixedVec3Expression = ConstantVec3 | BezierPath | LinearPath | BezierCurvePath;
133
139
  export type FixedQuatExpression = BezierCurveQuat;
134
140
  /**
@@ -151,11 +157,13 @@ export type RandomValue = [type: ValueType.RANDOM, value: [min: number, max: num
151
157
  export type LineValue = [type: ValueType.LINE, value: [time: number, value: number][]];
152
158
  export type CurveEasingPoint = [time: number, value: number, tanIn: number, tanOut: number];
153
159
  /**
154
- * 曲线段数值
160
+ * 曲线段数值(Hermite 曲线)
161
+ * @deprecated 使用 BezierValue 替代,此类型仅用于旧数据迁移兼容
155
162
  */
156
163
  export type CurveValue = [type: ValueType.CURVE, value: CurveEasingPoint[]];
157
164
  /**
158
165
  * 贝塞尔路径数值
166
+ * @deprecated 使用 BezierCurvePath 替代,此类型仅用于旧数据迁移兼容
159
167
  */
160
168
  export type BezierPath = [type: ValueType.BEZIER_PATH, value: BezierPathValue];
161
169
  export type BezierPathValue = [
@@ -28,11 +28,13 @@ export var ValueType;
28
28
  */
29
29
  ValueType[ValueType["LINE"] = 5] = "LINE";
30
30
  /**
31
- * 曲线
31
+ * 曲线(Hermite 曲线)
32
+ * @deprecated 使用 BEZIER_CURVE 替代,此类型仅用于旧数据迁移兼容
32
33
  */
33
34
  ValueType[ValueType["CURVE"] = 6] = "CURVE";
34
35
  /**
35
36
  * 贝塞尔路径
37
+ * @deprecated 使用 BEZIER_CURVE_PATH 替代,此类型仅用于旧数据迁移兼容
36
38
  */
37
39
  ValueType[ValueType["BEZIER_PATH"] = 7] = "BEZIER_PATH";
38
40
  /**
package/es/scene.d.ts CHANGED
@@ -6,13 +6,13 @@ import type { FontBase, FontDefine } from './text';
6
6
  import type { BinaryFile } from './binary';
7
7
  import type { ComponentData } from './components';
8
8
  import type { VFXItemData } from './vfx-item-data';
9
- import type { AnimationClipData } from './animation-clip-data';
10
9
  import type { AssetBase, ImageSource, VideoInfo } from './assets';
11
10
  import type { RenderSettings } from './render-settings';
12
11
  import type { EffectsObjectData } from './effects-object-data';
13
12
  import type { MaterialData } from './material-data';
14
13
  import type { GeometryData } from './geometry-data';
15
14
  import type { ShaderData } from './shader-data';
15
+ import type { AnimationClipData } from './animation';
16
16
  /**
17
17
  * JSON 版本
18
18
  */
@@ -41,7 +41,7 @@ export declare enum JSONSceneVersion {
41
41
  /**
42
42
  * runtime 2.0 之前的场景信息
43
43
  * 素材信息存放于统一数据结构中
44
- * @deprecated
44
+ * @deprecated 使用 JSONScene 代替
45
45
  */
46
46
  export interface JSONSceneLegacy {
47
47
  /************** 文件版本不是 Player 版本,应用于文件变更后在 editor/player 中加载时的分类处理 **************/
package/es/type.d.ts CHANGED
@@ -448,6 +448,7 @@ export interface RendererOptions {
448
448
  texture?: DataPath;
449
449
  /**
450
450
  * 蒙版形状,索引到 scene 的 shapes 中
451
+ * @deprecated runtime 2.0 后迁移到 SpriteComponentData.geometry
451
452
  */
452
453
  shape?: number | ShapeGeometry;
453
454
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.8.0-alpha.0",
3
+ "version": "2.8.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",
@@ -43,6 +43,10 @@
43
43
  "rimraf": "^3.0.2",
44
44
  "typescript": "^5.3.3"
45
45
  },
46
+ "engines": {
47
+ "node": "18",
48
+ "pnpm": "8"
49
+ },
46
50
  "author": "Ant Group CO., Ltd.",
47
51
  "license": "MIT",
48
52
  "publishConfig": {