@galacean/effects-specification 2.1.0-alpha.3 → 2.1.0-alpha.5

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,4 +1,5 @@
1
- export interface PostProcessVolumeData {
1
+ import type { ComponentData } from './component-data';
2
+ export interface PostProcessVolumeData extends ComponentData {
2
3
  /**
3
4
  * 泛光
4
5
  */
@@ -1,7 +1,7 @@
1
1
  import type { BezierValue } from '../number-expression';
2
- export interface ColorCurveData {
3
- r: BezierValue;
4
- g: BezierValue;
5
- b: BezierValue;
6
- a: BezierValue;
7
- }
2
+ export type ColorCurveData = [
3
+ r: BezierValue,
4
+ g: BezierValue,
5
+ b: BezierValue,
6
+ a: BezierValue
7
+ ];
@@ -1,7 +1,7 @@
1
1
  import type { BezierValue } from '../number-expression';
2
- export interface Vector4CurveData {
3
- x: BezierValue;
4
- y: BezierValue;
5
- z: BezierValue;
6
- w: BezierValue;
7
- }
2
+ export type Vector4CurveData = [
3
+ x: BezierValue,
4
+ y: BezierValue,
5
+ z: BezierValue,
6
+ w: BezierValue
7
+ ];
package/es/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export * from './text';
29
29
  export * from './components';
30
30
  export * from './vfx-item-data';
31
31
  export * from './buitin-object-guid';
32
+ export * from './shape';
32
33
  export * from './timeline';
33
34
  export * from './assets';
34
35
  export * from './render-settings';
package/es/index.js CHANGED
@@ -29,6 +29,7 @@ export * from './text';
29
29
  export * from './components';
30
30
  export * from './vfx-item-data';
31
31
  export * from './buitin-object-guid';
32
+ export * from './shape';
32
33
  export * from './timeline';
33
34
  export * from './assets';
34
35
  export * from './render-settings';
@@ -1,3 +1,4 @@
1
+ import type { ColorCurveData, Vector4CurveData } from './curve-data';
1
2
  /*********************************************/
2
3
  /*********************************************/
3
4
  export declare enum ValueType {
@@ -271,6 +272,14 @@ export type BezierCurvePath = [type: ValueType.BEZIER_CURVE_PATH, value: BezierC
271
272
  * 贝塞尔曲线路径关键帧
272
273
  */
273
274
  export type BezierCurveQuat = [type: ValueType.BEZIER_CURVE_QUAT, value: BezierCurveQuatValue];
275
+ /**
276
+ * 颜色贝塞尔曲线
277
+ */
278
+ export type ColorCurveValue = [type: ValueType.COLOR_CURVE, value: ColorCurveData];
279
+ /**
280
+ * Vector4 贝塞尔曲线
281
+ */
282
+ export type Vector4CurveValue = [type: ValueType.VECTOR4_CURVE, value: Vector4CurveData];
274
283
  /*********************************************/
275
284
  /*********************************************/
276
285
  export type ColorExpression = RGBAColor | GradientColor | RGBAColors;
@@ -0,0 +1,73 @@
1
+ import type { TransformData } from '../item/base-item';
2
+ import type { Vector2Data } from '../math';
3
+ import type { ShapeComponentData } from './shape-component-data';
4
+ import type { ShapeFillParam } from './shape-fill-param';
5
+ import type { ShapePrimitiveType } from './shape-primitive-type';
6
+ import type { ShapeStrokeParam } from './shape-stroke-param';
7
+ /**
8
+ * 自定义形状点
9
+ */
10
+ export interface CustomShapePoint {
11
+ /**
12
+ * 顶点索引
13
+ */
14
+ point: number;
15
+ /**
16
+ * 入射点索引
17
+ */
18
+ easingIn: number;
19
+ /**
20
+ * 出射点索引
21
+ */
22
+ easingOut: number;
23
+ }
24
+ /**
25
+ * 自定义形状参数
26
+ */
27
+ export interface CustomShape {
28
+ /**
29
+ * 点索引 - 用于构成闭合图形
30
+ */
31
+ indexes: CustomShapePoint[];
32
+ /**
33
+ * 是否为闭合图形 - 用于Stroke
34
+ */
35
+ close: boolean;
36
+ /**
37
+ * 填充属性
38
+ */
39
+ fill?: ShapeFillParam;
40
+ /**
41
+ * 描边属性
42
+ */
43
+ stroke?: ShapeStrokeParam;
44
+ /**
45
+ * 空间变换
46
+ */
47
+ transform?: TransformData;
48
+ }
49
+ /**
50
+ * 自定义图形组件
51
+ */
52
+ export interface CustomShapeData extends ShapeComponentData {
53
+ /**
54
+ * 矢量类型 - 形状
55
+ */
56
+ type: ShapePrimitiveType.Custom;
57
+ /**
58
+ * 路径点
59
+ */
60
+ points: Vector2Data[];
61
+ /**
62
+ * 入射控制点
63
+ */
64
+ easingIns: Vector2Data[];
65
+ /**
66
+ * 入射控制点
67
+ */
68
+ easingOuts: Vector2Data[];
69
+ /**
70
+ * 自定义形状
71
+ */
72
+ shapes: CustomShape[];
73
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { TransformData } from '../item/base-item';
2
+ import type { ShapeComponentData } from './shape-component-data';
3
+ import type { ShapeFillParam } from './shape-fill-param';
4
+ import type { ShapePrimitiveType } from './shape-primitive-type';
5
+ import type { ShapeStrokeParam } from './shape-stroke-param';
6
+ /**
7
+ * 椭圆组件参数
8
+ */
9
+ export interface EllipseData extends ShapeComponentData {
10
+ type: ShapePrimitiveType.Ellipse;
11
+ /**
12
+ * x 轴半径
13
+ * -- TODO 后续完善类型
14
+ * -- TODO 可以看一下用xRadius/yRadius 还是 width/height
15
+ */
16
+ xRadius: number;
17
+ /**
18
+ * y 轴半径
19
+ */
20
+ yRadius: number;
21
+ /**
22
+ * 填充属性
23
+ */
24
+ fill?: ShapeFillParam;
25
+ /**
26
+ * 描边属性
27
+ */
28
+ stroke?: ShapeStrokeParam;
29
+ /**
30
+ * 空间变换
31
+ */
32
+ transform?: TransformData;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export * from './custom-shape-data';
2
+ export * from './ellipse-data';
3
+ export * from './polygon-data';
4
+ export * from './rectangle-data';
5
+ export * from './shape-component-data';
6
+ export * from './shape-fill-param';
7
+ export * from './shape-primitive-type';
8
+ export * from './shape-stroke-param';
9
+ export * from './star-data';
@@ -0,0 +1,9 @@
1
+ export * from './custom-shape-data';
2
+ export * from './ellipse-data';
3
+ export * from './polygon-data';
4
+ export * from './rectangle-data';
5
+ export * from './shape-component-data';
6
+ export * from './shape-fill-param';
7
+ export * from './shape-primitive-type';
8
+ export * from './shape-stroke-param';
9
+ export * from './star-data';
@@ -0,0 +1,33 @@
1
+ import type { TransformData } from '../item/base-item';
2
+ import type { ShapeComponentData } from './shape-component-data';
3
+ import type { ShapeFillParam } from './shape-fill-param';
4
+ import type { ShapeStrokeParam } from './shape-stroke-param';
5
+ /**
6
+ * 多边形参数
7
+ */
8
+ export interface PolygonData extends ShapeComponentData {
9
+ /**
10
+ * 顶点数
11
+ */
12
+ pointCount: number;
13
+ /**
14
+ * 外切圆半径
15
+ */
16
+ radius: number;
17
+ /**
18
+ * 角点圆度
19
+ */
20
+ roundness: number;
21
+ /**
22
+ * 填充属性
23
+ */
24
+ fill?: ShapeFillParam;
25
+ /**
26
+ * 描边属性
27
+ */
28
+ stroke?: ShapeStrokeParam;
29
+ /**
30
+ * 空间变换
31
+ */
32
+ transform?: TransformData;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { TransformData } from '../item/base-item';
2
+ import type { ShapeComponentData } from './shape-component-data';
3
+ import type { ShapeFillParam } from './shape-fill-param';
4
+ import type { ShapeStrokeParam } from './shape-stroke-param';
5
+ /**
6
+ * 矩形参数
7
+ */
8
+ export interface RectangleData extends ShapeComponentData {
9
+ /**
10
+ * 宽度
11
+ */
12
+ width: number;
13
+ /**
14
+ * 高度
15
+ */
16
+ height: number;
17
+ /**
18
+ * 角点元素
19
+ */
20
+ roundness: number;
21
+ /**
22
+ * 填充属性
23
+ */
24
+ fill?: ShapeFillParam;
25
+ /**
26
+ * 描边属性
27
+ */
28
+ stroke?: ShapeStrokeParam;
29
+ /**
30
+ * 空间变换
31
+ */
32
+ transform?: TransformData;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { ComponentData } from '../components/component-data';
2
+ import type { ShapePrimitiveType } from './shape-primitive-type';
3
+ /**
4
+ * 矢量图形组件
5
+ */
6
+ export interface ShapeComponentData extends ComponentData {
7
+ /**
8
+ * 矢量类型
9
+ */
10
+ type: ShapePrimitiveType;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ColorData } from '../math/color-data';
2
+ /**
3
+ * 矢量填充参数
4
+ */
5
+ export interface ShapeFillParam {
6
+ /**
7
+ * 填充颜色
8
+ */
9
+ color: ColorData;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 矢量图形类型
3
+ */
4
+ export declare enum ShapePrimitiveType {
5
+ /**
6
+ * 自定义图形
7
+ */
8
+ Custom = 0,
9
+ /**
10
+ * 矩形
11
+ */
12
+ Rectangle = 1,
13
+ /**
14
+ * 椭圆
15
+ */
16
+ Ellipse = 2,
17
+ /**
18
+ * 多边形
19
+ */
20
+ Polygon = 3,
21
+ /**
22
+ * 星形
23
+ */
24
+ Star = 4
25
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 矢量图形类型
3
+ */
4
+ export var ShapePrimitiveType;
5
+ (function (ShapePrimitiveType) {
6
+ /**
7
+ * 自定义图形
8
+ */
9
+ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
10
+ /**
11
+ * 矩形
12
+ */
13
+ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
14
+ /**
15
+ * 椭圆
16
+ */
17
+ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
18
+ /**
19
+ * 多边形
20
+ */
21
+ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
22
+ /**
23
+ * 星形
24
+ */
25
+ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
26
+ })(ShapePrimitiveType || (ShapePrimitiveType = {}));
@@ -0,0 +1,26 @@
1
+ import type { ColorData } from '../math/color-data';
2
+ export declare enum ShapeConnectType {
3
+ }
4
+ export declare enum ShapePointType {
5
+ }
6
+ /**
7
+ * 矢量描边参数
8
+ */
9
+ export interface ShapeStrokeParam {
10
+ /**
11
+ * 线宽
12
+ */
13
+ width: number;
14
+ /**
15
+ * 线颜色
16
+ */
17
+ color: ColorData;
18
+ /**
19
+ * 连接类型
20
+ */
21
+ connectType: ShapeConnectType;
22
+ /**
23
+ * 点类型
24
+ */
25
+ pointType: ShapePointType;
26
+ }
@@ -0,0 +1,8 @@
1
+ // 本期无该功能 待补充
2
+ export var ShapeConnectType;
3
+ (function (ShapeConnectType) {
4
+ })(ShapeConnectType || (ShapeConnectType = {}));
5
+ // @待补充
6
+ export var ShapePointType;
7
+ (function (ShapePointType) {
8
+ })(ShapePointType || (ShapePointType = {}));
@@ -0,0 +1,41 @@
1
+ import type { TransformData } from '../item/base-item';
2
+ import type { ShapeComponentData } from './shape-component-data';
3
+ import type { ShapeFillParam } from './shape-fill-param';
4
+ import type { ShapeStrokeParam } from './shape-stroke-param';
5
+ /**
6
+ * 星形参数
7
+ */
8
+ export interface StarData extends ShapeComponentData {
9
+ /**
10
+ * 顶点数 - 内外顶点同数
11
+ */
12
+ pointCount: number;
13
+ /**
14
+ * 内径
15
+ */
16
+ innerRadius: number;
17
+ /**
18
+ * 外径
19
+ */
20
+ outerRadius: number;
21
+ /**
22
+ * 内径点圆度
23
+ */
24
+ innerRoundness: number;
25
+ /**
26
+ * 外径点圆度
27
+ */
28
+ outerRoundness: number;
29
+ /**
30
+ * 填充属性
31
+ */
32
+ fill?: ShapeFillParam;
33
+ /**
34
+ * 描边属性
35
+ */
36
+ stroke?: ShapeStrokeParam;
37
+ /**
38
+ * 空间变换
39
+ */
40
+ transform?: TransformData;
41
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.1.0-alpha.3",
3
+ "version": "2.1.0-alpha.5",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",