babylonjs-loaders 7.37.0 → 7.37.2

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.
@@ -2091,15 +2091,33 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants" {
2091
2091
  import { Nullable } from "babylonjs/types";
2092
2092
  import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
2093
2093
  import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
2094
- import { Mesh } from "babylonjs/Meshes/mesh";
2095
2094
  import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
2096
2095
  import { INode, IMeshPrimitive, IMesh } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
2096
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
2097
+ import { MaterialVariantsController } from "babylonjs-loaders/glTF/glTFFileLoader";
2098
+ export { MaterialVariantsController };
2097
2099
  module "babylonjs-loaders/glTF/glTFFileLoader" {
2100
+ type MaterialVariantsController = {
2101
+ /**
2102
+ * The list of available variant names for this asset.
2103
+ */
2104
+ readonly variants: readonly string[];
2105
+ /**
2106
+ * Gets or sets the selected variant.
2107
+ */
2108
+ selectedVariant: string;
2109
+ };
2098
2110
  interface GLTFLoaderExtensionOptions {
2099
2111
  /**
2100
2112
  * Defines options for the KHR_materials_variants extension.
2101
2113
  */
2102
- ["KHR_materials_variants"]: {};
2114
+ ["KHR_materials_variants"]: Partial<{
2115
+ /**
2116
+ * Defines a callback that will be called if material variants are loaded.
2117
+ * @experimental
2118
+ */
2119
+ onLoaded: (controller: MaterialVariantsController) => void;
2120
+ }>;
2103
2121
  }
2104
2122
  }
2105
2123
  /**
@@ -2124,53 +2142,55 @@ export class KHR_materials_variants implements IGLTFLoaderExtension {
2124
2142
  dispose(): void;
2125
2143
  /**
2126
2144
  * Gets the list of available variant names for this asset.
2127
- * @param rootMesh The glTF root mesh
2145
+ * @param rootNode The glTF root node
2128
2146
  * @returns the list of all the variant names for this model
2129
2147
  */
2130
- static GetAvailableVariants(rootMesh: Mesh): string[];
2148
+ static GetAvailableVariants(rootNode: TransformNode): string[];
2131
2149
  /**
2132
2150
  * Gets the list of available variant names for this asset.
2133
- * @param rootMesh The glTF root mesh
2151
+ * @param rootNode The glTF root node
2134
2152
  * @returns the list of all the variant names for this model
2135
2153
  */
2136
- getAvailableVariants(rootMesh: Mesh): string[];
2154
+ getAvailableVariants(rootNode: TransformNode): string[];
2137
2155
  /**
2138
2156
  * Select a variant given a variant name or a list of variant names.
2139
- * @param rootMesh The glTF root mesh
2157
+ * @param rootNode The glTF root node
2140
2158
  * @param variantName The variant name(s) to select.
2141
2159
  */
2142
- static SelectVariant(rootMesh: Mesh, variantName: string | string[]): void;
2160
+ static SelectVariant(rootNode: TransformNode, variantName: string | string[]): void;
2143
2161
  /**
2144
2162
  * Select a variant given a variant name or a list of variant names.
2145
- * @param rootMesh The glTF root mesh
2163
+ * @param rootNode The glTF root node
2146
2164
  * @param variantName The variant name(s) to select.
2147
2165
  */
2148
- selectVariant(rootMesh: Mesh, variantName: string | string[]): void;
2166
+ selectVariant(rootNode: TransformNode, variantName: string | string[]): void;
2149
2167
  /**
2150
2168
  * Reset back to the original before selecting a variant.
2151
- * @param rootMesh The glTF root mesh
2169
+ * @param rootNode The glTF root node
2152
2170
  */
2153
- static Reset(rootMesh: Mesh): void;
2171
+ static Reset(rootNode: TransformNode): void;
2154
2172
  /**
2155
2173
  * Reset back to the original before selecting a variant.
2156
- * @param rootMesh The glTF root mesh
2174
+ * @param rootNode The glTF root node
2157
2175
  */
