babylonjs-editor 4.1.0 → 4.1.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 (2) hide show
  1. package/index.d.ts +69 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -57,6 +57,7 @@ declare module 'babylonjs-editor' {
57
57
  export { Dialog, IDialogProps } from "babylonjs-editor/renderer/editor/gui/dialog";
58
58
  export { Confirm, IConfirmProps } from "babylonjs-editor/renderer/editor/gui/confirm";
59
59
  export { Icon } from "babylonjs-editor/renderer/editor/gui/icon";
60
+ export { SceneImporterTools, ISceneImporterToolsConfiguration } from "babylonjs-editor/renderer/editor/scene/import-tools";
60
61
  export { Packer, IPackerOptions, PackerStatus } from "babylonjs-editor/renderer/editor/project/packer/packer";
61
62
  import "./renderer/editor/gui/augmentations/index";
62
63
  }
@@ -1384,6 +1385,18 @@ declare module 'babylonjs-editor/renderer/editor/assets/materials' {
1384
1385
  * @param event the original mouse event.
1385
1386
  */
1386
1387
  onContextMenu(item: IAssetComponentItem, e: React.MouseEvent<HTMLImageElement, MouseEvent>): void;
1388
+ /**
1389
+ * Called on the user starts dragging the item.
1390
+ * @param ev defines the reference to the drag event.
1391
+ */
1392
+ onDragStart(ev: React.DragEvent<HTMLImageElement>, item: IAssetComponentItem): void;
1393
+ /**
1394
+ * Called on the user drops the asset in a supported inspector field.
1395
+ * @param ev defiens the reference to the event object.
1396
+ * @param object defines the reference to the object being modified in the inspector.
1397
+ * @param property defines the property of the object to assign the asset instance.
1398
+ */
1399
+ onDropInInspector(ev: React.DragEvent<HTMLElement>, object: any, property: string): Promise<void>;
1387
1400
  /**
1388
1401
  * Called on the user drops an asset in editor. (typically the preview canvas).
1389
1402
  * @param item the item being dropped.
@@ -3837,6 +3850,62 @@ declare module 'babylonjs-editor/renderer/editor/gui/icon' {
3837
3850
  }
3838
3851
  }
3839
3852
 
3853
+ declare module 'babylonjs-editor/renderer/editor/scene/import-tools' {
3854
+ import { Nullable } from "babylonjs-editor/shared/types";
3855
+ import { IParticleSystem, ISceneLoaderAsyncResult, Material, Node, Scene, Skeleton, TransformNode } from "babylonjs";
3856
+ import { Editor } from "babylonjs-editor/renderer/editor/editor";
3857
+ export interface ISceneImporterToolsConfiguration {
3858
+ /**
3859
+ * Defines the reference to the editor.
3860
+ */
3861
+ editor: Editor;
3862
+ /**
3863
+ * Defines wether or not the scene to configure its nodes are coming from a GLTF file.
3864
+ */
3865
+ isGltf: boolean;
3866
+ /**
3867
+ * Defines the relative path (from workspace) to the scene's file.
3868
+ */
3869
+ relativePath: string;
3870
+ /**
3871
+ * Defines the absolute path to the scene's file.
3872
+ */
3873
+ absolutePath: string;
3874
+ /**
3875
+ * Defines the result of the scene loader containing the meshes, skeletons etc.
3876
+ */
3877
+ result: ISceneLoaderAsyncResult;
3878
+ }
3879
+ export class SceneImporterTools {
3880
+ /**
3881
+ * Configures the given scene loader result contained in the given scene (id, material files etc.).
3882
+ * @param scene defines the reference to the scene containing the elements to configure.
3883
+ * @param configuration defines the configuration containing the information for the elements to configure.
3884
+ */
3885
+ static Configure(scene: Scene, configuration: ISceneImporterToolsConfiguration): Promise<Node>;
3886
+ /**
3887
+ * Configures the given imported particle systems.
3888
+ */
3889
+ static ConfigureParticleSystems(particleSystems: IParticleSystem[]): void;
3890
+ /**
3891
+ * Configures the given imported skeletons.
3892
+ */
3893
+ static ConfigureSkeletons(skeletons: Skeleton[], scene: Scene): void;
3894
+ /**
3895
+ * Configures the given imported transform nodes.
3896
+ */
3897
+ static ConfigureTransformNodes(transformNodes: TransformNode[], parent: Nullable<TransformNode>): void;
3898
+ /**
3899
+ * Configures the given imported transform nodes.
3900
+ */
3901
+ static ConfigureMeshes(configuration: ISceneImporterToolsConfiguration, parent: TransformNode): Promise<void>;
3902
+ /**
3903
+ * Configures the given imported material.
3904
+ */
3905
+ static ConfigureMaterial(material: Material, configuration: ISceneImporterToolsConfiguration, force?: boolean): Promise<Material>;
3906
+ }
3907
+ }
3908
+
3840
3909
  declare module 'babylonjs-editor/renderer/editor/project/packer/packer' {
3841
3910
  import { DirectoryTree } from "directory-tree";
3842
3911
  import { Nullable } from "babylonjs-editor/shared/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-editor",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Babylon.js Editor is a Web Application helping artists to work with Babylon.js",
5
5
  "productName": "Babylon.js Editor",
6
6
  "typings": "index.d.ts",