@galacean/effects-specification 2.3.1 → 2.5.0-alpha.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.
@@ -0,0 +1,12 @@
1
+ import type { EffectsObjectData } from '../effects-object-data';
2
+ import type { DataPath } from '../components/component-data';
3
+ import type { GraphNodeData } from './graph-node-datas';
4
+ export interface GraphDataSetData {
5
+ resources: DataPath[];
6
+ }
7
+ export interface AnimationGraphAssetData extends EffectsObjectData {
8
+ nodeDatas: GraphNodeData[];
9
+ graphDataSet: GraphDataSetData;
10
+ rootNodeIndex: number;
11
+ controlParameterIDs: string[];
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { ComponentData, DataPath } from '../components/component-data';
2
+ export interface AnimatorData extends ComponentData {
3
+ graphAsset: DataPath;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,112 @@
1
+ export declare enum NodeDataType {
2
+ AnimationClipNodeData = "AnimationClipNodeData",
3
+ BlendNodeData = "BlendNodeData",
4
+ ApplyAdditiveNodeData = "ApplyAdditiveNodeData",
5
+ StateMachineNodeData = "StateMachineNodeData",
6
+ TransitionNodeData = "TransitionNodeData",
7
+ StateNodeData = "StateNodeData",
8
+ ConstFloatNodeData = "ConstFloatNodeData",
9
+ ConstBoolNodeData = "ConstBoolNodeData",
10
+ ControlParameterBoolNodeData = "ControlParameterBoolNodeData",
11
+ ControlParameterFloatNodeData = "ControlParameterFloatNodeData",
12
+ ControlParameterTriggerNodeData = "ControlParameterTriggerNodeData",
13
+ NotNodeData = "NotNodeData",
14
+ AndNodeData = "AndNodeData",
15
+ OrNodeData = "OrNodeData",
16
+ EqualNodeData = "EqualNodeData",
17
+ GreaterNodeData = "GreaterNodeData",
18
+ LessNodeData = "LessNodeData"
19
+ }
20
+ export interface GraphNodeData {
21
+ type: string;
22
+ index: number;
23
+ }
24
+ export interface AnimationClipNodeData extends GraphNodeData {
25
+ type: NodeDataType.AnimationClipNodeData;
26
+ dataSlotIndex: number;
27
+ playRate?: number;
28
+ loopAnimation?: boolean;
29
+ }
30
+ export interface EqualNodeData extends GraphNodeData {
31
+ type: NodeDataType.EqualNodeData;
32
+ inputValueNodeIndex: number;
33
+ comparandValueNodeIndex: number;
34
+ }
35
+ export interface BlendNodeData extends GraphNodeData {
36
+ type: NodeDataType.BlendNodeData;
37
+ sourceNodeIndex0: number;
38
+ sourceNodeIndex1: number;
39
+ inputParameterValueNodeIndex: number;
40
+ }
41
+ export interface ApplyAdditiveNodeData extends GraphNodeData {
42
+ type: NodeDataType.ApplyAdditiveNodeData;
43
+ baseNodeIndex: number;
44
+ additiveNodeIndex: number;
45
+ inputParameterValueNodeIndex: number;
46
+ }
47
+ export interface AndNodeData extends GraphNodeData {
48
+ type: NodeDataType.AndNodeData;
49
+ conditionNodeIndices: number[];
50
+ }
51
+ export interface OrNodeAssetData extends GraphNodeData {
52
+ type: NodeDataType.OrNodeData;
53
+ conditionNodeIndices: number[];
54
+ }
55
+ export interface NotNodeAssetData extends GraphNodeData {
56
+ type: NodeDataType.NotNodeData;
57
+ inputValueNodeIndex: number;
58
+ }
59
+ export interface ConstFloatNodeData extends GraphNodeData {
60
+ type: NodeDataType.ConstFloatNodeData;
61
+ value: number;
62
+ }
63
+ export interface ConstBoolNodeData extends GraphNodeData {
64
+ type: NodeDataType.ConstBoolNodeData;
65
+ value: boolean;
66
+ }
67
+ export interface ControlParameterFloatNodeData extends GraphNodeData {
68
+ type: NodeDataType.ControlParameterFloatNodeData;
69
+ value: number;
70
+ }
71
+ export interface ControlParameterBoolNodeData extends GraphNodeData {
72
+ type: NodeDataType.ControlParameterBoolNodeData;
73
+ value: boolean;
74
+ }
75
+ export interface ControlParameterTriggerNodeData extends GraphNodeData {
76
+ type: NodeDataType.ControlParameterTriggerNodeData;
77
+ }
78
+ export interface FloatComparisonNodeData extends GraphNodeData {
79
+ inputValueNodeIndex: number;
80
+ comparandValueNodeIndex: number;
81
+ }
82
+ export interface LessNodeData extends FloatComparisonNodeData {
83
+ type: NodeDataType.LessNodeData;
84
+ }
85
+ export interface GreaterNodeData extends FloatComparisonNodeData {
86
+ type: NodeDataType.EqualNodeData;
87
+ }
88
+ export interface StateMachineNodeData extends GraphNodeData {
89
+ type: NodeDataType.StateMachineNodeData;
90
+ stateDatas: StateData[];
91
+ defaultStateIndex: number;
92
+ }
93
+ export interface TransitionData {
94
+ targetStateIndex: number;
95
+ conditionNodeIndex: number;
96
+ transitionNodeIndex: number;
97
+ }
98
+ export interface StateData {
99
+ stateNodeIndex: number;
100
+ transitionDatas: TransitionData[];
101
+ }
102
+ export interface StateNodeData extends GraphNodeData {
103
+ type: NodeDataType.StateNodeData;
104
+ childNodeIndex: number;
105
+ }
106
+ export interface TransitionNodeData extends GraphNodeData {
107
+ type: NodeDataType.TransitionNodeData;
108
+ duration: number;
109
+ hasExitTime: boolean;
110
+ exitTime: number;
111
+ targetStateNodeIndex: number;
112
+ }
@@ -0,0 +1,20 @@
1
+ export var NodeDataType;
2
+ (function (NodeDataType) {
3
+ NodeDataType["AnimationClipNodeData"] = "AnimationClipNodeData";
4
+ NodeDataType["BlendNodeData"] = "BlendNodeData";
5
+ NodeDataType["ApplyAdditiveNodeData"] = "ApplyAdditiveNodeData";
6
+ NodeDataType["StateMachineNodeData"] = "StateMachineNodeData";
7
+ NodeDataType["TransitionNodeData"] = "TransitionNodeData";
8
+ NodeDataType["StateNodeData"] = "StateNodeData";
9
+ NodeDataType["ConstFloatNodeData"] = "ConstFloatNodeData";
10
+ NodeDataType["ConstBoolNodeData"] = "ConstBoolNodeData";
11
+ NodeDataType["ControlParameterBoolNodeData"] = "ControlParameterBoolNodeData";
12
+ NodeDataType["ControlParameterFloatNodeData"] = "ControlParameterFloatNodeData";
13
+ NodeDataType["ControlParameterTriggerNodeData"] = "ControlParameterTriggerNodeData";
14
+ NodeDataType["NotNodeData"] = "NotNodeData";
15
+ NodeDataType["AndNodeData"] = "AndNodeData";
16
+ NodeDataType["OrNodeData"] = "OrNodeData";
17
+ NodeDataType["EqualNodeData"] = "EqualNodeData";
18
+ NodeDataType["GreaterNodeData"] = "GreaterNodeData";
19
+ NodeDataType["LessNodeData"] = "LessNodeData";
20
+ })(NodeDataType || (NodeDataType = {}));
@@ -0,0 +1,3 @@
1
+ export * from './animator-data';
2
+ export * from './graph-node-datas';
3
+ export * from './animation-graph-asset-data';
@@ -0,0 +1,3 @@
1
+ export * from './animator-data';
2
+ export * from './graph-node-datas';
3
+ export * from './animation-graph-asset-data';
package/es/data-type.d.ts CHANGED
@@ -46,5 +46,7 @@ export declare enum DataType {
46
46
  PostProcessVolume = "PostProcessVolume",
47
47
  EffectComponent = "EffectComponent",
48
48
  TextComponent = "TextComponent",
49
+ AnimationGraphAsset = "AnimationGraphAsset",
50
+ Animator = "Animator",
49
51
  TimelineClip = "TimelineClip"
50
52
  }
package/es/data-type.js CHANGED
@@ -50,6 +50,8 @@ export var DataType;
50
50
  DataType["PostProcessVolume"] = "PostProcessVolume";
51
51
  DataType["EffectComponent"] = "EffectComponent";
52
52
  DataType["TextComponent"] = "TextComponent";
53
+ DataType["AnimationGraphAsset"] = "AnimationGraphAsset";
54
+ DataType["Animator"] = "Animator";
53
55
  // Non-EffectObject
54
56
  DataType["TimelineClip"] = "TimelineClip";
55
57
  })(DataType || (DataType = {}));
