babylonjs-editor-tools 0.0.11 → 5.0.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 (41) hide show
  1. package/build/index.node.js +1 -1451
  2. package/build/src/cinematic/events/apply-impulse.js +5 -7
  3. package/build/src/cinematic/events/set-enabled.js +2 -3
  4. package/build/src/cinematic/generate.js +6 -4
  5. package/build/src/cinematic/guards.js +16 -0
  6. package/build/src/cinematic/parse.js +30 -2
  7. package/build/src/cinematic/tools.js +0 -31
  8. package/build/src/decorators/apply.js +32 -0
  9. package/build/src/decorators/inspector.js +71 -1
  10. package/build/src/index.js +4 -0
  11. package/build/src/loading/loader.js +7 -7
  12. package/build/src/loading/material.js +19 -0
  13. package/build/src/loading/script.js +84 -1
  14. package/build/src/rendering/default-pipeline.js +69 -1
  15. package/build/src/rendering/motion-blur.js +7 -0
  16. package/build/src/rendering/ssao.js +7 -0
  17. package/build/src/rendering/ssr.js +7 -0
  18. package/build/src/rendering/tools.js +3 -2
  19. package/build/src/rendering/vls.js +7 -0
  20. package/build/src/tools/animation.js +21 -0
  21. package/build/src/tools/guards.js +55 -0
  22. package/declaration/src/cinematic/events/apply-impulse.d.ts +5 -3
  23. package/declaration/src/cinematic/events/set-enabled.d.ts +3 -3
  24. package/declaration/src/cinematic/generate.d.ts +10 -1
  25. package/declaration/src/cinematic/guards.d.ts +6 -0
  26. package/declaration/src/cinematic/tools.d.ts +0 -5
  27. package/declaration/src/cinematic/typings.d.ts +2 -0
  28. package/declaration/src/decorators/inspector.d.ts +40 -2
  29. package/declaration/src/index.d.ts +4 -0
  30. package/declaration/src/loading/loader.d.ts +11 -1
  31. package/declaration/src/loading/material.d.ts +11 -0
  32. package/declaration/src/loading/script.d.ts +69 -1
  33. package/declaration/src/rendering/default-pipeline.d.ts +6 -1
  34. package/declaration/src/rendering/motion-blur.d.ts +5 -0
  35. package/declaration/src/rendering/ssao.d.ts +5 -0
  36. package/declaration/src/rendering/ssr.d.ts +5 -0
  37. package/declaration/src/rendering/tools.d.ts +2 -1
  38. package/declaration/src/rendering/vls.d.ts +5 -0
  39. package/declaration/src/tools/animation.d.ts +5 -0
  40. package/declaration/src/tools/guards.d.ts +36 -0
  41. package/package.json +9 -9
@@ -7,6 +7,13 @@ export const ssrRenderingPipelineCameraConfigurations = new Map();
7
7
  export function getSSRRenderingPipeline() {
8
8
  return ssrRenderingPipeline;
9
9
  }
