@galacean/effects-core 2.5.4 → 2.6.0-alpha.1

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 (44) hide show
  1. package/dist/asset-loader.d.ts +0 -1
  2. package/dist/comp-vfx-item.d.ts +0 -1
  3. package/dist/components/animator.d.ts +15 -0
  4. package/dist/components/effect-component.d.ts +1 -0
  5. package/dist/components/index.d.ts +1 -0
  6. package/dist/composition.d.ts +14 -7
  7. package/dist/decorators.d.ts +1 -0
  8. package/dist/events/types.d.ts +2 -1
  9. package/dist/index.js +4142 -1643
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +4108 -1643
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/math/value-getters/color-curve.d.ts +1 -0
  14. package/dist/math/value-getters/vector-curves.d.ts +13 -1
  15. package/dist/plugins/animation-graph/animation-graph-asset.d.ts +13 -0
  16. package/dist/plugins/animation-graph/blender.d.ts +38 -0
  17. package/dist/plugins/animation-graph/graph-context.d.ts +20 -0
  18. package/dist/plugins/animation-graph/graph-data-set.d.ts +5 -0
  19. package/dist/plugins/animation-graph/graph-instance.d.ts +30 -0
  20. package/dist/plugins/animation-graph/graph-node.d.ts +70 -0
  21. package/dist/plugins/animation-graph/index.d.ts +6 -0
  22. package/dist/plugins/animation-graph/node-asset-type.d.ts +3 -0
  23. package/dist/plugins/animation-graph/nodes/animation-clip-node.d.ts +52 -0
  24. package/dist/plugins/animation-graph/nodes/apply-additive-node.d.ts +23 -0
  25. package/dist/plugins/animation-graph/nodes/blend-node.d.ts +23 -0
  26. package/dist/plugins/animation-graph/nodes/bool-nodes.d.ts +39 -0
  27. package/dist/plugins/animation-graph/nodes/const-value-nodes.d.ts +21 -0
  28. package/dist/plugins/animation-graph/nodes/control-parameter-nodes.d.ts +32 -0
  29. package/dist/plugins/animation-graph/nodes/index.d.ts +11 -0
  30. package/dist/plugins/animation-graph/nodes/layer-blend-node.d.ts +27 -0
  31. package/dist/plugins/animation-graph/nodes/operator-nodes.d.ts +35 -0
  32. package/dist/plugins/animation-graph/nodes/state-machine-node.d.ts +35 -0
  33. package/dist/plugins/animation-graph/nodes/state-node.d.ts +30 -0
  34. package/dist/plugins/animation-graph/nodes/transition-node.d.ts +48 -0
  35. package/dist/plugins/animation-graph/pose-result.d.ts +6 -0
  36. package/dist/plugins/animation-graph/pose.d.ts +26 -0
  37. package/dist/plugins/animation-graph/skeleton.d.ts +38 -0
  38. package/dist/plugins/cal/calculate-vfx-item.d.ts +25 -22
  39. package/dist/plugins/index.d.ts +1 -0
  40. package/dist/plugins/particle/particle-system.d.ts +3 -4
  41. package/dist/plugins/sprite/sprite-item.d.ts +15 -2
  42. package/dist/plugins/text/text-item.d.ts +0 -11
  43. package/dist/vfx-item.d.ts +4 -5
  44. package/package.json +2 -2
@@ -0,0 +1,38 @@
1
+ import type { Color } from '@galacean/effects-math/es/core/color';
2
+ import type { VFXItem } from '../../vfx-item';
3
+ import type { Transform } from '../../transform';
4
+ import { NodeTransform } from './pose';
5
+ import type { ColorAnimationCurve, FloatAnimationCurve } from '../cal/calculate-vfx-item';
6
+ export interface AnimationRecordData {
7
+ position: string[];
8
+ scale: string[];
9
+ rotation: string[];
10
+ euler: string[];
11
+ floats: FloatAnimationCurve[];
12
+ colors: ColorAnimationCurve[];
13
+ }
14
+ export declare enum AnimatedPropertyType {
15
+ Float = 0,
16
+ Color = 1
17
+ }
18
+ export interface AnimatedObject {
19
+ property: string;
20
+ target: Record<string, any>;
21
+ }
22
+ export declare const VFXItemType = "VFXItem";
23
+ export declare class Skeleton {
24
+ rootBone: VFXItem;
25
+ useEuler: boolean;
26
+ pathToObjectIndex: Map<string, number>;
27
+ floatAnimatedObjects: AnimatedObject[];
28
+ defaultFloatPropertyValues: number[];
29
+ colorAnimatedObjects: AnimatedObject[];
30
+ defaultColorPropertyValues: Color[];
31
+ animatedTransforms: Transform[];
32
+ parentSpaceTransforms: NodeTransform[];
33
+ pathToBoneIndex: Map<string, number>;
34
+ constructor(rootBone: VFXItem, recordedProperties: AnimationRecordData);
35
+ private addReferenceTransform;
36
+ private addRecordedProperty;
37
+ private findTarget;
38
+ }
@@ -1,7 +1,8 @@
1
+ import { Euler } from '@galacean/effects-math/es/core/euler';
1
2
  import { Vector3 } from '@galacean/effects-math/es/core/vector3';