package/es/index.d.ts CHANGED
@@ -30,6 +30,7 @@ export * from './text';
30
30
  export * from './components';
31
31
  export * from './buitin-object-guid';
32
32
  export * from './shape';
33
+ export * from './animation-graph';
33
34
  export * from './timeline';
34
35
  export * from './assets';
35
36
  export * from './render-settings';
@@ -40,4 +41,4 @@ export * from './material-data';
40
41
  export * from './geometry-data';
41
42
  export * from './shader-data';
42
43
  export * from './effects-package-data';
43
- export declare const LATEST_VERSION = JSONSceneVersion['3_3'];
44
+ export declare const LATEST_VERSION = JSONSceneVersion['3_4'];
package/es/index.js CHANGED
@@ -30,6 +30,7 @@ export * from './text';
30
30
  export * from './components';
31
31
  export * from './buitin-object-guid';
32
32
  export * from './shape';
33
+ export * from './animation-graph';
33
34
  export * from './timeline';
34
35
  export * from './assets';
35
36
  export * from './render-settings';
@@ -2,7 +2,7 @@ import type { BinaryEnv } from '../binary';
2
2
  import type { DataPath } from '../components';
3
3
  import type { Vector2Data, Vector3Data } from '../math';
4
4
  import type { vec3, vec4 } from '../number-expression';