10
+ /**
11
+ * Sets the reference to the ssr rendering pipeline.
12
+ * @access editor only.
13
+ */
14
+ export function setSSRRenderingPipelineRef(pipeline) {
15
+ ssrRenderingPipeline = pipeline;
16
+ }
10
17
  export function disposeSSRRenderingPipeline() {
11
18
  if (ssrRenderingPipeline) {
12
19
  ssrRenderingPipeline.dispose();
@@ -20,8 +20,9 @@ export function saveRenderingConfigurationForCamera(camera) {
20
20
  * saved per-camera and can be applied on demand using this function.
21
21
  * Previous post-processes configurations are disposed before applying the new ones.
22
22
  * @param camera defines the reference to the camera to apply its rendering configurations.
23
+ * @param rootUrl defines the rootUrl that contains all resource files needed by the post-processes (color grading texture, etc.).
23
24
  */
24
- export function applyRenderingConfigurationForCamera(camera) {
25
+ export function applyRenderingConfigurationForCamera(camera, rootUrl) {
25
26
  disposeSSAO2RenderingPipeline();
26
27
  disposeVLSPostProcess(camera.getScene());
27
28
  disposeSSRRenderingPipeline();
@@ -45,7 +46,7 @@ export function applyRenderingConfigurationForCamera(camera) {
45
46
  }
46
47
  const defaultRenderingPipeline = defaultPipelineCameraConfigurations.get(camera);
47
48
  if (defaultRenderingPipeline) {
48
- parseDefaultRenderingPipeline(camera.getScene(), camera, defaultRenderingPipeline);
49
+ parseDefaultRenderingPipeline(camera.getScene(), camera, defaultRenderingPipeline, rootUrl);
49
50
  }
50
51
  }
51
52
  //# sourceMappingURL=tools.js.map
@@ -10,6 +10,13 @@ export const vlsPostProcessCameraConfigurations = new Map();
10
10
  export function getVLSPostProcess() {
11
11
  return vlsPostProcess;
12
12
  }
13
+ /**
14
+ * Sets the reference to the volumetric light scattering post-process.
15
+ * @access editor only.
16
+ */
17
+ export function setVLSPostProcessRef(postProcess) {
18
+ vlsPostProcess = postProcess;
19
+ }
13
20
  export function disposeVLSPostProcess(scene) {
14
21
  if (vlsPostProcess && scene.activeCamera) {
15
22
  vlsPostProcess.dispose(scene.activeCamera);
@@ -0,0 +1,21 @@
1
+ import { Animation } from "@babylonjs/core/Animations/animation";
2
+ /**
3
+ * Returns the animation type according to the given animated property type.
4
+ * @param effectiveProperty defines the reference to the animated property to get its animation type.
5
+ */
6
+ export function getAnimationTypeForObject(effectiveProperty) {
7
+ if (!isNaN(parseFloat(effectiveProperty)) && isFinite(effectiveProperty)) {
8
+ return Animation.ANIMATIONTYPE_FLOAT;
9
+ }
10
+ switch (effectiveProperty?.getClassName?.()) {
11
+ case "Vector2": return Animation.ANIMATIONTYPE_VECTOR2;
12
+ case "Vector3": return Animation.ANIMATIONTYPE_VECTOR3;
13
+ case "Quaternion": return Animation.ANIMATIONTYPE_QUATERNION;
14
+ case "Color3": return Animation.ANIMATIONTYPE_COLOR3;
15
+ case "Color4": return Animation.ANIMATIONTYPE_COLOR4;
16
+ case "Size": return Animation.ANIMATIONTYPE_SIZE;
17
+ case "Matrix": return Animation.ANIMATIONTYPE_MATRIX;
18
+ }
19
+ return null;
20
+ }
21
+ //# sourceMappingURL=animation.js.map
@@ -122,4 +122,59 @@ export function isSpotLight(object) {
122
122
  export function isHemisphericLight(object) {
123
123
  return object.getClassName?.() === "HemisphericLight";
124
124
  }
125
+ /**
126
+ * Returns wether or not the given object is a Light.
127
+ * @param object defines the reference to the object to test its class name.
128
+ */
129
+ export function isLight(object) {
130
+ switch (object.getClassName?.()) {
131
+ case "Light":
132
+ case "PointLight":
133
+ case "SpotLight":
134
+ case "DirectionalLight":
135
+ case "HemisphericLight":
136
+ return true;
137
+ }
138
+ return false;
139
+ }
140
+ /**
141
+ * Returns wether or not the given object is a Node.
142
+ * @param object defines the reference to the object to test its class name.
143
+ */
144
+ export function isNode(object) {
145
+ return isAbstractMesh(object) || isTransformNode(object) || isLight(object) || isCamera(object);
146
+ }
147
+ /**
148
+ * Returns wether or not the given object is a Scene.
149
+ * @param object defines the reference to the object to test its class name.
150
+ */
151
+ export function isScene(object) {
152
+ return object.getClassName?.() === "Scene";
153
+ }
154
+ /**
155
+ * Returns wether or not the given object is a ParticleSystem.
156
+ * @param object defines the reference to the object to test its class name.
157
+ */
158
+ export function isParticleSystem(object) {
159
+ return object.getClassName?.() === "ParticleSystem";
160
+ }
161
+ /**
162
+ * Returns wether or not the given object is a GPUParticleSystem.
163
+ * @param object defines the reference to the object to test its class name.
164
+ */
165
+ export function isGPUParticleSystem(object) {
166
+ return object.getClassName?.() === "GPUParticleSystem";
167
+ }
168
+ /**
169
+ * Returns wether or not the given object is a IParticleSystem.
170
+ * @param object defines the reference to the object to test its class name.
171
+ */
172
+ export function isAnyParticleSystem(object) {
173
+ switch (object.getClassName?.()) {
174
+ case "ParticleSystem":
175
+ case "GPUParticleSystem":
176
+ return true;
177
+ }
178
+ return false;
179
+ }
125
180
  //# sourceMappingURL=guards.js.map
@@ -1,8 +1,10 @@
1
1
  import { Scene } from "@babylonjs/core/scene";
2
+ import { Vector3 } from "@babylonjs/core/Maths/math.vector";
3
+ import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
2
4
  export type SetEnabledEventType = {
3
- mesh: string;
5
+ mesh: AbstractMesh;
4
6
  radius: number;
5
- force: number[];
6
- contactPoint: number[];
7
+ force: Vector3;
8
+ contactPoint: Vector3;
7
9
  };
8
10
  export declare function handleApplyImpulseEvent(scene: Scene, config: SetEnabledEventType): void;
@@ -1,6 +1,6 @@
1
- import { Scene } from "@babylonjs/core/scene";
1
+ import { Node } from "@babylonjs/core/node";
2
2
  export type SetEnabledEventType = {
3
3
  value: boolean;
4
- node: string;
4
+ node: Node;
5
5
  };
6
- export declare function handleSetEnabledEvent(scene: Scene, config: SetEnabledEventType): void;
6
+ export declare function handleSetEnabledEvent(config: SetEnabledEventType): void;
@@ -1,9 +1,18 @@
1
1
  import { Scene } from "@babylonjs/core/scene";
2
2
  import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
3
3
  import { ICinematic } from "./typings";
4
+ export type GenerateCinematicAnimationGroupOptions = {
5
+ /**
6
+ * Defines wether or not sounds should be ignored when generating the animation group.
7
+ * This means that no sound will be played during the cinematic playback.
8
+ * @default false
9
+ */
10
+ ignoreSounds?: boolean;
11
+ };
4
12
  /**
5
13
  * Parses the given cinematic object and generates a new playable animation group.
6
14
  * @param cinematic defines the cinematic object to parse that was previously loaded.
7
15
  * @param scene defines the reference to the scene where to retrieve the animated objects.
16
+ * @param options defines the options to use when generating the animation group.
8
17
  */
9
- export declare function generateCinematicAnimationGroup(cinematic: ICinematic, scene: Scene): AnimationGroup;
18
+ export declare function generateCinematicAnimationGroup(cinematic: ICinematic, scene: Scene, options?: GenerateCinematicAnimationGroupOptions): AnimationGroup;
@@ -0,0 +1,6 @@
1
+ import { ICinematicAnimationGroup, ICinematicKey, ICinematicKeyCut, ICinematicKeyEvent, ICinematicSound } from "./typings";
2
+ export declare function isCinematicKey(key: any): key is ICinematicKey;
3
+ export declare function isCinematicKeyCut(key: any): key is ICinematicKeyCut;
4
+ export declare function isCinematicKeyEvent(key: any): key is ICinematicKeyEvent;
5
+ export declare function isCinematicGroup(key: any): key is ICinematicAnimationGroup;
6
+ export declare function isCinematicSound(key: any): key is ICinematicSound;
@@ -1,10 +1,5 @@
1
1
  import { IAnimationKey } from "@babylonjs/core/Animations/animationKey";
2
2
  export declare function cloneKey(dataType: number, key: IAnimationKey): IAnimationKey;
3
- /**
4
- * Returns the animation type according to the given animated property type.
5
- * @param effectiveProperty defines the reference to the animated property to get its animation type.
6
- */
7
- export declare function getAnimationTypeForObject(effectiveProperty: any): number | null;
8
3
  /**
9
4
  * Returns the current value of the given property of the given object.
10
5
  * @param object defines the root object where to parse the property and return its value.
@@ -6,6 +6,7 @@ export interface ICinematic {
6
6
  outputFramesPerSecond: number;
7
7
  }
8
8
  export interface ICinematicTrack {
9
+ _id?: string;
9
10
  animationGroup?: any;
10
11
  animationGroups?: ICinematicAnimationGroup[];
11
12
  node?: any;
@@ -42,3 +43,4 @@ export interface ICinematicKeyEvent {
42
43
  frame: number;
43
44
  data?: any;
44
45
  }
46
+ export type CinematicKeyType = ICinematicKey | ICinematicKeyCut | ICinematicAnimationGroup | ICinematicSound | ICinematicKeyEvent;
@@ -1,6 +1,7 @@
1
- export type VisibleInInspectorDecoratorType = "number" | "boolean" | "vector2" | "vector3" | "color3" | "color4";
1
+ export type VisibleInInspectorDecoratorType = "number" | "boolean" | "vector2" | "vector3" | "color3" | "color4" | "entity" | "texture" | "keymap";
2
2
  export type VisibleInInspectorDecoratorConfiguration = {
3
3
  type: VisibleInInspectorDecoratorType;
4
+ description?: string;
4
5
  };
5
6
  /**
6
7
  * Makes the decorated property visible in the editor inspector as a boolean.
@@ -8,8 +9,9 @@ export type VisibleInInspectorDecoratorConfiguration = {
8
9
  * once the script is invoked at runtime in the game/application.
9
10
  * This can be used only by scripts using Classes.
10
11
  * @param label defines the optional label displayed in the inspector in the editor.
12
+ * @param configuration defines the optional configuration for the field in the inspector (description, etc.).
11
13
  */
12
- export declare function visibleAsBoolean(label?: string): (target: any, propertyKey: string | Symbol) => void;
14
+ export declare function visibleAsBoolean(label?: string, configuration?: Omit<VisibleInInspectorDecoratorConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
13
15
  /**
14
16
  * Makes the decorated property visible in the editor inspector as a number.
15
17
  * The property can be customized per object in the editor and the custom value is applied
@@ -80,3 +82,39 @@ export type VisibleInInspectorDecoratorColor4Configuration = VisibleInInspectorD
80
82
  noClamp?: boolean;
81
83
  noColorPicker?: boolean;
82
84
  };
85
+ /**
86
+ * Makes the decorated property visible in the editor inspector as an entity.
87
+ * The property can be customized per object in the editor and the custom value is applied
88
+ * once the script is invoked at runtime in the game/application.
89
+ * This can be used only by scripts using Classes.
90
+ * @param entityType defines the type of entity to be displayed in the inspector (node, sound, animationGroup or particleSystem).
91
+ * @param label defines the optional label displayed in the inspector in the editor.
92
+ * @param configuration defines the optional configuration for the field in the inspector (min, max, etc.).
93
+ */
94
+ export declare function visibleAsEntity(entityType: VisibleAsEntityType, label?: string, configuration?: Omit<VisibleInInspectorDecoratorEntityConfiguration, "type" | "entityType">): (target: any, propertyKey: string | Symbol) => void;
95
+ export type VisibleAsEntityType = "node" | "sound" | "animationGroup" | "particleSystem";
96
+ export type VisibleInInspectorDecoratorEntityConfiguration = VisibleInInspectorDecoratorConfiguration & {
97
+ entityType?: VisibleAsEntityType;
98
+ };
99
+ /**
100
+ * Makes the decorated property visible in the editor inspector as a Texture.
101
+ * The property can be customized per object in the editor and the custom value is applied
102
+ * once the script is invoked at runtime in the game/application.
103
+ * This can be used only by scripts using Classes.
104
+ * @param label defines the optional label displayed in the inspector in the editor.
105
+ * @param configuration defines the optional configuration for the field in the inspector (accept cubes, etc.).
106
+ */
107
+ export declare function visibleAsTexture(label?: string, configuration?: Omit<VisibleInInspectorDecoratorTextureConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
108
+ export type VisibleInInspectorDecoratorTextureConfiguration = VisibleInInspectorDecoratorConfiguration & {
109
+ acceptCubes?: boolean;
110
+ onlyCubes?: boolean;
111
+ };
112
+ /**
113
+ * Makes the decorated property visible in the editor inspector as a KeyMap.
114
+ * The property can be customized per object in the editor and the custom value is applied
115
+ * once the script is invoked at runtime in the game/application.
116
+ * This can be used only by scripts using Classes.
117
+ * @param label defines the optional label displayed in the inspector in the editor.
118
+ * @param configuration defines the optional configuration for the field in the inspector (description, etc.).
119
+ */
120
+ export declare function visibleAsKeyMap(label?: string, configuration?: Omit<VisibleInInspectorDecoratorConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
@@ -1,8 +1,11 @@
1
1
  export * from "./loading/loader";
2
+ export * from "./loading/material";
3
+ export * from "./loading/script";
2
4
  export * from "./tools/guards";
3
5
  export * from "./tools/texture";
4
6
  export * from "./tools/light";
5
7
  export * from "./tools/scalar";
8
+ export * from "./tools/animation";
6
9
  export * from "./rendering/ssao";
7
10
  export * from "./rendering/ssr";
8
11
  export * from "./rendering/motion-blur";
@@ -17,3 +20,4 @@ export * from "./script";
17
20
  export * from "./cinematic/parse";
18
21
  export * from "./cinematic/typings";
19
22
  export * from "./cinematic/generate";
23
+ export * from "./cinematic/guards";
@@ -18,13 +18,23 @@ export type ScriptMap = Record<string, {
18
18
  /**
19
19
  * Defines the overall desired quality of the scene.
20
20
  * In other words, defines the quality of textures that will be loaded in terms of dimensions.
21
- * The editor computes automatic "hight (untouched)", "medium (half)", and "low (quarter)" quality levels for textures.
21
+ * The editor computes automatic "high (untouched)", "medium (half)", and "low (quarter)" quality levels for textures.
22
22
  * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene
23
23
  * especially on mobiles where memory is limited.
24
24
  */
25
25
  export type SceneLoaderQualitySelector = "low" | "medium" | "high";
26
26
  export type SceneLoaderOptions = {
27
+ /**
28
+ * Defines the quality of the scene.
29
+ * This will affect the quality of textures that will be loaded in terms of dimensions.
30
+ * The editor computes automatic "high (untouched)", "medium (half)", and "low (quarter)" quality levels for textures.
31
+ * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene
32
+ * especially on mobiles where memory is limited.
33
+ */
27
34
  quality?: SceneLoaderQualitySelector;
35
+ /**
36
+ * Defines the function called to notify the loading progress in interval [0, 1]
37
+ */
28
38
  onProgress?: (value: number) => void;
29
39
  };
30
40
  declare module "@babylonjs/core/scene" {
@@ -0,0 +1,11 @@
1
+ import { Scene } from "@babylonjs/core/scene";
2
+ import { Material } from "@babylonjs/core/Materials/material";
3
+ /**
4
+ * Loads the file located at `rootUrl + relativePath` and creates a new material from it.
5
+ * @param rootUrl defines the absolute root url for the assets. (generally "/scene/")
6
+ * @param relativePath defines the path relative to `rootUrl` for the material file
7
+ * @param scene defines the reference to the scene where to add the loaded material.
8
+ * @returns the reference to the created material.
9
+ * @example await loadMaterialFromFile<PBRMaterial>("/scene/", "assets/floor.material", scene);
10
+ */
11
+ export declare function loadMaterialFromFile<T extends Material>(rootUrl: string, relativePath: string, scene: Scene): Promise<T>;
@@ -1,3 +1,71 @@
1
1
  import { Scene } from "@babylonjs/core/scene";
2
+ import { IScript } from "../script";
2
3
  import { ScriptMap } from "./loader";
3
- export declare function applyScriptForObject(scene: Scene, object: any, scriptsMap: ScriptMap, rootUrl: string): void;
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare function _applyScriptsForObject(scene: Scene, object: any, scriptsMap: ScriptMap, rootUrl: string): void;
8
+ export interface IRegisteredScript {
9
+ /**
10
+ * Defines the key of the script. Refer to scriptMap.
11
+ */
12
+ key: string;
13
+ /**
14
+ * Defines the instance of the script that was created while loading the scene.
15
+ */
16
+ instance: IScript;
17
+ }
18
+ /**
19
+ * When a scene is being loaded, scripts that were attached to objects in the scene using the Editor are processed.
20
+ * This function registers the instance of scripts per object in order to retrieve them later.
21
+ * @param object defines the object in the scene on which the script is attached to.
22
+ * @param scriptInstance defines the instance of the script to register.
23
+ * @param key defines the key of the script. This value is used to identify the script.
24
+ */
25
+ export declare function registerScriptInstance(object: any, scriptInstance: IScript, key: string): void;
26
+ /**
27
+ * Returns all the instances of the script attached to the given object that matches the given class type.
28
+ * The same script can be attached multiple times to the same object. If you ensure that ONLY DISTINCT scripts
29
+ * are attached to the object, you can use `getScriptByClassForObject` which will return the unique instance for the given object.
30
+ * @param object defines the reference to the object where the script to retrieve is attached to.
31
+ * @param classType defines the class of the type to retrieve
32
+ * @example
33
+ * import { IScript, getAllScriptsByClassForObject } from "babylonjs-editor-tools";
34
+ *
35
+ * class ScriptClass implements IScript {
36
+ * public onStart(): void {
37
+ * const instances = getAllScriptsByClassForObject(mesh, OtherScriptClass);
38
+ * instances.forEach((i) => {
39
+ * i.doSomething();
40
+ * });
41
+ * }
42
+ * }
43
+ *
44
+ * class OtherScriptClass implements IScript {
45
+ * public doSomething(): void {
46
+ * console.log("Doing something!");
47
+ * }
48
+ * }
49
+ */
50
+ export declare function getAllScriptsByClassForObject<T>(object: any, classType: T): T[];
51
+ /**
52
+ * Returns the instance of the script attached to the given object that matches the given class type.
53
+ * @param object defines the reference to the object where the script to retrieve is attached to.
54
+ * @param classType defines the class of the type to retrieve
55
+ * @example
56
+ * import { IScript, getScriptByClassForObject } from "babylonjs-editor-tools";
57
+ *
58
+ * class ScriptClass implements IScript {
59
+ * public onStart(): void {
60
+ * const instance = getScriptByClassForObject(mesh, OtherScriptClass);
61
+ * instance.doSomething();
62
+ * }
63
+ * }
64
+ *
65
+ * class OtherScriptClass implements IScript {
66
+ * public doSomething(): void {
67
+ * console.log("Doing something!");
68
+ * }
69
+ * }
70
+ */
71
+ export declare function getScriptByClassForObject<T>(object: any, classType: T): NonNullable<T> | null;
@@ -9,7 +9,12 @@ export declare const defaultPipelineCameraConfigurations: Map<Camera, any>;
9
9
  * Returns the reference to the default rendering pipeline if exists.
10
10
  */
11
11
  export declare function getDefaultRenderingPipeline(): DefaultRenderingPipeline | null;
12
+ /**
13
+ * Sets the reference to the default rendering pipeline.
14
+ * @access editor only.
15
+ */
16
+ export declare function setDefaultRenderingPipelineRef(pipeline: DefaultRenderingPipeline | null): void;
12
17
  export declare function disposeDefaultRenderingPipeline(): void;
13
18
  export declare function createDefaultRenderingPipeline(scene: Scene, camera: Camera): DefaultRenderingPipeline;
14
19
  export declare function serializeDefaultRenderingPipeline(): any;
15
- export declare function parseDefaultRenderingPipeline(scene: Scene, camera: Camera, data: any): DefaultRenderingPipeline;
20
+ export declare function parseDefaultRenderingPipeline(scene: Scene, camera: Camera, data: any, rootUrl: string): DefaultRenderingPipeline;
@@ -6,6 +6,11 @@ import { MotionBlurPostProcess } from "@babylonjs/core/PostProcesses/motionBlurP
6
6
  */
7
7
  export declare const motionBlurPostProcessCameraConfigurations: Map<Camera, any>;
8
8
  export declare function getMotionBlurPostProcess(): MotionBlurPostProcess | null;
9
+ /**
10
+ * Sets the reference to the motion blur post-process.
11
+ * @access editor only.
12
+ */
13
+ export declare function setMotionBlurPostProcessRef(postProcess: MotionBlurPostProcess | null): void;
9
14
  export declare function disposeMotionBlurPostProcess(): void;
10
15
  export declare function createMotionBlurPostProcess(scene: Scene, camera: Camera): MotionBlurPostProcess;
11
16
  export declare function serializeMotionBlurPostProcess(): any;
@@ -6,6 +6,11 @@ import { SSAO2RenderingPipeline } from "@babylonjs/core/PostProcesses/RenderPipe
6
6
  */
7
7
  export declare const ssaoRenderingPipelineCameraConfigurations: Map<Camera, any>;
8
8
  export declare function getSSAO2RenderingPipeline(): SSAO2RenderingPipeline | null;
9
+ /**
10
+ * Sets the reference to the SSAO rendering pipeline.
11
+ * @access editor only.
12
+ */
13
+ export declare function setSSAO2RenderingPipelineRef(pipeline: SSAO2RenderingPipeline | null): void;
9
14
  export declare function disposeSSAO2RenderingPipeline(): void;
10
15
  export declare function createSSAO2RenderingPipeline(scene: Scene, camera: Camera): SSAO2RenderingPipeline;
11
16
  export declare function serializeSSAO2RenderingPipeline(): any;
@@ -6,6 +6,11 @@ import { SSRRenderingPipeline } from "@babylonjs/core/PostProcesses/RenderPipeli
6
6
  */
7
7
  export declare const ssrRenderingPipelineCameraConfigurations: Map<Camera, any>;
8
8
  export declare function getSSRRenderingPipeline(): SSRRenderingPipeline | null;
9
+ /**
10
+ * Sets the reference to the ssr rendering pipeline.
11
+ * @access editor only.
12
+ */
13
+ export declare function setSSRRenderingPipelineRef(pipeline: SSRRenderingPipeline | null): void;
9
14
  export declare function disposeSSRRenderingPipeline(): void;
10
15
  export declare function createSSRRenderingPipeline(scene: Scene, camera: Camera): SSRRenderingPipeline;
11
16
  export declare function serializeSSRRenderingPipeline(): any;
@@ -10,5 +10,6 @@ export declare function saveRenderingConfigurationForCamera(camera: Camera): voi
10
10
  * saved per-camera and can be applied on demand using this function.
11
11
  * Previous post-processes configurations are disposed before applying the new ones.
12
12
  * @param camera defines the reference to the camera to apply its rendering configurations.
13
+ * @param rootUrl defines the rootUrl that contains all resource files needed by the post-processes (color grading texture, etc.).
13
14
  */
14
- export declare function applyRenderingConfigurationForCamera(camera: Camera): void;
15
+ export declare function applyRenderingConfigurationForCamera(camera: Camera, rootUrl: string): void;
@@ -7,6 +7,11 @@ import { VolumetricLightScatteringPostProcess } from "@babylonjs/core/PostProces
7
7
  */
8
8
  export declare const vlsPostProcessCameraConfigurations: Map<Camera, any>;
9
9
  export declare function getVLSPostProcess(): VolumetricLightScatteringPostProcess | null;
10
+ /**
11
+ * Sets the reference to the volumetric light scattering post-process.
12
+ * @access editor only.
13
+ */
14
+ export declare function setVLSPostProcessRef(postProcess: VolumetricLightScatteringPostProcess | null): void;
10
15
  export declare function disposeVLSPostProcess(scene: Scene): void;
11
16
  export declare function createVLSPostProcess(scene: Scene, mesh?: Mesh | null): VolumetricLightScatteringPostProcess;
12
17
  export declare function serializeVLSPostProcess(): any;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns the animation type according to the given animated property type.
3
+ * @param effectiveProperty defines the reference to the animated property to get its animation type.
4
+ */
5
+ export declare function getAnimationTypeForObject(effectiveProperty: any): number | null;
@@ -1,3 +1,5 @@
1
+ import { Scene } from "@babylonjs/core/scene";
2
+ import { Node } from "@babylonjs/core/node";
1
3
  import { Bone } from "@babylonjs/core/Bones/bone";
2
4
  import { Mesh } from "@babylonjs/core/Meshes/mesh";
3
5
  import { GroundMesh } from "@babylonjs/core/Meshes/groundMesh";
@@ -7,10 +9,14 @@ import { Texture } from "@babylonjs/core/Materials/Textures/texture";
7
9
  import { Camera } from "@babylonjs/core/Cameras/camera";
8
10
  import { FreeCamera } from "@babylonjs/core/Cameras/freeCamera";
9
11
  import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera";
12
+ import { Light } from "@babylonjs/core/Lights/light";
10
13
  import { SpotLight } from "@babylonjs/core/Lights/spotLight";
11
14
  import { PointLight } from "@babylonjs/core/Lights/pointLight";
12
15
  import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight";
13
16
  import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight";
17
+ import { ParticleSystem } from "@babylonjs/core/Particles/particleSystem";
18
+ import { IParticleSystem } from "@babylonjs/core/Particles/IParticleSystem";
19
+ import { GPUParticleSystem } from "@babylonjs/core/Particles/gpuParticleSystem";
14
20
  /**
15
21
  * Returns wether or not the given object is an AbstractMesh.
16
22
  * @param object defines the reference to the object to test its class name.
@@ -81,3 +87,33 @@ export declare function isSpotLight(object: any): object is SpotLight;
81
87
  * @param object defines the reference to the object to test its class name.
82
88
  */
83
89
  export declare function isHemisphericLight(object: any): object is HemisphericLight;
90
+ /**
91
+ * Returns wether or not the given object is a Light.
92
+ * @param object defines the reference to the object to test its class name.
93
+ */
94
+ export declare function isLight(object: any): object is Light;
95
+ /**
96
+ * Returns wether or not the given object is a Node.
97
+ * @param object defines the reference to the object to test its class name.
98
+ */
99
+ export declare function isNode(object: any): object is Node;
100
+ /**
101
+ * Returns wether or not the given object is a Scene.
102
+ * @param object defines the reference to the object to test its class name.
103
+ */
104
+ export declare function isScene(object: any): object is Scene;
105
+ /**
106
+ * Returns wether or not the given object is a ParticleSystem.
107
+ * @param object defines the reference to the object to test its class name.
108
+ */
109
+ export declare function isParticleSystem(object: any): object is ParticleSystem;
110
+ /**
111
+ * Returns wether or not the given object is a GPUParticleSystem.
112
+ * @param object defines the reference to the object to test its class name.
113
+ */
114
+ export declare function isGPUParticleSystem(object: any): object is GPUParticleSystem;
115
+ /**
116
+ * Returns wether or not the given object is a IParticleSystem.
117
+ * @param object defines the reference to the object to test its class name.
118
+ */
119
+ export declare function isAnyParticleSystem(object: any): object is IParticleSystem;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "babylonjs-editor-tools",
3
- "version": "0.0.11",
4
- "description": "Babylon.js Editor Tools is a set of tools to help you create, edit and manage your Babylon.js scenes made using the Babylon.JS Editor",
3
+ "version": "5.0.0",
4
+ "description": "Babylon.js Editor Tools is a set of tools to help you create, edit and manage your Babylon.js scenes made using the Babylon.js Editor",
5
5
  "productName": "Babylon.js Editor Tools",
6
6
  "scripts": {
7
7
  "build": "tsc -p . && node esbuild.mjs",
8
8
  "watch": "concurrently \"tsc -p . --watch\" \"node esbuild.mjs --watch\"",
9
- "test": "jest test/*",
10
- "coverage": "jest test/* --coverage"
9
+ "test": "jest build/test/*",
10
+ "coverage": "jest build/test/* --coverage"
11
11
  },
12
12
  "main": "build/index.js",
13
13
  "exports": {
@@ -17,21 +17,21 @@
17
17
  "require": "./build/index.node.js"
18
18
  }
19
19
  },
20
- "typings": "declaration/src/index.ts",
20
+ "typings": "declaration/src/index.d.ts",
21
21
  "license": "(Apache-2.0)",
22
22
  "devDependencies": {
23
23
  "@babel/core": "^7.26.10",
24
24
  "@babel/preset-env": "^7.26.9",
25
25
  "@babel/preset-typescript": "^7.27.0",
26
- "@babylonjs/core": "8.6.1",
27
- "@babylonjs/gui": "8.6.1",
26
+ "@babylonjs/core": "8.15.1",
27
+ "@babylonjs/gui": "8.15.1",
28
28
  "@types/jest": "^29.5.14",
29
29
  "babel-jest": "^29.7.0",
30
30
  "babel-plugin-transform-class-properties": "^6.24.1",
31
31
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
32
- "esbuild": "^0.25.0",
32
+ "esbuild": "0.25.5",
33
33
  "jest": "^29.7.0",
34
- "typescript": "5.4.5"
34
+ "typescript": "5.8.3"
35
35
  },
36
36
  "dependencies": {}
37
37
  }