@galacean/effects-core 2.1.5 → 2.2.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.
Files changed (34) hide show
  1. package/dist/asset-manager.d.ts +5 -0
  2. package/dist/config.d.ts +1 -0
  3. package/dist/downloader.d.ts +16 -4
  4. package/dist/index.js +559 -517
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +556 -518
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/math/value-getters/value-getter.d.ts +4 -0
  9. package/dist/plugins/cal/animation-stream.d.ts +1 -2
  10. package/dist/plugins/cal/playable-graph.d.ts +1 -30
  11. package/dist/plugins/text/text-layout.d.ts +1 -1
  12. package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +3 -3
  13. package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +3 -3
  14. package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +3 -3
  15. package/dist/plugins/timeline/playables/index.d.ts +6 -2
  16. package/dist/plugins/timeline/playables/particle-mixer-playable.d.ts +5 -0
  17. package/dist/plugins/timeline/playables/sprite-color-mixer-playable.d.ts +5 -0
  18. package/dist/plugins/timeline/playables/sub-composition-mixer-playable.d.ts +3 -3
  19. package/dist/plugins/timeline/playables/track-mixer-playable.d.ts +12 -0
  20. package/dist/plugins/timeline/playables/transform-mixer-playable.d.ts +5 -0
  21. package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +3 -3
  22. package/dist/plugins/timeline/track.d.ts +7 -6
  23. package/dist/plugins/timeline/tracks/activation-track.d.ts +3 -2
  24. package/dist/plugins/timeline/tracks/color-property-track.d.ts +3 -2
  25. package/dist/plugins/timeline/tracks/float-property-track.d.ts +3 -2
  26. package/dist/plugins/timeline/tracks/index.d.ts +1 -0
  27. package/dist/plugins/timeline/tracks/particle-track.d.ts +6 -0
  28. package/dist/plugins/timeline/tracks/property-track.d.ts +1 -1
  29. package/dist/plugins/timeline/tracks/sprite-color-track.d.ts +3 -0
  30. package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +3 -2
  31. package/dist/plugins/timeline/tracks/transform-track.d.ts +3 -0
  32. package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +3 -2
  33. package/dist/scene.d.ts +13 -1
  34. package/package.json +1 -1
@@ -126,7 +126,11 @@ export declare class BezierCurvePath extends ValueGetter<Vector3> {
126
126
  timeInterval: number;
127
127
  valueInterval: number;
128
128
  pathCurve: BezierPath;
129
+ timeStart: number;
130
+ timeEnd: number;
129
131
  }>;
132
+ keys: number[][];
133
+ keyTimeData: string[];
130
134
  onCreate(props: spec.BezierCurvePathValue): void;
131
135
  getValue(time: number): Vector3;
132
136
  getPercValue(curveKey: string, time: number): number;
@@ -1,11 +1,10 @@
1
- import { AnimationPlayable } from './animation-playable';
1
+ import type { AnimationPlayable } from './animation-playable';
2
2
  export declare class AnimationStream {
3
3
  private playable;
4
4
  private curveValues;
5
5
  constructor(playable: AnimationPlayable);
6
6
  setCurveValue(componentType: string, propertyName: string, value: number): AnimationCurveValue;
7
7
  findCurveValue(componentType: string, propertyName: string): AnimationCurveValue;
8
- getInputStream(index: number): AnimationStream | undefined;
9
8
  }
