@galacean/effects-core 2.0.0-alpha.13 → 2.0.0-alpha.15

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.
@@ -28,6 +28,6 @@ export declare class PluginSystem {
28
28
  createPluginItem(name: string, props: VFXItemProps, composition: Composition): VFXItem;
29
29
  processRawJSON(json: spec.JSONScene, options: SceneLoadOptions): Promise<void[]>;
30
30
  private callStatic;
31
- precompile(compositions: spec.Composition[], renderer: Renderer, options?: PrecompileOptions): Promise<void[]>;
31
+ precompile(compositions: spec.CompositionData[], renderer: Renderer, options?: PrecompileOptions): Promise<void[]>;
32
32
  loadResources(scene: Scene, options: SceneLoadOptions): Promise<void[]>;
33
33
  }
@@ -1,8 +1,8 @@
1
1
  import type { Euler, Vector3 } from '@galacean/effects-math/es/core/index';
2
- import * as spec from '@galacean/effects-specification';
3
- import type { Engine } from '../../engine';
2
+ import type * as spec from '@galacean/effects-specification';
4
3
  import type { ValueGetter } from '../../math';
5
4
  import { TrackAsset } from '../timeline/track';
5
+ import type { TimelineAsset } from './timeline-asset';
6
6
  /**
7
7
  * 基础位移属性数据
8
8
  */
@@ -19,24 +19,12 @@ export type ItemLinearVelOverLifetime = {
19
19
  z?: ValueGetter<number>;
20
20
  enabled?: boolean;
21
21
  };
22
- export interface CalculateItemOptions {
23
- start: number;
24
- duration: number;
25
- looping: boolean;
26
- endBehavior: number;
27
- startRotation?: number;
28
- start3DRotation?: number;
29
- }
30
22
  /**
31
23
  * @since 2.0.0
32
24
  * @internal
33
25
  */
34
26
  export declare class ObjectBindingTrack extends TrackAsset {
35
- options: CalculateItemOptions;
36
27
  data: spec.EffectsObjectData;
37
- private trackSeed;
38
- create(): void;
39
- toLocalTime(time: number): number;
40
- createTrack<T extends TrackAsset>(classConstructor: new (engine: Engine) => T, name?: string): T;
28
+ create(timelineAsset: TimelineAsset): void;
41
29
  fromData(data: spec.EffectsObjectData): void;
42
30
  }
@@ -1,20 +1,19 @@
1
1
  import type { DataPath, EffectsObjectData } from '@galacean/effects-specification';
2
2
  import type { RuntimeClip, TrackAsset } from '../timeline/track';
3
- import { ObjectBindingTrack } from './calculate-item';
4
3
  import type { FrameContext, PlayableGraph } from './playable-graph';
5
4
  import { Playable, PlayableAsset } from './playable-graph';
5
+ import type { Engine } from '../../engine';
6
6
  export interface TimelineAssetData extends EffectsObjectData {
7
7
  tracks: DataPath[];
8
8
  }
9
9
  export declare class TimelineAsset extends PlayableAsset {
10
10
  tracks: TrackAsset[];
11
- graph: PlayableGraph;
12
11
  createPlayable(graph: PlayableGraph): Playable;
12
+ createTrack<T extends TrackAsset>(classConstructor: new (engine: Engine) => T, parent: TrackAsset, name?: string): T;
13
13
  fromData(data: TimelineAssetData): void;
14
14
  }
