babylonjs-editor 5.4.1-alpha.8 → 5.4.1-rc.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.
- package/declaration/src/editor/layout/inspector/sound/sound-node.d.ts +23 -0
- package/declaration/src/editor/layout/preview/{gizmo.d.ts → gizmo/gizmo.d.ts} +5 -0
- package/declaration/src/editor/layout/preview/gizmo/settings.d.ts +18 -0
- package/declaration/src/editor/layout/preview/icons.d.ts +2 -2
- package/declaration/src/editor/layout/preview/import/sound.d.ts +2 -1
- package/declaration/src/editor/layout/preview.d.ts +4 -1
- package/declaration/src/editor/nodes/sound.d.ts +42 -0
- package/declaration/src/project/add/sound.d.ts +4 -0
- package/declaration/src/project/load/plugins/sound-nodes.d.ts +4 -0
- package/declaration/src/project/load/scene.d.ts +2 -0
- package/declaration/src/project/typings.d.ts +6 -1
- package/declaration/src/tools/guards/sound.d.ts +6 -0
- package/declaration/src/tools/scene/gizmo.d.ts +15 -0
- package/declaration/src/tools/scene/screenshot.d.ts +11 -3
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, ReactNode } from "react";
|
|
2
|
+
import { SoundNode } from "../../../nodes/sound";
|
|
3
|
+
import { IEditorInspectorImplementationProps } from "../inspector";
|
|
4
|
+
export interface IEditorSoundNodeInspectorState {
|
|
5
|
+
dragOver: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class EditorSoundNodeInspector extends Component<IEditorInspectorImplementationProps<SoundNode>, IEditorSoundNodeInspectorState> {
|
|
8
|
+
/**
|
|
9
|
+
* Returns whether or not the given object is supported by this inspector.
|
|
10
|
+
* @param object defines the object to check.
|
|
11
|
+
* @returns true if the object is supported by this inspector.
|
|
12
|
+
*/
|
|
13
|
+
static IsSupported(object: unknown): boolean;
|
|
14
|
+
constructor(props: IEditorInspectorImplementationProps<SoundNode>);
|
|
15
|
+
private _gizmoObserver;
|
|
16
|
+
componentDidMount(): void;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
render(): ReactNode;
|
|
19
|
+
private _getSoundInspector;
|
|
20
|
+
private _handlePlay;
|
|
21
|
+
private _handleStop;
|
|
22
|
+
private _getSoundDraggableZone;
|
|
23
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GizmoCoordinatesMode, Node, Observable, PositionGizmo, RotationGizmo, ScaleGizmo, Scene, UtilityLayerRenderer, Sprite } from "babylonjs";
|
|
2
|
+
import { IGizmoSnapPreferences } from "../../../../tools/scene/gizmo";
|
|
2
3
|
export declare const onGizmoNodeChangedObservable: Observable<Node | Sprite>;
|
|
3
4
|
export declare class EditorPreviewGizmo {
|
|
4
5
|
/**
|
|
@@ -13,6 +14,7 @@ export declare class EditorPreviewGizmo {
|
|
|
13
14
|
private _attachedNode;
|
|
14
15
|
private _attachedSprite;
|
|
15
16
|
private _spriteTransformNode;
|
|
17
|
+
private _snapPreferences;
|
|
16
18
|
constructor(scene: Scene);
|
|
17
19
|
/**
|
|
18
20
|
* Gets the current gizmo.
|
|
@@ -23,6 +25,9 @@ export declare class EditorPreviewGizmo {
|
|
|
23
25
|
* @param gizmo The gizmo to set.
|
|
24
26
|
*/
|
|
25
27
|
setGizmoType(gizmo: "position" | "rotation" | "scaling" | "none"): void;
|
|
28
|
+
getSnapPreferences(): IGizmoSnapPreferences;
|
|
29
|
+
setSnapPreferences(prefs: IGizmoSnapPreferences): void;
|
|
30
|
+
private _applySnapToCurrentGizmos;
|
|
26
31
|
/**
|
|
27
32
|
* Gets the reference to the node that is attached and controlled by the gizmo.
|
|
28
33
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ReactNode } from "react";
|
|
2
|
+
import { Editor } from "../../../main";
|
|
3
|
+
export interface IEditorPreviewGizmoSettingsProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
}
|
|
6
|
+
export interface IEditorPreviewGizmoSettingsState {
|
|
7
|
+
}
|
|
8
|
+
export declare class EditorPreviewGizmoSettings extends Component<IEditorPreviewGizmoSettingsProps, IEditorPreviewGizmoSettingsState> {
|
|
9
|
+
/**
|
|
10
|
+
* Mutable holder for gizmo snap step fields; EditorInspectorNumberField writes via setInspectorEffectivePropertyValue.
|
|
11
|
+
* Synced from state when rendering the gizmo snap toolbar.
|
|
12
|
+
*/
|
|
13
|
+
private _gizmoSnapNumberFields;
|
|
14
|
+
constructor(props: IEditorPreviewGizmoSettingsProps);
|
|
15
|
+
render(): ReactNode;
|
|
16
|
+
private _getSnapFieldComponent;
|
|
17
|
+
private _commitGizmoSnap;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, ReactNode } from "react";
|
|
2
|
-
import { Node, Vector2
|
|
2
|
+
import { Node, Vector2 } from "babylonjs";
|
|
3
3
|
import { Editor } from "../../main";
|
|
4
4
|
export interface IEditorPreviewIconsProps {
|
|
5
5
|
editor: Editor;
|
|
@@ -8,8 +8,8 @@ export interface IEditorPreviewIconsState {
|
|
|
8
8
|
buttons: _IButtonData[];
|
|
9
9
|
}
|
|
10
10
|
interface _IButtonData {
|
|
11
|
+
node: Node;
|
|
11
12
|
position: Vector2;
|
|
12
|
-
node: Node | Sound;
|
|
13
13
|
}
|
|
14
14
|
export declare class EditorPreviewIcons extends Component<IEditorPreviewIconsProps, IEditorPreviewIconsState> {
|
|
15
15
|
private _tempMesh;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Scene, Node } from "babylonjs";
|
|
1
2
|
import { Editor } from "../../../main";
|
|
2
|
-
export declare function applySoundAsset(editor: Editor,
|
|
3
|
+
export declare function applySoundAsset(editor: Editor, parent: Scene | Node, absolutePath: string): Promise<void>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Component, ReactNode } from "react";
|
|
2
2
|
import { AbstractEngine, Camera, ISceneLoaderAsyncResult, Scene, PickingInfo, SelectionOutlineLayer, ClusteredLightContainer } from "babylonjs";
|
|
3
3
|
import { Editor } from "../main";
|
|
4
|
+
import { IGizmoSnapPreferences } from "../../tools/scene/gizmo";
|
|
4
5
|
import { EditorCamera } from "../nodes/camera";
|
|
5
|
-
import { EditorPreviewGizmo } from "./preview/gizmo";
|
|
6
6
|
import { EditorPreviewIcons } from "./preview/icons";
|
|
7
7
|
import { EditorPreviewAxisHelper } from "./preview/axis";
|
|
8
8
|
import { EditorPreviewPlayComponent } from "./preview/play";
|
|
9
|
+
import { EditorPreviewGizmo } from "./preview/gizmo/gizmo";
|
|
9
10
|
import { Stats } from "./preview/stats/stats";
|
|
10
11
|
import { StatsValuesType } from "./preview/stats/types";
|
|
11
12
|
export interface IEditorPreviewProps {
|
|
@@ -26,6 +27,7 @@ export interface IEditorPreviewState {
|
|
|
26
27
|
statsValues?: StatsValuesType;
|
|
27
28
|
playEnabled: boolean;
|
|
28
29
|
playSceneLoadingProgress: number;
|
|
30
|
+
gizmoSnap: IGizmoSnapPreferences;
|
|
29
31
|
activeGizmo: "position" | "rotation" | "scaling" | "none";
|
|
30
32
|
/**
|
|
31
33
|
* Defines the fixed dimensions of the preview canvas.
|
|
@@ -140,6 +142,7 @@ export declare class EditorPreview extends Component<IEditorPreviewProps, IEdito
|
|
|
140
142
|
private _highlightCurrentMeshUnderPointer;
|
|
141
143
|
private _restoreCurrentMeshUnderPointer;
|
|
142
144
|
private _getToolbar;
|
|
145
|
+
updateGizmoSnapPreferences(prefs: IGizmoSnapPreferences): void;
|
|
143
146
|
private _getEditToolbar;
|
|
144
147
|
private _switchToCamera;
|
|
145
148
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Scene, TransformNode, StaticSound } from "babylonjs";
|
|
2
|
+
export declare class SoundNode extends TransformNode {
|
|
3
|
+
/**
|
|
4
|
+
* Defines the reference to the sound associated with this node.
|
|
5
|
+
*/
|
|
6
|
+
sound: StaticSound | null;
|
|
7
|
+
soundRelativePath: string | null;
|
|
8
|
+
private _volume;
|
|
9
|
+
private _spatial;
|
|
10
|
+
private _maxDistance;
|
|
11
|
+
private _distanceModel;
|
|
12
|
+
private _panningModel;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor.
|
|
15
|
+
* @param name defines the name of the scene component.
|
|
16
|
+
* @param scene defines the reference to the scene where to add the scene component.
|
|
17
|
+
*/
|
|
18
|
+
constructor(name: string, scene: Scene);
|
|
19
|
+
setSoundAbsolutePath(absolutePath: string): Promise<void>;
|
|
20
|
+
get volume(): number;
|
|
21
|
+
set volume(value: number);
|
|
22
|
+
get isSpatial(): boolean;
|
|
23
|
+
set isSpatial(value: boolean);
|
|
24
|
+
get maxDistance(): number;
|
|
25
|
+
set maxDistance(value: number);
|
|
26
|
+
get panningModel(): PanningModelType;
|
|
27
|
+
set panningModel(value: PanningModelType);
|
|
28
|
+
get distanceModel(): DistanceModelType;
|
|
29
|
+
set distanceModel(value: DistanceModelType);
|
|
30
|
+
disposeSound(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Releases resources associated with this scene link.
|
|
33
|
+
*/
|
|
34
|
+
dispose(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the current object class name.
|
|
37
|
+
* @return the class name
|
|
38
|
+
*/
|
|
39
|
+
getClassName(): string;
|
|
40
|
+
serialize(): any;
|
|
41
|
+
static Parse(parsedData: any, scene: Scene, rootUrl: string): SoundNode;
|
|
42
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Scene } from "babylonjs";
|
|
2
|
+
import { Editor } from "../../../editor/main";
|
|
3
|
+
import { ISceneLoaderPluginOptions } from "../scene";
|
|
4
|
+
export declare function loadSoundNodes(editor: Editor, soundNodeFiles: string[], scene: Scene, options: ISceneLoaderPluginOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractMesh, AnimationGroup, Camera, Light, TransformNode, IParticleSystem } from "babylonjs";
|
|
2
2
|
import { Editor } from "../../editor/main";
|
|
3
|
+
import { SoundNode } from "../../editor/nodes/sound";
|
|
3
4
|
import { SceneLinkNode } from "../../editor/nodes/scene-link";
|
|
4
5
|
import { SpriteMapNode } from "../../editor/nodes/sprite-map";
|
|
5
6
|
import { SpriteManagerNode } from "../../editor/nodes/sprite-manager";
|
|
@@ -19,6 +20,7 @@ export type SceneLoadResult = {
|
|
|
19
20
|
transformNodes: TransformNode[];
|
|
20
21
|
animationGroups: AnimationGroup[];
|
|
21
22
|
particleSystems: IParticleSystem[];
|
|
23
|
+
soundNodes: SoundNode[];
|
|
22
24
|
spriteMaps: SpriteMapNode[];
|
|
23
25
|
spriteManagers: SpriteManagerNode[];
|
|
24
26
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IGizmoSnapPreferences } from "../tools/scene/gizmo";
|
|
1
2
|
export interface IEditorProject {
|
|
2
3
|
/**
|
|
3
4
|
* The version of the editor that saved this project.
|
|
@@ -23,6 +24,10 @@ export interface IEditorProject {
|
|
|
23
24
|
* The package manager being used by the project.
|
|
24
25
|
*/
|
|
25
26
|
packageManager?: EditorProjectPackageManager;
|
|
27
|
+
/**
|
|
28
|
+
* Gizmo snap preferences (translate / rotate / scale).
|
|
29
|
+
*/
|
|
30
|
+
gizmoSnap?: IGizmoSnapPreferences;
|
|
26
31
|
}
|
|
27
32
|
export interface IEditorProjectPlugin {
|
|
28
33
|
/**
|
|
@@ -31,4 +36,4 @@ export interface IEditorProjectPlugin {
|
|
|
31
36
|
nameOrPath: string;
|
|
32
37
|
}
|
|
33
38
|
export type EditorProjectPackageManager = "npm" | "yarn" | "pnpm" | "bun";
|
|
34
|
-
export type EditorProjectTemplate = "nextjs" | "solidjs" | "vanillajs" | "electron";
|
|
39
|
+
export type EditorProjectTemplate = "nextjs" | "nuxtjs" | "solidjs" | "vanillajs" | "electron";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Sound } from "babylonjs";
|
|
2
|
+
import { SoundNode } from "../../editor/nodes/sound";
|
|
2
3
|
/**
|
|
3
4
|
* Returns wether or not the given object is a Sound.
|
|
4
5
|
* @param object defines the reference to the object to test its class name.
|
|
5
6
|
*/
|
|
6
7
|
export declare function isSound(object: any): object is Sound;
|
|
8
|
+
/**
|
|
9
|
+
* Returns wether or not the given object is a SoundNode.
|
|
10
|
+
* @param object defines the reference to the object to test its class name.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isSoundNode(object: any): object is SoundNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Minimum snap step (two-decimal increments cannot be smaller than 0.01). */
|
|
2
|
+
export declare const gizmoSnapMinStep = 0.01;
|
|
3
|
+
export interface IGizmoSnapPreferences {
|
|
4
|
+
translationEnabled: boolean;
|
|
5
|
+
translationStep: number;
|
|
6
|
+
rotationEnabled: boolean;
|
|
7
|
+
rotationStepDegrees: number;
|
|
8
|
+
scaleEnabled: boolean;
|
|
9
|
+
scaleStep: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Snap steps are stored and applied with at most two decimal places.
|
|
13
|
+
*/
|
|
14
|
+
export declare function roundGizmoSnapSteps(prefs: IGizmoSnapPreferences): IGizmoSnapPreferences;
|
|
15
|
+
export declare const defaultGizmoSnapPreferences: IGizmoSnapPreferences;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { Scene } from "babylonjs";
|
|
1
|
+
import { Scene, ISize } from "babylonjs";
|
|
2
2
|
/**
|
|
3
3
|
* Takes a screenshot of the scene and returns its base64 value.
|
|
4
4
|
* @param scene defines the reference to the scene to take a screenshot.
|
|
5
|
+
* @param size defines the optional size of the screenshot. If not provided, the current canvas size will be used.
|
|
5
6
|
*/
|
|
6
|
-
export declare function getBase64SceneScreenshot(scene: Scene): Promise<string | undefined>;
|
|
7
|
+
export declare function getBase64SceneScreenshot(scene: Scene, size?: ISize): Promise<string | undefined>;
|
|
7
8
|
/**
|
|
8
9
|
* Takes a screenshot of the scene and returns its buffer value.
|
|
9
10
|
* @param scene defines the reference to the scene to take a screenshot.
|
|
11
|
+
* @param size defines the optional size of the screenshot. If not provided, the current canvas size will be used.
|
|
10
12
|
*/
|
|
11
|
-
export declare function getBufferSceneScreenshot(scene: Scene): Promise<Buffer<ArrayBuffer> | null>;
|
|
13
|
+
export declare function getBufferSceneScreenshot(scene: Scene, size?: ISize): Promise<Buffer<ArrayBuffer> | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Takes a screenshot of the scene and asks the user to save the generate PNG file.
|
|
16
|
+
* @param scene defines the reference to the scene to take a screenshot.
|
|
17
|
+
* @param size defines the optional size of the screenshot. If not provided, the current canvas size will be used.
|
|
18
|
+
*/
|
|
19
|
+
export declare function saveSceneScreenshot(scene: Scene, size?: ISize): Promise<void>;
|
package/package.json
CHANGED