5
- import type { ItemType, ObscuredMode, RenderLevel } from '../type';
5
+ import type { ItemType, RenderLevel } from '../type';
6
6
  import type { CameraContent } from './camera-item';
7
7
  import type { CompositionContent } from './composition-item';
8
8
  import type { EffectContent } from './effect-item';
@@ -37,23 +37,25 @@ export declare enum EndBehavior {
37
37
  freeze = 4
38
38
  }
39
39
  /**
40
- * 元素被遮挡/反向遮挡,需要时传入
41
- */
42
- export interface ObscuredOptions {
43
- mode: ObscuredMode;
44
- /**
45
- * 指向作为蒙版的组件
46
- */
47
- ref: DataPath;
48
- }
49
- /**
50
- * 元素的蒙版行为
40
+ * 元素的蒙版选项
51
41
  */
52
42
  export interface MaskOptions {
53
43
  /**
54
44
  * 是否作为蒙版
55
45
  */
56
- mask?: boolean;
46
+ isMask?: boolean;
47
+ /**
48
+ * 是否反转
49
+ */
50
+ inverted?: boolean;
51
+ /**
52
+ * 是否开启图片透明蒙版
53
+ */
54
+ alphaMaskEnabled?: boolean;
55
+ /**
56
+ * 指向作为蒙版的组件
57
+ */
58
+ reference: DataPath;
57
59
  }
58
60
  export interface BaseItem {
59
61
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ComponentData, DataPath } from '../components';
2
2
  import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
3
- import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
3
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
4
4
  /**
5
5
  * 特效元素
6
6
  */
@@ -41,5 +41,5 @@ export interface EffectComponentData extends ComponentData {
41
41
  /**
42
42
  * 特效元素蒙版属性,传入表示需要被遮挡/反向遮挡
43
43
  */
44
- mask?: ObscuredOptions;
44
+ mask?: MaskOptions;
45
45
  }
@@ -1,6 +1,6 @@
1
1
  import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, SplitParameter, ObscuredMode } from '../type';
2
2
  import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
3
- import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
3
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
5
  import type { ComponentData, DataPath } from '../components';
6
6
  /**
@@ -280,7 +280,7 @@ export interface ParticleContent {
280
280
  /**
281
281
  * 粒子元素蒙版属性,传入表示需要被遮挡/反向遮挡
282
282
  */
283
- mask?: ObscuredOptions;
283
+ mask?: MaskOptions;
284
284
  /**
285
285
  * 粒子元素发射器形状属性
286
286
  */
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
1
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
2
2
  import type { ItemType } from '../type';
3
3
  import type { BaseTextContentOptions, TextComponentData, TextContent } from './text-item';
4
4
  import type { vec2 } from '../number-expression';
@@ -45,5 +45,5 @@ export interface RichTextComponentData extends Omit<TextComponentData, 'options'
45
45
  /**
46
46
  * 富文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
47
47
  */
48
- mask?: MaskOptions | ObscuredOptions;
48
+ mask?: MaskOptions;
49
49
  }
@@ -2,7 +2,7 @@ import type { BinaryPointer } from '../binary';
2
2
  import type { ComponentData, DataPath } from '../components';
3
3
  import type { DataType } from '../data-type';
4
4
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType, RenderMode } from '../type';
5
- import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
5
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
6
6
  /**
7
7
  * 插件元素
8
8
  */