2158
- reset(rootMesh: Mesh): void;
2176
+ reset(rootNode: TransformNode): void;
2159
2177
  /**
2160
2178
  * Gets the last selected variant name(s) or null if original.
2161
- * @param rootMesh The glTF root mesh
2179
+ * @param rootNode The glTF root node
2162
2180
  * @returns The selected variant name(s).
2163
2181
  */
2164
- static GetLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
2182
+ static GetLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
2165
2183
  /**
2166
2184
  * Gets the last selected variant name(s) or null if original.
2167
- * @param rootMesh The glTF root mesh
2185
+ * @param rootNode The glTF root node
2168
2186
  * @returns The selected variant name(s).
2169
2187
  */
2170
- getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
2188
+ getLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
2171
2189
  private static _GetExtensionMetadata;
2172
2190
  /** @internal */
2173
2191
  onLoading(): void;
2192
+ /** @internal */
2193
+ onReady(): void;
2174
2194
  /**
2175
2195
  * @internal
2176
2196
  */
@@ -4254,6 +4274,9 @@ export const SPLATFileLoaderMetadata: {
4254
4274
  readonly ".ply": {
4255
4275
  readonly isBinary: true;
4256
4276
  };
4277
+ readonly ".spz": {
4278
+ readonly isBinary: true;
4279
+ };
4257
4280
  };
4258
4281
  };
4259
4282
 
@@ -4295,6 +4318,9 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
4295
4318
  readonly ".ply": {
4296
4319
  readonly isBinary: true;
4297
4320
  };
4321
+ readonly ".spz": {
4322
+ readonly isBinary: true;
4323
+ };
4298
4324
  };
4299
4325
  /**
4300
4326
  * Creates loader for gaussian splatting files
@@ -4317,6 +4343,7 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
4317
4343
  importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
4318
4344
  private static _BuildPointCloud;
4319
4345
  private static _BuildMesh;
4346
+ private _parseSPZ;
4320
4347
  private _parse;
4321
4348
  /**
4322
4349
  * Load into an asset container.
@@ -6863,53 +6890,55 @@ declare module BABYLON.GLTF2.Loader.Extensions {
6863
6890
  dispose(): void;
6864
6891
  /**
6865
6892
  * Gets the list of available variant names for this asset.
6866
- * @param rootMesh The glTF root mesh
6893
+ * @param rootNode The glTF root node
6867
6894
  * @returns the list of all the variant names for this model
6868
6895
  */
6869
- static GetAvailableVariants(rootMesh: Mesh): string[];
6896
+ static GetAvailableVariants(rootNode: TransformNode): string[];
6870
6897
  /**
6871
6898
  * Gets the list of available variant names for this asset.
6872
- * @param rootMesh The glTF root mesh
6899
+ * @param rootNode The glTF root node
6873
6900
  * @returns the list of all the variant names for this model
6874
6901
  */
6875
- getAvailableVariants(rootMesh: Mesh): string[];
6902
+ getAvailableVariants(rootNode: TransformNode): string[];
6876
6903
  /**
6877
6904
  * Select a variant given a variant name or a list of variant names.
6878
- * @param rootMesh The glTF root mesh
6905
+ * @param rootNode The glTF root node
6879
6906
  * @param variantName The variant name(s) to select.
6880
6907
  */
6881
- static SelectVariant(rootMesh: Mesh, variantName: string | string[]): void;
6908
+ static SelectVariant(rootNode: TransformNode, variantName: string | string[]): void;
6882
6909
  /**
6883
6910
  * Select a variant given a variant name or a list of variant names.
6884
- * @param rootMesh The glTF root mesh
6911
+ * @param rootNode The glTF root node
6885
6912
  * @param variantName The variant name(s) to select.
6886
6913
  */
6887
- selectVariant(rootMesh: Mesh, variantName: string | string[]): void;
6914
+ selectVariant(rootNode: TransformNode, variantName: string | string[]): void;
6888
6915
  /**
6889
6916
  * Reset back to the original before selecting a variant.
6890
- * @param rootMesh The glTF root mesh
6917
+ * @param rootNode The glTF root node
6891
6918
  */
