babylonjs-loaders 7.37.0 → 7.37.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/babylon.glTF2FileLoader.js +52 -27
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +52 -27
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +44 -18
- package/babylonjs.loaders.js +234 -75
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +90 -36
- package/package.json +3 -3
|
@@ -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 { GLTFLoaderExtensionOptions } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
2098
|
+
const NAME = "KHR_materials_variants";
|
|
2099
|
+
export type MaterialVariantsController = Parameters<Required<GLTFLoaderExtensionOptions[typeof NAME]>["onLoaded"]>[0];
|
|
2097
2100
|
module "babylonjs-loaders/glTF/glTFFileLoader" {
|
|
2098
2101
|
interface GLTFLoaderExtensionOptions {
|
|
2099
2102
|
/**
|
|
2100
2103
|
* Defines options for the KHR_materials_variants extension.
|
|
2101
2104
|
*/
|
|
2102
|
-
["KHR_materials_variants"]: {
|
|
2105
|
+
["KHR_materials_variants"]: Partial<{
|
|
2106
|
+
/**
|
|
2107
|
+
* Defines a callback that will be called if material variants are loaded.
|
|
2108
|
+
* @experimental
|
|
2109
|
+
*/
|
|
2110
|
+
onLoaded: (controller: {
|
|
2111
|
+
/**
|
|
2112
|
+
* The list of available variant names for this asset.
|
|
2113
|
+
*/
|
|
2114
|
+
readonly variants: readonly string[];
|
|
2115
|
+
/**
|
|
2116
|
+
* Gets or sets the selected variant.
|
|
2117
|
+
*/
|
|
2118
|
+
selectedVariant: string;
|
|
2119
|
+
}) => void;
|
|
2120
|
+
}>;
|
|
2103
2121
|
}
|
|
2104
2122
|
}
|
|
2105
2123
|
/**
|
|
@@ -2124,58 +2142,61 @@ 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
|
|
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(
|
|
2148
|
+
static GetAvailableVariants(rootNode: TransformNode): string[];
|
|
2131
2149
|
/**
|
|
2132
2150
|
* Gets the list of available variant names for this asset.
|
|
2133
|
-
* @param
|
|
2151
|
+
* @param rootNode The glTF root node
|
|
2134
2152
|
* @returns the list of all the variant names for this model
|
|
2135
2153
|
*/
|
|
2136
|
-
getAvailableVariants(
|
|
2154
|
+
getAvailableVariants(rootNode: TransformNode): string[];
|
|
2137
2155
|
/**
|
|
2138
2156
|
* Select a variant given a variant name or a list of variant names.
|
|
2139
|
-
* @param
|
|
2157
|
+
* @param rootNode The glTF root node
|
|
2140
2158
|
* @param variantName The variant name(s) to select.
|
|
2141
2159
|
*/
|
|
2142
|
-
static SelectVariant(
|
|
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
|
|
2163
|
+
* @param rootNode The glTF root node
|
|
2146
2164
|
* @param variantName The variant name(s) to select.
|
|
2147
2165
|
*/
|
|
2148
|
-
selectVariant(
|
|
2166
|
+
selectVariant(rootNode: TransformNode, variantName: string | string[]): void;
|
|
2149
2167
|
/**
|
|
2150
2168
|
* Reset back to the original before selecting a variant.
|
|
2151
|
-
* @param
|
|
2169
|
+
* @param rootNode The glTF root node
|
|
2152
2170
|
*/
|
|
2153
|
-
static Reset(
|
|
2171
|
+
static Reset(rootNode: TransformNode): void;
|
|
2154
2172
|
/**
|
|
2155
2173
|
* Reset back to the original before selecting a variant.
|
|
2156
|
-
* @param
|
|
2174
|
+
* @param rootNode The glTF root node
|
|
2157
2175
|
*/
|
|
2158
|
-
reset(
|
|
2176
|
+
reset(rootNode: TransformNode): void;
|
|
2159
2177
|
/**
|
|
2160
2178
|
* Gets the last selected variant name(s) or null if original.
|
|
2161
|
-
* @param
|
|
2179
|
+
* @param rootNode The glTF root node
|
|
2162
2180
|
* @returns The selected variant name(s).
|
|
2163
2181
|
*/
|
|
2164
|
-
static GetLastSelectedVariant(
|
|
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
|
|
2185
|
+
* @param rootNode The glTF root node
|
|
2168
2186
|
* @returns The selected variant name(s).
|
|
2169
2187
|
*/
|
|
2170
|
-
getLastSelectedVariant(
|
|
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
|
*/
|
|
2177
2197
|
_loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
|
|
2178
2198
|
}
|
|
2199
|
+
export {};
|
|
2179
2200
|
|
|
2180
2201
|
}
|
|
2181
2202
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_unlit" {
|
|
@@ -4254,6 +4275,9 @@ export const SPLATFileLoaderMetadata: {
|
|
|
4254
4275
|
readonly ".ply": {
|
|
4255
4276
|
readonly isBinary: true;
|
|
4256
4277
|
};
|
|
4278
|
+
readonly ".spz": {
|
|
4279
|
+
readonly isBinary: true;
|
|
4280
|
+
};
|
|
4257
4281
|
};
|
|
4258
4282
|
};
|
|
4259
4283
|
|
|
@@ -4295,6 +4319,9 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
|
|
|
4295
4319
|
readonly ".ply": {
|
|
4296
4320
|
readonly isBinary: true;
|
|
4297
4321
|
};
|
|
4322
|
+
readonly ".spz": {
|
|
4323
|
+
readonly isBinary: true;
|
|
4324
|
+
};
|
|
4298
4325
|
};
|
|
4299
4326
|
/**
|
|
4300
4327
|
* Creates loader for gaussian splatting files
|
|
@@ -4317,6 +4344,7 @@ export class SPLATFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlu
|
|
|
4317
4344
|
importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
4318
4345
|
private static _BuildPointCloud;
|
|
4319
4346
|
private static _BuildMesh;
|
|
4347
|
+
private _parseSPZ;
|
|
4320
4348
|
private _parse;
|
|
4321
4349
|
/**
|
|
4322
4350
|
* Load into an asset container.
|
|
@@ -6841,7 +6869,9 @@ declare module BABYLON {
|
|
|
6841
6869
|
|
|
6842
6870
|
}
|
|
6843
6871
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
6844
|
-
|
|
6872
|
+
const NAME = "KHR_materials_variants";
|
|
6873
|
+
export type MaterialVariantsController = Parameters<Required<GLTFLoaderExtensionOptions[typeof NAME]>["onLoaded"]>[0];
|
|
6874
|
+
/**
|
|
6845
6875
|
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_variants/README.md)
|
|
6846
6876
|
*/
|
|
6847
6877
|
export class KHR_materials_variants implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
@@ -6863,53 +6893,55 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
6863
6893
|
dispose(): void;
|
|
6864
6894
|
/**
|
|
6865
6895
|
* Gets the list of available variant names for this asset.
|
|
6866
|
-
* @param
|
|
6896
|
+
* @param rootNode The glTF root node
|
|
6867
6897
|
* @returns the list of all the variant names for this model
|
|
6868
6898
|
*/
|
|
6869
|
-
static GetAvailableVariants(
|
|
6899
|
+
static GetAvailableVariants(rootNode: TransformNode): string[];
|
|
6870
6900
|
/**
|
|
6871
6901
|
* Gets the list of available variant names for this asset.
|
|
6872
|
-
* @param
|
|
6902
|
+
* @param rootNode The glTF root node
|
|
6873
6903
|
* @returns the list of all the variant names for this model
|
|
6874
6904
|
*/
|
|
6875
|
-
getAvailableVariants(
|
|
6905
|
+
getAvailableVariants(rootNode: TransformNode): string[];
|
|
6876
6906
|
/**
|
|
6877
6907
|
* Select a variant given a variant name or a list of variant names.
|
|
6878
|
-
* @param
|
|
6908
|
+
* @param rootNode The glTF root node
|
|
6879
6909
|
* @param variantName The variant name(s) to select.
|
|
6880
6910
|
*/
|
|
6881
|
-
static SelectVariant(
|
|
6911
|
+
static SelectVariant(rootNode: TransformNode, variantName: string | string[]): void;
|
|
6882
6912
|
/**
|
|
6883
6913
|
* Select a variant given a variant name or a list of variant names.
|
|
6884
|
-
* @param
|
|
6914
|
+
* @param rootNode The glTF root node
|
|
6885
6915
|
* @param variantName The variant name(s) to select.
|
|
6886
6916
|
*/
|
|
6887
|
-
selectVariant(
|
|
6917
|
+
selectVariant(rootNode: TransformNode, variantName: string | string[]): void;
|
|
6888
6918
|
/**
|
|
6889
6919
|
* Reset back to the original before selecting a variant.
|
|
6890
|
-
* @param
|
|
6920
|
+
* @param rootNode The glTF root node
|
|
6891
6921
|
*/
|
|
6892
|
-
static Reset(
|
|
6922
|
+
static Reset(rootNode: TransformNode): void;
|
|
6893
6923
|
/**
|
|
6894
6924
|
* Reset back to the original before selecting a variant.
|
|
6895
|
-
* @param
|
|
6925
|
+
* @param rootNode The glTF root node
|
|
6896
6926
|
*/
|
|
6897
|
-
reset(
|
|
6927
|
+
reset(rootNode: TransformNode): void;
|
|
6898
6928
|
/**
|
|
6899
6929
|
* Gets the last selected variant name(s) or null if original.
|
|
6900
|
-
* @param
|
|
6930
|
+
* @param rootNode The glTF root node
|
|
6901
6931
|
* @returns The selected variant name(s).
|
|
6902
6932
|
*/
|
|
6903
|
-
static GetLastSelectedVariant(
|
|
6933
|
+
static GetLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
|
|
6904
6934
|
/**
|
|
6905
6935
|
* Gets the last selected variant name(s) or null if original.
|
|
6906
|
-
* @param
|
|
6936
|
+
* @param rootNode The glTF root node
|
|
6907
6937
|
* @returns The selected variant name(s).
|
|
6908
6938
|
*/
|
|
6909
|
-
getLastSelectedVariant(
|
|
6939
|
+
getLastSelectedVariant(rootNode: TransformNode): Nullable<string | string[]>;
|
|
6910
6940
|
private static _GetExtensionMetadata;
|
|
6911
6941
|
/** @internal */
|
|
6912
6942
|
onLoading(): void;
|
|
6943
|
+
/** @internal */
|
|
6944
|
+
onReady(): void;
|
|
6913
6945
|
/**
|
|
6914
6946
|
* @internal
|
|
6915
6947
|
*/
|
|
@@ -6924,7 +6956,22 @@ declare module BABYLON {
|
|
|
6924
6956
|
/**
|
|
6925
6957
|
* Defines options for the KHR_materials_variants extension.
|
|
6926
6958
|
*/
|
|
6927
|
-
["KHR_materials_variants"]: {
|
|
6959
|
+
["KHR_materials_variants"]: Partial<{
|
|
6960
|
+
/**
|
|
6961
|
+
* Defines a callback that will be called if material variants are loaded.
|
|
6962
|
+
* @experimental
|
|
6963
|
+
*/
|
|
6964
|
+
onLoaded: (controller: {
|
|
6965
|
+
/**
|
|
6966
|
+
* The list of available variant names for this asset.
|
|
6967
|
+
*/
|
|
6968
|
+
readonly variants: readonly string[];
|
|
6969
|
+
/**
|
|
6970
|
+
* Gets or sets the selected variant.
|
|
6971
|
+
*/
|
|
6972
|
+
selectedVariant: string;
|
|
6973
|
+
}) => void;
|
|
6974
|
+
}>;
|
|
6928
6975
|
}
|
|
6929
6976
|
|
|
6930
6977
|
}
|
|
@@ -8943,6 +8990,9 @@ declare module BABYLON {
|
|
|
8943
8990
|
readonly ".ply": {
|
|
8944
8991
|
readonly isBinary: true;
|
|
8945
8992
|
};
|
|
8993
|
+
readonly ".spz": {
|
|
8994
|
+
readonly isBinary: true;
|
|
8995
|
+
};
|
|
8946
8996
|
};
|
|
8947
8997
|
};
|
|
8948
8998
|
|
|
@@ -8976,6 +9026,9 @@ declare module BABYLON {
|
|
|
8976
9026
|
readonly ".ply": {
|
|
8977
9027
|
readonly isBinary: true;
|
|
8978
9028
|
};
|
|
9029
|
+
readonly ".spz": {
|
|
9030
|
+
readonly isBinary: true;
|
|
9031
|
+
};
|
|
8979
9032
|
};
|
|
8980
9033
|
/**
|
|
8981
9034
|
* Creates loader for gaussian splatting files
|
|
@@ -8998,6 +9051,7 @@ declare module BABYLON {
|
|
|
8998
9051
|
importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
8999
9052
|
private static _BuildPointCloud;
|
|
9000
9053
|
private static _BuildMesh;
|
|
9054
|
+
private _parseSPZ;
|
|
9001
9055
|
private _parse;
|
|
9002
9056
|
/**
|
|
9003
9057
|
* Load into an asset container.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-loaders",
|
|
3
|
-
"version": "7.37.
|
|
3
|
+
"version": "7.37.1",
|
|
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.
|
|
19
|
-
"babylonjs-gltf2interface": "^7.37.
|
|
18
|
+
"babylonjs": "^7.37.1",
|
|
19
|
+
"babylonjs-gltf2interface": "^7.37.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@dev/build-tools": "1.0.0",
|