@@ -125,5 +125,5 @@ export interface SpineComponent extends ComponentData {
125
125
  /**
126
126
  * Spine 元素蒙版属性,传入表示需要被遮挡/反向遮挡
127
127
  */
128
- mask?: ObscuredOptions;
128
+ mask?: MaskOptions;
129
129
  }
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
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
4
  import type { ComponentData } from '../components';
@@ -43,7 +43,7 @@ export interface SpriteContent {
43
43
  /**
44
44
  * 图层元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
45
45
  */
46
- mask?: MaskOptions | ObscuredOptions;
46
+ mask?: MaskOptions;
47
47
  /**
48
48
  * 图层元素大小变化属性
49
49
  */
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
1
+ import type { BaseItem, EndBehavior, MaskOptions } 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';
@@ -146,7 +146,7 @@ export interface TextContent {
146
146
  /**
147
147
  * 文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
148
148
  */
149
- mask?: MaskOptions | ObscuredOptions;
149
+ mask?: MaskOptions;
150
150
  /**
151
151
  * 文本元素大小变化属性
152
152
  */
@@ -1,7 +1,7 @@
1
1
  import type { ComponentData, DataPath } from '../components';
2
2
  import type { RGBAColorValue } from '../number-expression';
3
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, InteractBehavior, RendererOptions, ItemType } from '../type';
4
- import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
4
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
5
5
  /**
6
6
  * 视频元素
7
7
  */
@@ -62,7 +62,7 @@ export interface VideoComponentData extends ComponentData {
62
62
  /**
63
63
  * 视频元素蒙版属性,传入表示需要被遮挡/反向遮挡
64
64
  */
65
- mask?: ObscuredOptions;
65
+ mask?: MaskOptions;
66
66
  /**
67
67
  * 视频元素大小变化属性
68
68
  */
package/es/scene.d.ts CHANGED
@@ -31,8 +31,9 @@ export declare enum JSONSceneVersion {
31
31
  '3_0' = "3.0",// EC 改造、移除滤镜元素
32
32
  '3_1' = "3.1",// 音视频
33
33
  '3_2' = "3.2",// 矢量动画、透明视频、增加富文本属性
34
- '3_3' = "3.3",// 指向型蒙版、图片蒙版
35
- 'LATEST' = "3.3"
34
+ '3_3' = "3.3",// 指向型蒙版、图片/文字蒙版
35
+ '3_4' = "3.4",// 动画状态机
36
+ 'LATEST' = "3.4"
36
37
  }
37
38
  /**
38
39
  * runtime 2.0 之前的场景信息
package/es/scene.js CHANGED
@@ -18,5 +18,6 @@ export var JSONSceneVersion;
18
18
  JSONSceneVersion["3_1"] = "3.1";
19
19
  JSONSceneVersion["3_2"] = "3.2";
20
20
  JSONSceneVersion["3_3"] = "3.3";
21
- JSONSceneVersion["LATEST"] = "3.3";
21
+ JSONSceneVersion["3_4"] = "3.4";
22
+ JSONSceneVersion["LATEST"] = "3.4";
22
23
  })(JSONSceneVersion || (JSONSceneVersion = {}));
@@ -1,5 +1,5 @@
1
1
  import type { ComponentData } from '../components/component-data';
2
- import type { MaskOptions, ObscuredOptions } from '../item/base-item';
2
+ import type { MaskOptions } from '../item/base-item';
3
3
  import type { ShapeFillParam } from './shape-fill-param';
4
4
  import type { ShapePrimitiveType } from './shape-primitive-type';
5
5
  import type { ShapeStrokeParam } from './shape-stroke-param';
@@ -22,5 +22,5 @@ export interface ShapeComponentData extends ComponentData {
22
22
  /**
23
23
  * 蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
24
24
  */
25
- mask?: MaskOptions | ObscuredOptions;
25
+ mask?: MaskOptions;
26
26
  }
package/es/type.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { DataPath } from './components';
2
- import type { ObscuredOptions, MaskOptions } from './item/base-item';
2
+ import type { MaskOptions } from './item/base-item';
3
3
  import type { FixedVec3Expression, vec2, vec3, GradientColor, ShapePoints, ShapeSplits, FixedNumberExpression } from './number-expression';
4
4
  /**
5
5
  * 播放器版本
@@ -457,7 +457,7 @@ export interface RendererOptions {
457
457
  /**
458
458
  * 蒙版属性
459
459
  */
460
- mask?: MaskOptions | ObscuredOptions;
460
+ mask?: MaskOptions;
461
461
  }
462
462
  /**
463
463
  * 元素类型
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.3.1",
3
+ "version": "2.5.0-alpha.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",