2
3
  import type { Quaternion } from '@galacean/effects-math/es/core/quaternion';
3
4
  import * as spec from '@galacean/effects-specification';
4
- import type { ValueGetter } from '../../math';
5
+ import type { BezierCurve, ColorCurve, ValueGetter, Vector3Curve } from '../../math';
5
6
  import { AnimationPlayable } from './animation-playable';
6
7
  import type { ItemBasicTransform, ItemLinearVelOverLifetime } from './calculate-item';
7
8
  import type { FrameContext, PlayableGraph } from './playable-graph';
@@ -78,39 +79,41 @@ export declare class ActivationPlayable extends Playable {
78
79
  export declare class ActivationPlayableAsset extends PlayableAsset {
79
80
  createPlayable(graph: PlayableGraph): Playable;
80
81
  }
81
- export interface PositionCurve {
82
+ export interface AnimationCurve {
82
83
  path: string;
83
- keyFrames: ValueGetter<Vector3>;
84
+ keyFrames: ValueGetter<any>;
84
85
  }
85
- export interface EulerCurve {
86
- path: string;
87
- keyFrames: ValueGetter<Vector3>;
86
+ export interface PositionAnimationCurve extends AnimationCurve {
87
+ keyFrames: Vector3Curve;
88
88
  }
89
- export interface RotationCurve {
90
- path: string;
89
+ export interface EulerAnimationCurve extends AnimationCurve {
90
+ keyFrames: ValueGetter<Euler>;
91
+ }
92
+ export interface RotationAnimationCurve extends AnimationCurve {
91
93
  keyFrames: ValueGetter<Quaternion>;
92
94
  }
93
- export interface ScaleCurve {
94
- path: string;
95
- keyFrames: ValueGetter<Vector3>;
95
+ export interface ScaleAnimationCurve extends AnimationCurve {
96
+ keyFrames: Vector3Curve;
96
97
  }
97
- export interface FloatCurve {
98
- path: string;
98
+ export interface FloatAnimationCurve extends AnimationCurve {
99
99
  property: string;
100
100
  className: string;
101
- keyFrames: ValueGetter<number>;
101
+ keyFrames: BezierCurve;
102
+ }
103
+ export interface ColorAnimationCurve extends AnimationCurve {
104
+ property: string;
105
+ className: string;
106
+ keyFrames: ColorCurve;
102
107
  }
103
108
  export declare class AnimationClip extends EffectsObject {
104
109
  duration: number;
105
- positionCurves: PositionCurve[];
106
- rotationCurves: RotationCurve[];
107
- scaleCurves: ScaleCurve[];
108
- floatCurves: FloatCurve[];
110
+ positionCurves: PositionAnimationCurve[];
111
+ rotationCurves: RotationAnimationCurve[];
112
+ eulerCurves: EulerAnimationCurve[];
113
+ scaleCurves: ScaleAnimationCurve[];
114
+ floatCurves: FloatAnimationCurve[];
115
+ colorCurves: ColorAnimationCurve[];
109
116
  sampleAnimation(vfxItem: VFXItem, time: number): void;
110
117
  fromData(data: spec.AnimationClipData): void;
111
118
  private findTarget;
112
119
  }
113
- export declare class AnimationClipPlayable extends Playable {
114
- clip: AnimationClip;
115
- processFrame(context: FrameContext): void;
116
- }
@@ -27,3 +27,4 @@ export * from './shape/polygon';
27
27
  export * from './shape/shape-path';
28
28
  export * from './timeline';
29
29
  export * from './text';
30
+ export * from './animation-graph';
@@ -10,7 +10,6 @@ import type { Maskable } from '../../material';
10
10
  import { MaskMode, MaskProcessor } from '../../material';
11
11
  import type { ShapeGenerator, ShapeParticle } from '../../shape';
12
12
  import { Texture } from '../../texture';
13
- import { Transform } from '../../transform';
14
13
  import type { BoundingBoxSphere, HitTestCustomParams } from '../interact/click-handler';
15
14
  import { Burst } from './burst';
16
15
  import type { Point } from './particle-mesh';
@@ -145,9 +144,9 @@ export declare class ParticleSystem extends Component implements Maskable {
145
144
  emissionStopped: boolean;
146
145
  destroyed: boolean;
147
146
  props: ParticleSystemProps;
147
+ time: number;
148
148
  readonly maskManager: MaskProcessor;
149
149
  private generatedCount;
150
- private lastUpdate;
151
150
  private loopStartTime;
152
151
  private particleLink;
153
152
  private started;
@@ -178,12 +177,12 @@ export declare class ParticleSystem extends Component implements Maskable {
178
177
  private updateEmitterTransform;
179
178
  private addParticle;
180
179
  setVisible(visible: boolean): void;
181
- setOpacity(opacity: number): void;
182
- setParentTransform(transform: Transform): void;
183
180
  getTextures(): Texture[];
184
181
  startEmit(): void;
185
182
  stop(): void;
186
183
  reset(): void;
184
+ onStart(): void;
185
+ onUpdate(dt: number): void;
187
186
  update(delta: number): void;
188
187
  drawStencilMask(renderer: Renderer): void;
189
188
  onDestroy(): void;
@@ -2,8 +2,10 @@ import * as spec from '@galacean/effects-specification';
2
2
  import type { ColorPlayableAssetData } from '../../animation';
3
3
  import { BaseRenderComponent } from '../../components';
4
4
  import type { Engine } from '../../engine';
5
- import type { Playable, PlayableGraph } from '../cal/playable-graph';
6
- import { PlayableAsset } from '../cal/playable-graph';
5
+ import type { FrameContext, PlayableGraph } from '../cal/playable-graph';
6
+ import { Playable, PlayableAsset } from '../cal/playable-graph';
7
+ import { TrackAsset } from '../timeline/track';
8
+ import { TrackMixerPlayable } from '../timeline/playables/track-mixer-playable';
7
9
  /**
8
10
  * 图层元素基础属性, 经过处理后的 spec.SpriteContent.options
9
11
  */
@@ -17,7 +19,18 @@ export declare class SpriteColorPlayableAsset extends PlayableAsset {
17
19
  createPlayable(graph: PlayableGraph): Playable;
18
20
  fromData(data: ColorPlayableAssetData): void;
19
21
  }
22
+ export declare class ComponentTimeTrack extends TrackAsset {
23
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
24
+ }
25
+ export declare class ComponentTimePlayableAsset extends PlayableAsset {
26
+ createPlayable(graph: PlayableGraph): Playable;
27
+ }
28
+ export declare class ComponentTimePlayable extends Playable {
29
+ processFrame(context: FrameContext): void;
30
+ }
20
31
  export declare class SpriteComponent extends BaseRenderComponent {
32
+ time: number;
33
+ duration: number;
21
34
  frameAnimationLoop: boolean;
22
35
  constructor(engine: Engine, props?: spec.SpriteComponentData);
23
36
  onUpdate(dt: number): void;
@@ -3,20 +3,9 @@ import type { ItemRenderer } from '../../components';
3
3
  import { BaseRenderComponent } from '../../components';
4
4
  import type { Engine } from '../../engine';
5
5
  import type { Material } from '../../material';
6
- import { Texture } from '../../texture';
7
6
  import type { VFXItem } from '../../vfx-item';
8
7
  import { TextLayout } from './text-layout';
9
8
  import { TextStyle } from './text-style';
10
- /**
11
- * 用于创建 textItem 的数据类型, 经过处理后的 spec.TextContentOptions
12
- */
13
- export interface TextItemProps extends Omit<spec.TextContent, 'renderer' | 'mask'> {
14
- listIndex?: number;
15
- mask?: spec.MaskOptions;
16
- renderer: {
17
- texture: Texture;
18
- } & Omit<spec.RendererOptions, 'texture'>;
19
- }
20
9
  export declare const DEFAULT_FONTS: string[];
21
10
  export interface TextComponent extends TextComponentBase {
22
11
  }
@@ -212,11 +212,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
212
212
  */
213
213
  getComponents<T extends Component>(classConstructor: Constructor<T>): T[];
214
214
  setParent(vfxItem: VFXItem): void;
215
- /**
216
- * 设置元素的透明度
217
- * @param opacity - 透明度值,范围 [0,1]
218
- */
219
- setOpacity(opacity: number): void;
220
215
  /**
221
216
  * 激活或停用 VFXItem
222
217
  */
@@ -225,6 +220,10 @@ export declare class VFXItem extends EffectsObject implements Disposable {
225
220
  * 当前 VFXItem 是否激活
226
221
  */
227
222
  get isActive(): boolean;
223
+ /**
224
+ * @since 2.6.0
225
+ */
226
+ set isActive(value: boolean);
228
227
  /**
229
228
  * 设置元素的显隐,该设置会批量开关元素组件
230
229
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.5.4",
3
+ "version": "2.6.0-alpha.1",
4
4
  "description": "Galacean Effects runtime core for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "registry": "https://registry.npmjs.org"
43
43
  },
44
44
  "dependencies": {
45
- "@galacean/effects-specification": "2.4.0",
45
+ "@galacean/effects-specification": "2.5.0-alpha.3",
46
46
  "@galacean/effects-math": "1.1.0",
47
47
  "flatbuffers": "24.3.25",
48
48
  "uuid": "9.0.1",