10
9
  export interface AnimationCurveValue {
11
10
  componentType: string;
@@ -8,7 +8,6 @@ export declare class PlayableGraph {
8
8
  private playableOutputs;
9
9
  private playables;
10
10
  evaluate(dt: number): void;
11
- connect(source: Playable, sourceOutputPort: number, destination: Playable, destinationInputPort: number): void;
12
11
  addOutput(output: PlayableOutput): void;
13
12
  addPlayable(playable: Playable): void;
14
13
  private processFrameWithRoot;
@@ -24,12 +23,7 @@ export declare class Playable implements Disposable {
24
23
  onPlayablePauseFlag: boolean;
25
24
  private duration;
26
25
  private destroyed;
27
- private inputs;
28
- private inputOuputPorts;
29
- private inputWeight;
30
- private outputs;
31
26
  private playState;
32
- private traversalMode;
33
27
  /**
34
28
  * 当前本地播放的时间
35
29
  */
@@ -37,32 +31,15 @@ export declare class Playable implements Disposable {
37
31
  constructor(graph: PlayableGraph, inputCount?: number);
38
32
  play(): void;
39
33
  pause(): void;
40
- connectInput(inputPort: number, sourcePlayable: Playable, sourceOutputPort: number, weight?: number): void;
41
- addInput(sourcePlayable: Playable, sourceOutputPort: number, weight?: number): void;
42
- getInputCount(): number;
43
- getInputs(): Playable[];
44
- getInput(index: number): Playable;
45
- getOutputCount(): number;
46
- getOutputs(): Playable[];
47
- getOutput(index: number): Playable;
48
- getInputWeight(inputIndex: number): number;
49
- setInputWeight(playable: Playable, weight: number): void;
50
- setInputWeight(inputIndex: number, weight: number): void;
51
34
  setTime(time: number): void;
52
35
  getTime(): number;
53
36
  setDuration(duration: number): void;
54
37
  getDuration(): number;
55
38
  getPlayState(): PlayState;
56
- setTraversalMode(mode: PlayableTraversalMode): void;
57
- getTraversalMode(): PlayableTraversalMode;
58
- onPlayablePlay(context: FrameContext): void;
59
- onPlayablePause(context: FrameContext): void;
60
39
  prepareFrame(context: FrameContext): void;
61
40
  processFrame(context: FrameContext): void;
62
41
  onPlayableDestroy(): void;
63
42
  dispose(): void;
64
- private setOutput;
65
- private setInput;
66
43
  }
67
44
  /**
68
45
  * 动画图输出节点对象,将动画数据采样到绑定的元素属性上
@@ -82,10 +59,8 @@ export declare class PlayableOutput {
82
59
  * 当前本地播放的时间
83
60
  */
84
61
  protected time: number;
85
- private sourceOutputPort;
86
62
  constructor();
87
- setSourcePlayable(playable: Playable, port?: number): void;
88
- getSourceOutputPort(): number;
63
+ setSourcePlayable(playable: Playable): void;
89
64
  setUserData(value: object): void;
90
65
  getUserData(): object;
91
66
  prepareFrame(): void;
@@ -102,7 +77,3 @@ export declare enum PlayState {
102
77
  Playing = 0,
103
78
  Paused = 1
104
79
  }
105
- export declare enum PlayableTraversalMode {
106
- Mix = 0,
107
- Passthrough = 1
108
- }
@@ -4,7 +4,7 @@ export declare class TextLayout {
4
4
  textBaseline: spec.TextBaseline;
5
5
  textAlign: spec.TextAlignment;
6
6
  letterSpace: number;
7
- overFlow: spec.TextOverflow;
7
+ overflow: spec.TextOverflow;
8
8
  width: number;
9
9
  height: number;
10
10
  /**
@@ -1,5 +1,5 @@
1
1
  import type { FrameContext } from '../../cal/playable-graph';
2
- import { Playable } from '../../cal/playable-graph';
3
- export declare class ActivationMixerPlayable extends Playable {
4
- processFrame(context: FrameContext): void;
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class ActivationMixerPlayable extends TrackMixerPlayable {
4
+ evaluate(context: FrameContext): void;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import type { FrameContext } from '../../cal/playable-graph';
2
- import { Playable } from '../../cal/playable-graph';
3
- export declare class ColorPropertyMixerPlayable extends Playable {
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class ColorPropertyMixerPlayable extends TrackMixerPlayable {
4
4
  propertyName: string;
5
- processFrame(context: FrameContext): void;
5
+ evaluate(context: FrameContext): void;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import type { FrameContext } from '../../cal/playable-graph';
2
- import { Playable } from '../../cal/playable-graph';
3
- export declare class FloatPropertyMixerPlayable extends Playable {
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class FloatPropertyMixerPlayable extends TrackMixerPlayable {
4
4
  propertyName: string;
5
- processFrame(context: FrameContext): void;
5
+ evaluate(context: FrameContext): void;
6
6
  }
@@ -1,7 +1,11 @@
1
1
  export * from './activation-mixer-playable';
2
- export * from './property-clip-playable';
2
+ export * from './color-property-mixer-playable';
3
3
  export * from './float-property-mixer-playable';
4
+ export * from './particle-mixer-playable';
5
+ export * from './property-clip-playable';
6
+ export * from './sprite-color-mixer-playable';
4
7
  export * from './sub-composition-clip-playable';
5
8
  export * from './sub-composition-mixer-playable';
9
+ export * from './track-mixer-playable';
10
+ export * from './transform-mixer-playable';
6
11
  export * from './vector4-property-mixer-playable';
7
- export * from './color-property-mixer-playable';
@@ -0,0 +1,5 @@
1
+ import type { FrameContext } from '../../cal/playable-graph';
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class ParticleMixerPlayable extends TrackMixerPlayable {
4
+ evaluate(context: FrameContext): void;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { FrameContext } from '../../cal/playable-graph';
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class SpriteColorMixerPlayable extends TrackMixerPlayable {
4
+ evaluate(context: FrameContext): void;
5
+ }
@@ -1,5 +1,5 @@
1
1
  import type { FrameContext } from '../../cal/playable-graph';
2
- import { Playable } from '../../cal/playable-graph';
3
- export declare class SubCompositionMixerPlayable extends Playable {
4
- processFrame(context: FrameContext): void;
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class SubCompositionMixerPlayable extends TrackMixerPlayable {
4
+ evaluate(context: FrameContext): void;
5
5
  }
@@ -0,0 +1,12 @@
1
+ import type { FrameContext } from '../../cal/playable-graph';
2
+ import { Playable } from '../../cal/playable-graph';
3
+ export declare class TrackMixerPlayable extends Playable {
4
+ clipPlayables: Playable[];
5
+ clipWeights: number[];
6
+ processFrame(context: FrameContext): void;
7
+ setClipWeight(playable: Playable, weight: number): void;
8
+ setClipWeight(inputIndex: number, weight: number): void;
9
+ getClipWeight(inputIndex: number): number;
10
+ getClipPlayable(index: number): Playable;
11
+ evaluate(context: FrameContext): void;
12
+ }
@@ -0,0 +1,5 @@
1
+ import type { FrameContext } from '../../cal/playable-graph';
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class TransformMixerPlayable extends TrackMixerPlayable {
4
+ evaluate(context: FrameContext): void;
5
+ }
@@ -1,6 +1,6 @@
1
1
  import type { FrameContext } from '../../cal/playable-graph';
2
- import { Playable } from '../../cal/playable-graph';
3
- export declare class Vector4PropertyMixerPlayable extends Playable {
2
+ import { TrackMixerPlayable } from './track-mixer-playable';
3
+ export declare class Vector4PropertyMixerPlayable extends TrackMixerPlayable {
4
4
  propertyName: string;
5
- processFrame(context: FrameContext): void;
5
+ evaluate(context: FrameContext): void;
6
6
  }
@@ -3,6 +3,7 @@ import type { PlayableGraph } from '../cal/playable-graph';
3
3
  import { Playable, PlayableAsset, PlayableOutput } from '../cal/playable-graph';
4
4
  import { ParticleSystem } from '../particle/particle-system';
5
5
  import type { Constructor } from '../../utils';
6
+ import { TrackMixerPlayable } from './playables';
6
7
  /**
7
8
  * @since 2.0.0
8
9
  */
@@ -34,11 +35,11 @@ export declare class TrackAsset extends PlayableAsset {
34
35
  /**
35
36
  * 重写该方法以创建自定义混合器
36
37
  */
37
- createTrackMixer(graph: PlayableGraph): Playable;
38
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
38
39
  createOutput(): PlayableOutput;
39
- createPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
40
- createMixerPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
41
- compileClips(graph: PlayableGraph, timelineClips: TimelineClip[], runtimeClips: RuntimeClip[]): Playable;
40
+ createPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): TrackMixerPlayable;
41
+ createMixerPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): TrackMixerPlayable;
42
+ compileClips(graph: PlayableGraph, timelineClips: TimelineClip[], runtimeClips: RuntimeClip[]): TrackMixerPlayable;
42
43
  createPlayable(graph: PlayableGraph): Playable;
43
44
  getChildTracks(): TrackAsset[];
44
45
  addChild(child: TrackAsset): void;
@@ -56,10 +57,10 @@ export declare enum TrackType {
56
57
  export declare class RuntimeClip {
57
58
  clip: TimelineClip;
58
59
  playable: Playable;
59
- parentMixer: Playable;
60
+ parentMixer: TrackMixerPlayable;
60
61
  track: TrackAsset;
61
62
  particleSystem: ParticleSystem;
62
- constructor(clip: TimelineClip, clipPlayable: Playable, parentMixer: Playable, track: TrackAsset);
63
+ constructor(clip: TimelineClip, clipPlayable: Playable, parentMixer: TrackMixerPlayable, track: TrackAsset);
63
64
  set enable(value: boolean);
64
65
  evaluateAt(localTime: number): void;
65
66
  }
@@ -1,5 +1,6 @@
1
- import type { PlayableGraph, Playable } from '../../cal/playable-graph';
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
2
  import { TrackAsset } from '../track';
3
+ import type { TrackMixerPlayable } from '../playables/track-mixer-playable';
3
4
  export declare class ActivationTrack extends TrackAsset {
4
- createTrackMixer(graph: PlayableGraph): Playable;
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
5
6
  }
@@ -1,5 +1,6 @@
1
- import type { PlayableGraph, Playable } from '../../cal/playable-graph';
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
2
3
  import { PropertyTrack } from './property-track';
3
4
  export declare class ColorPropertyTrack extends PropertyTrack {
4
- createTrackMixer(graph: PlayableGraph): Playable;
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
5
6
  }
@@ -1,6 +1,7 @@
1
- import type { PlayableGraph, Playable } from '../../cal/playable-graph';
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
2
3
  import { PropertyTrack } from './property-track';
3
4
  export declare class FloatPropertyTrack extends PropertyTrack {
4
- createTrackMixer(graph: PlayableGraph): Playable;
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
5
6
  updateAnimatedObject(): void;
6
7
  }
@@ -4,6 +4,7 @@ export * from './sprite-color-track';
4
4
  export * from './sub-composition-track';
5
5
  export * from './transform-track';
6
6
  export * from './material-track';
7
+ export * from './particle-track';
7
8
  export * from './property-track';
8
9
  export * from './vector4-property-track';
9
10
  export * from './color-property-track';
@@ -0,0 +1,6 @@
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
3
+ import { TrackAsset } from '../track';
4
+ export declare class ParticleTrack extends TrackAsset {
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
6
+ }
@@ -1,6 +1,6 @@
1
1
  import type { EffectsObjectData } from '@galacean/effects-specification';
2
2
  import { TrackAsset } from '../track';
3
- export declare class PropertyTrack extends TrackAsset {
3
+ export declare abstract class PropertyTrack extends TrackAsset {
4
4
  protected propertyNames: string[];
5
5
  private path;
6
6
  updateAnimatedObject(): void;
@@ -1,3 +1,6 @@
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
1
3
  import { TrackAsset } from '../track';
2
4
  export declare class SpriteColorTrack extends TrackAsset {
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
3
6
  }
@@ -1,6 +1,7 @@
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
1
3
  import { TrackAsset } from '../track';
2
- import type { PlayableGraph, Playable } from '../../cal/playable-graph';
3
4
  export declare class SubCompositionTrack extends TrackAsset {
4
5
  updateAnimatedObject(): void;
5
- createTrackMixer(graph: PlayableGraph): Playable;
6
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
6
7
  }
@@ -1,3 +1,6 @@
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
1
3
  import { TrackAsset } from '../track';
2
4
  export declare class TransformTrack extends TrackAsset {
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
3
6
  }
@@ -1,5 +1,6 @@
1
- import type { PlayableGraph, Playable } from '../../cal/playable-graph';
1
+ import type { PlayableGraph } from '../../cal/playable-graph';
2
+ import type { TrackMixerPlayable } from '../playables';
2
3
  import { PropertyTrack } from './property-track';
3
4
  export declare class Vector4PropertyTrack extends PropertyTrack {
4
- createTrackMixer(graph: PlayableGraph): Playable;
5
+ createTrackMixer(graph: PlayableGraph): TrackMixerPlayable;
5
6
  }
package/dist/scene.d.ts CHANGED
@@ -2,7 +2,7 @@ import type * as spec from '@galacean/effects-specification';
2
2
  import type { Texture } from './texture';
3
3
  import type { PluginSystem } from './plugin-system';
4
4
  import type { PickEnum } from './utils';
5
- export type ImageLike = spec.HTMLImageLike | ArrayBuffer | Texture;
5
+ export type ImageLike = spec.HTMLImageLike | ArrayBuffer | Texture | ImageBitmap;
6
6
  export type SceneRenderLevel = PickEnum<spec.RenderLevel, spec.RenderLevel.A | spec.RenderLevel.B | spec.RenderLevel.S>;
7
7
  /**
8
8
  * 场景类型
@@ -70,6 +70,7 @@ export interface SceneLoadOptions {
70
70
  variables?: spec.TemplateVariables;
71
71
  /**
72
72
  * 是否使用压缩纹理
73
+ * @default undefined
73
74
  */
74
75
  useCompressedTexture?: boolean;
75
76
  /**
@@ -106,6 +107,17 @@ export interface SceneLoadOptions {
106
107
  reusable?: boolean;
107
108
  /**
108
109
  * 播放速度,当速度为负数时,合成倒播
110
+ * @default 1
109
111
  */
110
112
  speed?: number;
113
+ /**
114
+ * 是否禁用 AVIF 图片
115
+ * @default undefined
116
+ */
117
+ disableAVIF?: boolean;
118
+ /**
119
+ * 是否禁用 WebP 图片
120
+ * @default undefined
121
+ */
122
+ disableWebP?: boolean;
111
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.1.5",
3
+ "version": "2.2.0-alpha.0",
4
4
  "description": "Galacean Effects runtime core for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",