6892
- static Reset(rootMesh: Mesh): void;
6919
+ static Reset(rootNode: TransformNode): void;
6893
6920
  /**
6894
6921
  * Reset back to the original before selecting a variant.
6895
- * @param rootMesh The glTF root mesh
6922
+ * @param rootNode The glTF root node
6896
6923
  */
6897
- reset(rootMesh: Mesh): void;
6924
+ reset(rootNode: TransformNode): void;
6898
6925
  /**
6899
6926
  * Gets the last selected variant name(s) or null if original.
6900
- * @param rootMesh The glTF root mesh
6927
+ * @param rootNode The glTF root node
6901
6928
  * @returns The selected variant name(s).
6902
6929
  */
6903
- static GetLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
6930
+ static GetLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
6904
6931
  /**
6905
6932
  * Gets the last selected variant name(s) or null if original.
6906
- * @param rootMesh The glTF root mesh
6933
+ * @param rootNode The glTF root node
6907
6934
  * @returns The selected variant name(s).
6908
6935
  */
6909
- getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
6936
+ getLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
6910
6937
  private static _GetExtensionMetadata;
6911
6938
  /** @internal */
6912
6939
  onLoading(): void;
6940
+ /** @internal */
6941
+ onReady(): void;
6913
6942
  /**
6914
6943
  * @internal
6915
6944
  */
@@ -6920,11 +6949,27 @@ declare module BABYLON.GLTF2.Loader.Extensions {
6920
6949
 
6921
6950
  }
6922
6951
  declare module BABYLON {
6952
+ type MaterialVariantsController = {
6953
+ /**
6954
+ * The list of available variant names for this asset.
6955
+ */
6956
+ readonly variants: readonly string[];
6957
+ /**
6958
+ * Gets or sets the selected variant.
6959
+ */
6960
+ selectedVariant: string;
6961
+ };
6923
6962
  interface GLTFLoaderExtensionOptions {
6924
6963
  /**
6925
6964
  * Defines options for the KHR_materials_variants extension.
6926
6965
  */
6927
- ["KHR_materials_variants"]: {};
6966
+ ["KHR_materials_variants"]: Partial<{
6967
+ /**
6968
+ * Defines a callback that will be called if material variants are loaded.
6969
+ * @experimental
6970
+ */
6971
+ onLoaded: (controller: MaterialVariantsController) => void;
6972
+ }>;
6928
6973
  }
6929
6974
 
6930
6975
  }
@@ -8943,6 +8988,9 @@ declare module BABYLON {
8943
8988
  readonly ".ply": {
8944
8989
  readonly isBinary: true;
8945
8990
  };
8991
+ readonly ".spz": {
8992
+ readonly isBinary: true;
8993
+ };
8946
8994
  };
8947
8995
  };
8948
8996
 
@@ -8976,6 +9024,9 @@ declare module BABYLON {
8976
9024
  readonly ".ply": {
8977
9025
  readonly isBinary: true;
8978
9026
  };
9027
+ readonly ".spz": {
9028
+ readonly isBinary: true;
9029
+ };
8979
9030
  };
8980
9031
  /**
8981
9032
  * Creates loader for gaussian splatting files
@@ -8998,6 +9049,7 @@ declare module BABYLON {
8998
9049
  importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
8999
9050
  private static _BuildPointCloud;
9000
9051
  private static _BuildMesh;
9052
+ private _parseSPZ;
9001
9053
  private _parse;
9002
9054
  /**
9003
9055
  * Load into an asset container.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-loaders",
3
- "version": "7.37.0",
3
+ "version": "7.37.2",
4
4
  "main": "babylonjs.loaders.js",
5
5
  "types": "babylonjs.loaders.module.d.ts",
6
6
  "files": [
@@ -15,8 +15,8 @@
15
15
  "test:escheck": "es-check es6 ./babylonjs.loaders.js"
16
16
  },
17
17
  "dependencies": {
18
- "babylonjs": "^7.37.0",
19
- "babylonjs-gltf2interface": "^7.37.0"
18
+ "babylonjs": "^7.37.2",
19
+ "babylonjs-gltf2interface": "^7.37.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",