15
15
  export declare class TimelinePlayable extends Playable {
16
16
  clips: RuntimeClip[];
17
- masterTracks: ObjectBindingTrack[];
18
17
  prepareFrame(context: FrameContext): void;
19
18
  evaluate(): void;
20
19
  compileTracks(graph: PlayableGraph, tracks: TrackAsset[]): void;
@@ -22,6 +22,8 @@ export * from './timeline/track';
22
22
  export * from './timeline/tracks/transform-track';
23
23
  export * from './timeline/tracks/activation-track';
24
24
  export * from './timeline/tracks/sprite-color-track';
25
+ export * from './timeline/tracks/sub-composition-track';
26
+ export * from './timeline/playables/sub-composition-playable-asset';
25
27
  export * from './cal/timeline-asset';
26
28
  export * from './text/text-item';
27
29
  export * from './text/text-loader';
@@ -9,7 +9,6 @@ import type { Renderer } from '../../render';
9
9
  import { Geometry } from '../../render';
10
10
  import type { GeometryFromShape } from '../../shape';
11
11
  import type { Texture } from '../../texture';
12
- import type { CalculateItemOptions } from '../cal/calculate-item';
13
12
  import type { FrameContext, PlayableGraph } from '../cal/playable-graph';
14
13
  import { Playable, PlayableAsset } from '../cal/playable-graph';
15
14
  import type { BoundingBoxTriangle, HitTestTriangleParams } from '../interact/click-handler';
@@ -30,7 +29,7 @@ export interface SpriteItemProps extends Omit<spec.SpriteContent, 'renderer'> {
30
29
  export type SpriteItemOptions = {
31
30
  startColor: vec4;
32
31
  renderLevel?: string;
33
- } & CalculateItemOptions;
32
+ };
34
33
  /**
35
34
  * 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
36
35
  */
@@ -0,0 +1,5 @@
1
+ import type { FrameContext } from '../../cal/playable-graph';
2
+ import { Playable } from '../../cal/playable-graph';
3
+ export declare class SubCompositionClipPlayable extends Playable {
4
+ processFrame(context: FrameContext): void;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { Playable, PlayableGraph } from '../../cal/playable-graph';
2
+ import { PlayableAsset } from '../../cal/playable-graph';
3
+ export declare class SubCompositionPlayableAsset extends PlayableAsset {
4
+ createPlayable(graph: PlayableGraph): Playable;
5
+ }
@@ -1,6 +1,5 @@
1
1
  import { ItemEndBehavior } from '@galacean/effects-specification';
2
2
  import type { Engine } from '../../engine';
3
- import { VFXItem } from '../../vfx-item';
4
3
  import type { PlayableGraph } from '../cal/playable-graph';
5
4
  import { Playable, PlayableAsset, PlayableOutput } from '../cal/playable-graph';
6
5
  /**
@@ -8,28 +7,27 @@ import { Playable, PlayableAsset, PlayableOutput } from '../cal/playable-graph';
8
7
  * @internal
9
8
  */
10
9
  export declare class TrackAsset extends PlayableAsset {
11
- id: string;
12
10
  name: string;
13
- binding: VFXItem;
11
+ binding: object;
14
12
  trackType: TrackType;
15
13
  private clipSeed;
16
14
  private clips;
17
15
  protected children: TrackAsset[];
18
- initializeBinding(parentBinding: object): void;
19
16
  /**
20
- * @internal
17
+ * 重写该方法以获取自定义对象绑定
21
18
  */
22
- initializeBindingRecursive(parentBinding: object): void;
23
- createOutput(): PlayableOutput;
24
- createPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
25
- createMixerPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
26
- compileClips(graph: PlayableGraph, timelineClips: TimelineClip[], runtimeClips: RuntimeClip[]): Playable;
19
+ resolveBinding(parentBinding: object): object;
27
20
  /**
28
21
  * 重写该方法以创建自定义混合器
29
22
  */
30
23
  createTrackMixer(graph: PlayableGraph): Playable;
24
+ createOutput(): PlayableOutput;
25
+ createPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
26
+ createMixerPlayableGraph(graph: PlayableGraph, runtimeClips: RuntimeClip[]): Playable;
27
+ compileClips(graph: PlayableGraph, timelineClips: TimelineClip[], runtimeClips: RuntimeClip[]): Playable;
31
28
  createPlayable(graph: PlayableGraph): Playable;
32
29
  getChildTracks(): TrackAsset[];
30
+ addChild(child: TrackAsset): void;
33
31
  createClip<T extends PlayableAsset>(classConstructor: new (engine: Engine) => T, name?: string): TimelineClip;
34
32
  getClips(): TimelineClip[];
35
33
  findClip(name: string): TimelineClip | undefined;
@@ -0,0 +1,4 @@
1
+ import { TrackAsset } from '../track';
2
+ export declare class SubCompositionTrack extends TrackAsset {
3
+ resolveBinding(parentBinding: object): object;
4
+ }
@@ -8,6 +8,7 @@ export declare class SerializationHelper {
8
8
  static checkTypedArray(obj: any): boolean;
9
9
  static checkDataPath(value: any): boolean;
10
10
  static checkGLTFNode(value: any): boolean;
11
+ static checkImageSource(value: any): boolean;
11
12
  private static deserializeProperty;
12
13
  private static deserializePropertyAsync;
13
14
  private static serializeObjectProperty;
@@ -63,7 +63,9 @@ export declare function isFunction(obj: any): boolean;
63
63
  * @return {boolean}
64
64
  */
65
65
  export declare function isObject(obj: any): boolean;
66
+ export declare function isCanvas(canvas: HTMLCanvasElement): boolean;
66
67
  export declare function deepClone(obj: any): any;
67
68
  export declare function random(min: number, max: number): number;
68
69
  export declare function throwDestroyedError(): void;
69
70
  export declare function generateGUID(): string;
71
+ export declare function base64ToFile(base64: string, filename?: string, contentType?: string): File;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.15",
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.0.0-alpha.16",
45
+ "@galacean/effects-specification": "2.0.0-alpha.17",
46
46
  "@galacean/effects-math": "1.1.0",
47
47
  "uuid": "9.0.1"
48
48
  },