babylonjs-loaders 9.23.0 → 9.26.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.
- package/babylon.glTF1FileLoader.js +1 -1
- package/babylon.glTF1FileLoader.js.map +1 -1
- package/babylon.glTF1FileLoader.min.js +1 -1
- package/babylon.glTF1FileLoader.min.js.map +1 -1
- package/babylon.glTF2FileLoader.js +1 -1
- package/babylon.glTF2FileLoader.js.map +1 -1
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +1 -1
- package/babylon.glTFFileLoader.js.map +1 -1
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +509 -4
- package/babylonjs.loaders.es5.js +4330 -3703
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.js.map +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +1049 -25
- package/package.json +3 -3
package/babylonjs.loaders.d.ts
CHANGED
|
@@ -357,11 +357,13 @@ declare namespace BABYLON {
|
|
|
357
357
|
*/
|
|
358
358
|
abstract onValidated?: (results: GLTF2.IGLTFValidationResults) => void;
|
|
359
359
|
/**
|
|
360
|
-
* Function called before loading a
|
|
361
|
-
*
|
|
362
|
-
* @
|
|
360
|
+
* Function called before loading a URL referenced by the asset.
|
|
361
|
+
* Setting this function allows parent-relative asset URIs and makes the callback responsible for URI safety.
|
|
362
|
+
* @param url The URL referenced by the asset
|
|
363
|
+
* @param rootUrl The root URL of the asset, if available
|
|
364
|
+
* @returns A promise that resolves to the URL to load
|
|
363
365
|
*/
|
|
364
|
-
preprocessUrlAsync: (url: string) => Promise<string>;
|
|
366
|
+
preprocessUrlAsync: (url: string, rootUrl?: string) => Promise<string>;
|
|
365
367
|
}
|
|
366
368
|
/**
|
|
367
369
|
* File loader for loading glTF files into a scene.
|
|
@@ -376,6 +378,8 @@ declare namespace BABYLON {
|
|
|
376
378
|
* @param options The options for the loader
|
|
377
379
|
*/
|
|
378
380
|
constructor(options?: Partial<Readonly<GLTFLoaderOptions>>);
|
|
381
|
+
/** @internal */
|
|
382
|
+
get _isPreprocessUrlAsyncSet(): boolean;
|
|
379
383
|
/**
|
|
380
384
|
* Raised when the asset has been parsed
|
|
381
385
|
*/
|
|
@@ -6899,6 +6903,20 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
6899
6903
|
|
|
6900
6904
|
|
|
6901
6905
|
|
|
6906
|
+
}
|
|
6907
|
+
declare namespace BABYLON {
|
|
6908
|
+
|
|
6909
|
+
|
|
6910
|
+
}
|
|
6911
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
6912
|
+
/**
|
|
6913
|
+
* Registers the KHR_animation_pointer interpolation mappings.
|
|
6914
|
+
* @internal
|
|
6915
|
+
*/
|
|
6916
|
+
export function _RegisterKHRAnimationPointerData(): void;
|
|
6917
|
+
|
|
6918
|
+
|
|
6919
|
+
|
|
6902
6920
|
}
|
|
6903
6921
|
declare namespace BABYLON {
|
|
6904
6922
|
|
|
@@ -8146,6 +8164,24 @@ declare namespace BABYLON.GLTF1 {
|
|
|
8146
8164
|
loadMaterialAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
|
8147
8165
|
private _loadTexture;
|
|
8148
8166
|
}
|
|
8167
|
+
/**
|
|
8168
|
+
* Registers the KHR_materials_common extension.
|
|
8169
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8170
|
+
*/
|
|
8171
|
+
export function RegisterGLTFMaterialsCommonExtension(): void;
|
|
8172
|
+
|
|
8173
|
+
|
|
8174
|
+
|
|
8175
|
+
}
|
|
8176
|
+
declare namespace BABYLON {
|
|
8177
|
+
|
|
8178
|
+
|
|
8179
|
+
}
|
|
8180
|
+
declare namespace BABYLON.GLTF1 {
|
|
8181
|
+
/**
|
|
8182
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8183
|
+
* Import "./glTFMaterialsCommonExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
8184
|
+
*/
|
|
8149
8185
|
|
|
8150
8186
|
|
|
8151
8187
|
|
|
@@ -8779,6 +8815,24 @@ declare namespace BABYLON.GLTF1 {
|
|
|
8779
8815
|
private static _CreateTextureAsync;
|
|
8780
8816
|
private static _ApplyExtensions;
|
|
8781
8817
|
}
|
|
8818
|
+
/**
|
|
8819
|
+
* Registers the glTF 1.0 loader factory.
|
|
8820
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8821
|
+
*/
|
|
8822
|
+
export function RegisterGLTF1Loader(): void;
|
|
8823
|
+
|
|
8824
|
+
|
|
8825
|
+
|
|
8826
|
+
}
|
|
8827
|
+
declare namespace BABYLON {
|
|
8828
|
+
|
|
8829
|
+
|
|
8830
|
+
}
|
|
8831
|
+
declare namespace BABYLON.GLTF1 {
|
|
8832
|
+
/**
|
|
8833
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8834
|
+
* Import "./glTFLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
8835
|
+
*/
|
|
8782
8836
|
|
|
8783
8837
|
|
|
8784
8838
|
|
|
@@ -8800,12 +8854,432 @@ declare namespace BABYLON.GLTF1 {
|
|
|
8800
8854
|
loadTextureBufferAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void): boolean;
|
|
8801
8855
|
loadShaderStringAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void): boolean;
|
|
8802
8856
|
}
|
|
8857
|
+
/**
|
|
8858
|
+
* Registers the KHR_binary_glTF extension.
|
|
8859
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8860
|
+
*/
|
|
8861
|
+
export function RegisterGLTFBinaryExtension(): void;
|
|
8803
8862
|
|
|
8804
8863
|
|
|
8805
8864
|
|
|
8806
8865
|
}
|
|
8807
8866
|
declare namespace BABYLON {
|
|
8808
8867
|
|
|
8868
|
+
|
|
8869
|
+
}
|
|
8870
|
+
declare namespace BABYLON.GLTF1 {
|
|
8871
|
+
/**
|
|
8872
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8873
|
+
* Import "./glTFBinaryExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
8874
|
+
*/
|
|
8875
|
+
|
|
8876
|
+
|
|
8877
|
+
|
|
8878
|
+
}
|
|
8879
|
+
declare namespace BABYLON {
|
|
8880
|
+
|
|
8881
|
+
export interface WorkerAsset {
|
|
8882
|
+
bytes: Uint8Array;
|
|
8883
|
+
fileName: string;
|
|
8884
|
+
files?: Record<string, Uint8Array>;
|
|
8885
|
+
resolveByFileName: boolean;
|
|
8886
|
+
glueUrl?: string;
|
|
8887
|
+
wasmUrl?: string;
|
|
8888
|
+
dataUrl?: string;
|
|
8889
|
+
}
|
|
8890
|
+
export interface ExtractRequest {
|
|
8891
|
+
type: "extract";
|
|
8892
|
+
requestId: number;
|
|
8893
|
+
asset: WorkerAsset;
|
|
8894
|
+
}
|
|
8895
|
+
export interface WorkerTimings {
|
|
8896
|
+
totalMs: number;
|
|
8897
|
+
stageOpenMs: number;
|
|
8898
|
+
stageReadMs: number;
|
|
8899
|
+
preparationMs: number;
|
|
8900
|
+
packingMs: number;
|
|
8901
|
+
heapCopyMs: number;
|
|
8902
|
+
}
|
|
8903
|
+
export interface WorkerStatistics {
|
|
8904
|
+
nodes: number;
|
|
8905
|
+
meshes: number;
|
|
8906
|
+
analyticPrimitives: number;
|
|
8907
|
+
instances: number;
|
|
8908
|
+
materials: number;
|
|
8909
|
+
vertices: number;
|
|
8910
|
+
triangles: number;
|
|
8911
|
+
commandBytes: number;
|
|
8912
|
+
dataBytes: number;
|
|
8913
|
+
}
|
|
8914
|
+
export type WorkerResponse = {
|
|
8915
|
+
type: "progress";
|
|
8916
|
+
requestId: number;
|
|
8917
|
+
progress: USDLoadProgress;
|
|
8918
|
+
} | {
|
|
8919
|
+
type: "log";
|
|
8920
|
+
requestId: number;
|
|
8921
|
+
level: number;
|
|
8922
|
+
message: string;
|
|
8923
|
+
} | {
|
|
8924
|
+
type: "result";
|
|
8925
|
+
requestId: number;
|
|
8926
|
+
commands: ArrayBuffer;
|
|
8927
|
+
data: ArrayBuffer;
|
|
8928
|
+
timings: WorkerTimings;
|
|
8929
|
+
statistics: WorkerStatistics;
|
|
8930
|
+
missingAssets: string[];
|
|
8931
|
+
} | {
|
|
8932
|
+
type: "error";
|
|
8933
|
+
requestId: number;
|
|
8934
|
+
message: string;
|
|
8935
|
+
stack?: string;
|
|
8936
|
+
};
|
|
8937
|
+
|
|
8938
|
+
|
|
8939
|
+
export interface MaterializationResult {
|
|
8940
|
+
container: AbstractAssetContainer & {
|
|
8941
|
+
dispose(): void;
|
|
8942
|
+
};
|
|
8943
|
+
materializeMs: number;
|
|
8944
|
+
}
|
|
8945
|
+
export function materializeCommandBuffers(scene: Scene, commandBuffer: ArrayBuffer, dataBuffer: ArrayBuffer, addToScene: boolean, signal?: AbortSignal): Promise<MaterializationResult>;
|
|
8946
|
+
|
|
8947
|
+
|
|
8948
|
+
/**
|
|
8949
|
+
* Binary input accepted for supporting USD layers and assets.
|
|
8950
|
+
*/
|
|
8951
|
+
export type USDBinaryInput = ArrayBuffer | ArrayBufferView;
|
|
8952
|
+
/**
|
|
8953
|
+
* Virtual files supplied alongside the root USD layer, keyed by their path relative to the
|
|
8954
|
+
* root layer.
|
|
8955
|
+
*/
|
|
8956
|
+
export type USDVirtualFiles = Readonly<Record<string, USDBinaryInput>>;
|
|
8957
|
+
/**
|
|
8958
|
+
* Progress phases reported by the USD worker and Babylon materializer.
|
|
8959
|
+
*/
|
|
8960
|
+
export interface USDLoadProgress {
|
|
8961
|
+
/**
|
|
8962
|
+
* Current importer phase.
|
|
8963
|
+
*/
|
|
8964
|
+
phase: "initializing" | "staging" | "extracting" | "materializing";
|
|
8965
|
+
/**
|
|
8966
|
+
* Human-readable phase description.
|
|
8967
|
+
*/
|
|
8968
|
+
message: string;
|
|
8969
|
+
}
|
|
8970
|
+
/**
|
|
8971
|
+
* Options for the OpenUSD scene loader.
|
|
8972
|
+
*/
|
|
8973
|
+
export interface USDFileLoaderOptions {
|
|
8974
|
+
/**
|
|
8975
|
+
* Virtual path used to stage the root layer. Set this when supporting files need
|
|
8976
|
+
* to resolve relative to a directory hierarchy.
|
|
8977
|
+
*/
|
|
8978
|
+
rootFileName?: string;
|
|
8979
|
+
/**
|
|
8980
|
+
* Supporting layers, payloads, and textures keyed by virtual path in the same
|
|
8981
|
+
* virtual file system as `rootFileName`.
|
|
8982
|
+
*/
|
|
8983
|
+
files?: USDVirtualFiles;
|
|
8984
|
+
/**
|
|
8985
|
+
* Enables conservative file-name fallback for unresolved absolute references.
|
|
8986
|
+
* Defaults to true.
|
|
8987
|
+
*/
|
|
8988
|
+
resolveByFileName?: boolean;
|
|
8989
|
+
/**
|
|
8990
|
+
* URL of the module worker. Defaults to the protocol-versioned worker hosted on the Babylon.js CDN.
|
|
8991
|
+
*/
|
|
8992
|
+
workerUrl?: string | URL;
|
|
8993
|
+
/**
|
|
8994
|
+
* URL of the generated Emscripten JavaScript module.
|
|
8995
|
+
*/
|
|
8996
|
+
glueUrl?: string;
|
|
8997
|
+
/**
|
|
8998
|
+
* URL of the OpenUSD WebAssembly binary.
|
|
8999
|
+
*/
|
|
9000
|
+
wasmUrl?: string;
|
|
9001
|
+
/**
|
|
9002
|
+
* URL of the OpenUSD preloaded resource bundle.
|
|
9003
|
+
*/
|
|
9004
|
+
dataUrl?: string;
|
|
9005
|
+
/**
|
|
9006
|
+
* Called when the importer moves to a new processing phase.
|
|
9007
|
+
*/
|
|
9008
|
+
onProgress?: (progress: USDLoadProgress) => void;
|
|
9009
|
+
/**
|
|
9010
|
+
* Called for OpenUSD diagnostic messages.
|
|
9011
|
+
*/
|
|
9012
|
+
onLog?: (level: "info" | "warning" | "error", message: string) => void;
|
|
9013
|
+
/**
|
|
9014
|
+
* Called after extraction and Babylon.js object creation complete.
|
|
9015
|
+
*/
|
|
9016
|
+
onComplete?: (diagnostics: USDImportDiagnostics) => void;
|
|
9017
|
+
}
|
|
9018
|
+
/**
|
|
9019
|
+
* Timing data measured by the OpenUSD worker and Babylon materializer.
|
|
9020
|
+
*/
|
|
9021
|
+
export interface USDImportTimings {
|
|
9022
|
+
/** Total extraction time, including the final Wasm heap copy. */
|
|
9023
|
+
totalMs: number;
|
|
9024
|
+
/** Time spent opening and composing the USD stage. */
|
|
9025
|
+
stageOpenMs: number;
|
|
9026
|
+
/** Time spent traversing the composed stage. */
|
|
9027
|
+
stageReadMs: number;
|
|
9028
|
+
/** Time spent preparing renderable vertex streams. */
|
|
9029
|
+
preparationMs: number;
|
|
9030
|
+
/** Time spent packing the command and raw-data buffers. */
|
|
9031
|
+
packingMs: number;
|
|
9032
|
+
/** Time spent copying command and data buffers from the Wasm heap. */
|
|
9033
|
+
heapCopyMs: number;
|
|
9034
|
+
/** Time spent creating Babylon.js objects. */
|
|
9035
|
+
materializeMs: number;
|
|
9036
|
+
}
|
|
9037
|
+
/**
|
|
9038
|
+
* Statistics reported for an imported USD stage.
|
|
9039
|
+
*/
|
|
9040
|
+
export interface USDImportStatistics {
|
|
9041
|
+
/** Number of transform nodes extracted from the composed stage. */
|
|
9042
|
+
nodes: number;
|
|
9043
|
+
/** Number of polygonal `UsdGeomMesh` sources. */
|
|
9044
|
+
meshes: number;
|
|
9045
|
+
/** Number of analytic cube, sphere, cylinder, and cone sources. */
|
|
9046
|
+
analyticPrimitives: number;
|
|
9047
|
+
/** Number of native Babylon instances created from shared USD geometry. */
|
|
9048
|
+
instances: number;
|
|
9049
|
+
/** Number of authored USD materials translated. */
|
|
9050
|
+
materials: number;
|
|
9051
|
+
/** Number of unique vertices in polygonal source meshes. */
|
|
9052
|
+
vertices: number;
|
|
9053
|
+
/** Number of unique triangles in polygonal source meshes. */
|
|
9054
|
+
triangles: number;
|
|
9055
|
+
/** Size of the command buffer in bytes. */
|
|
9056
|
+
commandBytes: number;
|
|
9057
|
+
/** Size of the raw-data buffer in bytes. */
|
|
9058
|
+
dataBytes: number;
|
|
9059
|
+
}
|
|
9060
|
+
/**
|
|
9061
|
+
* Diagnostics reported after a USD import completes.
|
|
9062
|
+
*/
|
|
9063
|
+
export interface USDImportDiagnostics {
|
|
9064
|
+
/** Timing data for extraction and Babylon.js object creation. */
|
|
9065
|
+
timings: USDImportTimings;
|
|
9066
|
+
/** Counts and buffer sizes reported by the OpenUSD extractor. */
|
|
9067
|
+
statistics: USDImportStatistics;
|
|
9068
|
+
/** Asset references OpenUSD could not resolve from the supplied virtual files. */
|
|
9069
|
+
missingAssets: readonly string[];
|
|
9070
|
+
}
|
|
9071
|
+
|
|
9072
|
+
|
|
9073
|
+
interface SceneLoaderPluginOptions {
|
|
9074
|
+
/**
|
|
9075
|
+
* Defines options for the USD loader.
|
|
9076
|
+
*/
|
|
9077
|
+
[USDFileLoaderMetadata.name]: Partial<USDFileLoaderOptions>;
|
|
9078
|
+
}
|
|
9079
|
+
|
|
9080
|
+
|
|
9081
|
+
/** This file must only contain pure code and pure imports */
|
|
9082
|
+
/**
|
|
9083
|
+
* OpenUSD scene loader backed by a WebAssembly command-buffer extractor.
|
|
9084
|
+
*/
|
|
9085
|
+
export class USDFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
|
|
9086
|
+
/**
|
|
9087
|
+
* Default URLs for the prebuilt OpenUSD importer assets.
|
|
9088
|
+
*/
|
|
9089
|
+
static DefaultConfiguration: {
|
|
9090
|
+
glueUrl: string;
|
|
9091
|
+
wasmUrl: string;
|
|
9092
|
+
dataUrl: string;
|
|
9093
|
+
workerUrl: string;
|
|
9094
|
+
};
|
|
9095
|
+
/**
|
|
9096
|
+
* Defines the name of the plugin.
|
|
9097
|
+
*/
|
|
9098
|
+
readonly name: "usd";
|
|
9099
|
+
/**
|
|
9100
|
+
* Defines the extensions the plugin can load.
|
|
9101
|
+
*/
|
|
9102
|
+
readonly extensions: {
|
|
9103
|
+
readonly ".usd": {
|
|
9104
|
+
readonly isBinary: true;
|
|
9105
|
+
};
|
|
9106
|
+
readonly ".usda": {
|
|
9107
|
+
readonly isBinary: true;
|
|
9108
|
+
};
|
|
9109
|
+
readonly ".usdc": {
|
|
9110
|
+
readonly isBinary: true;
|
|
9111
|
+
};
|
|
9112
|
+
readonly ".usdz": {
|
|
9113
|
+
readonly isBinary: true;
|
|
9114
|
+
};
|
|
9115
|
+
};
|
|
9116
|
+
private readonly _options;
|
|
9117
|
+
private _worker;
|
|
9118
|
+
private _workerUrl;
|
|
9119
|
+
private _workerBlobUrl;
|
|
9120
|
+
private _nextRequestId;
|
|
9121
|
+
private readonly _pending;
|
|
9122
|
+
private readonly _activeLoads;
|
|
9123
|
+
/**
|
|
9124
|
+
* Creates a USD loader.
|
|
9125
|
+
* @param options Options controlling worker assets, supporting files, and diagnostics.
|
|
9126
|
+
*/
|
|
9127
|
+
constructor(options?: Partial<USDFileLoaderOptions>);
|
|
9128
|
+
/**
|
|
9129
|
+
* Creates a configured plugin instance for a SceneLoader operation.
|
|
9130
|
+
* @param options SceneLoader plugin options.
|
|
9131
|
+
* @returns The configured USD loader.
|
|
9132
|
+
*/
|
|
9133
|
+
createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
|
|
9134
|
+
/**
|
|
9135
|
+
* Imports all objects from a USD stage into a scene.
|
|
9136
|
+
* @param _meshesNames Mesh name filtering is not currently supported.
|
|
9137
|
+
* @param scene The scene receiving the imported objects.
|
|
9138
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9139
|
+
* @param rootUrl The source root URL.
|
|
9140
|
+
* @param onProgress SceneLoader progress callback.
|
|
9141
|
+
* @param fileName Name of the root USD layer.
|
|
9142
|
+
* @returns The imported Babylon.js objects.
|
|
9143
|
+
*/
|
|
9144
|
+
importMeshAsync(_meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
9145
|
+
/**
|
|
9146
|
+
* Loads a USD stage into a scene.
|
|
9147
|
+
* @param scene The scene receiving the imported objects.
|
|
9148
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9149
|
+
* @param rootUrl The source root URL.
|
|
9150
|
+
* @param onProgress SceneLoader progress callback.
|
|
9151
|
+
* @param fileName Name of the root USD layer.
|
|
9152
|
+
*/
|
|
9153
|
+
loadAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
|
9154
|
+
/**
|
|
9155
|
+
* Loads a USD stage into an asset container.
|
|
9156
|
+
* @param scene The scene used to create imported objects.
|
|
9157
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9158
|
+
* @param rootUrl The source root URL.
|
|
9159
|
+
* @param onProgress SceneLoader progress callback.
|
|
9160
|
+
* @param fileName Name of the root USD layer.
|
|
9161
|
+
* @returns The populated asset container.
|
|
9162
|
+
*/
|
|
9163
|
+
loadAssetContainerAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
|
9164
|
+
/**
|
|
9165
|
+
* Releases the worker and rejects pending loads.
|
|
9166
|
+
*/
|
|
9167
|
+
dispose(): void;
|
|
9168
|
+
private _loadAsync;
|
|
9169
|
+
private _getWorker;
|
|
9170
|
+
private _terminateWorker;
|
|
9171
|
+
}
|
|
9172
|
+
/** @internal */
|
|
9173
|
+
export function _RegisterUSDLoaderDependencies(): void;
|
|
9174
|
+
/**
|
|
9175
|
+
* Registers the USD scene loader plugin and its Babylon.js runtime dependencies.
|
|
9176
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
9177
|
+
*/
|
|
9178
|
+
export function RegisterUSDFileLoader(): void;
|
|
9179
|
+
|
|
9180
|
+
|
|
9181
|
+
/**
|
|
9182
|
+
* Defines the USD loader plugin metadata.
|
|
9183
|
+
*/
|
|
9184
|
+
export var USDFileLoaderMetadata: {
|
|
9185
|
+
readonly name: "usd";
|
|
9186
|
+
readonly extensions: {
|
|
9187
|
+
readonly ".usd": {
|
|
9188
|
+
readonly isBinary: true;
|
|
9189
|
+
};
|
|
9190
|
+
readonly ".usda": {
|
|
9191
|
+
readonly isBinary: true;
|
|
9192
|
+
};
|
|
9193
|
+
readonly ".usdc": {
|
|
9194
|
+
readonly isBinary: true;
|
|
9195
|
+
};
|
|
9196
|
+
readonly ".usdz": {
|
|
9197
|
+
readonly isBinary: true;
|
|
9198
|
+
};
|
|
9199
|
+
};
|
|
9200
|
+
};
|
|
9201
|
+
|
|
9202
|
+
|
|
9203
|
+
/**
|
|
9204
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
9205
|
+
* Import "./usdFileLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
9206
|
+
*/
|
|
9207
|
+
|
|
9208
|
+
|
|
9209
|
+
export const COMMAND_MAGIC = 1111774037;
|
|
9210
|
+
export const PROTOCOL_VERSION = 4;
|
|
9211
|
+
export const MISSING_OFFSET = 4294967295;
|
|
9212
|
+
export enum Command {
|
|
9213
|
+
Scene = 1,
|
|
9214
|
+
Texture = 2,
|
|
9215
|
+
Material = 3,
|
|
9216
|
+
TransformNode = 4,
|
|
9217
|
+
Skeleton = 5,
|
|
9218
|
+
Geometry = 6,
|
|
9219
|
+
Mesh = 7,
|
|
9220
|
+
Instance = 8,
|
|
9221
|
+
Animation = 9,
|
|
9222
|
+
AnalyticPrimitive = 10
|
|
9223
|
+
}
|
|
9224
|
+
export enum AnalyticPrimitiveType {
|
|
9225
|
+
Cube = 0,
|
|
9226
|
+
Sphere = 1,
|
|
9227
|
+
Cylinder = 2,
|
|
9228
|
+
Cone = 3
|
|
9229
|
+
}
|
|
9230
|
+
export enum PrimitiveAxis {
|
|
9231
|
+
X = 0,
|
|
9232
|
+
Y = 1,
|
|
9233
|
+
Z = 2
|
|
9234
|
+
}
|
|
9235
|
+
export enum AnimationTarget {
|
|
9236
|
+
Node = 0,
|
|
9237
|
+
Bone = 1
|
|
9238
|
+
}
|
|
9239
|
+
export enum AnimationProperty {
|
|
9240
|
+
Position = 0,
|
|
9241
|
+
RotationQuaternion = 1,
|
|
9242
|
+
Scaling = 2,
|
|
9243
|
+
Matrix = 3
|
|
9244
|
+
}
|
|
9245
|
+
export enum MaterialFlags {
|
|
9246
|
+
DoubleSided = 1,
|
|
9247
|
+
Unlit = 2,
|
|
9248
|
+
AlphaBlend = 4
|
|
9249
|
+
}
|
|
9250
|
+
export enum MeshFlags {
|
|
9251
|
+
DoubleSided = 1,
|
|
9252
|
+
LeftHanded = 2
|
|
9253
|
+
}
|
|
9254
|
+
export enum GeometryFlags {
|
|
9255
|
+
Normals = 1,
|
|
9256
|
+
Tangents = 2,
|
|
9257
|
+
Uv0 = 4,
|
|
9258
|
+
Colors = 8,
|
|
9259
|
+
Skin0 = 16,
|
|
9260
|
+
Skin1 = 32
|
|
9261
|
+
}
|
|
9262
|
+
export interface CommandRecord {
|
|
9263
|
+
opcode: Command;
|
|
9264
|
+
flags: number;
|
|
9265
|
+
payloadOffset: number;
|
|
9266
|
+
payloadLength: number;
|
|
9267
|
+
}
|
|
9268
|
+
export function readCommands(buffer: ArrayBuffer): CommandRecord[];
|
|
9269
|
+
export class PayloadReader {
|
|
9270
|
+
#private;
|
|
9271
|
+
offset: number;
|
|
9272
|
+
constructor(buffer: ArrayBuffer, offset: number, length: number);
|
|
9273
|
+
u32(): number;
|
|
9274
|
+
f32(): number;
|
|
9275
|
+
}
|
|
9276
|
+
|
|
9277
|
+
|
|
9278
|
+
/** Pure barrel — re-exports only side-effect-free modules */
|
|
9279
|
+
|
|
9280
|
+
|
|
9281
|
+
|
|
9282
|
+
|
|
8809
9283
|
interface SceneLoaderPluginOptions {
|
|
8810
9284
|
/**
|
|
8811
9285
|
* Defines options for the stl loader.
|
|
@@ -9774,6 +10248,18 @@ declare namespace BABYLON {
|
|
|
9774
10248
|
* Selects which LOD value drives the {@link GaussianSplattingStream} debug wireframe colors.
|
|
9775
10249
|
*/
|
|
9776
10250
|
export type GaussianSplattingStreamDebugLodSource = "optimal" | "current";
|
|
10251
|
+
/**
|
|
10252
|
+
* Immutable metadata-resolution state for a stream's total number of finest-LOD splats.
|
|
10253
|
+
* @experimental
|
|
10254
|
+
*/
|
|
10255
|
+
export type GaussianSplattingStreamLod0SplatCount = Readonly<{
|
|
10256
|
+
status: "pending";
|
|
10257
|
+
}> | Readonly<{
|
|
10258
|
+
status: "available";
|
|
10259
|
+
count: number;
|
|
10260
|
+
}> | Readonly<{
|
|
10261
|
+
status: "unavailable";
|
|
10262
|
+
}>;
|
|
9777
10263
|
/**
|
|
9778
10264
|
* Options for {@link GaussianSplattingStream}.
|
|
9779
10265
|
*/
|
|
@@ -9893,6 +10379,7 @@ declare namespace BABYLON {
|
|
|
9893
10379
|
private readonly _rootUrl;
|
|
9894
10380
|
private readonly _streamOptions;
|
|
9895
10381
|
private readonly _leafNodes;
|
|
10382
|
+
private _lod0SplatCount;
|
|
9896
10383
|
private _lodBaseDistance;
|
|
9897
10384
|
private _lodMultiplier;
|
|
9898
10385
|
private _lodBehindPenalty;
|
|
@@ -10057,6 +10544,19 @@ declare namespace BABYLON {
|
|
|
10057
10544
|
* @experimental
|
|
10058
10545
|
*/
|
|
10059
10546
|
get effectiveSplatBudget(): number;
|
|
10547
|
+
/**
|
|
10548
|
+
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
10549
|
+
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
10550
|
+
* taking the smaller limit when both are configured. `0` means the resident budget is disabled.
|
|
10551
|
+
* @experimental
|
|
10552
|
+
*/
|
|
10553
|
+
get residentSplatBudget(): number;
|
|
10554
|
+
/**
|
|
10555
|
+
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
10556
|
+
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
10557
|
+
* @experimental
|
|
10558
|
+
*/
|
|
10559
|
+
get lod0SplatCount(): GaussianSplattingStreamLod0SplatCount;
|
|
10060
10560
|
/**
|
|
10061
10561
|
* Resolves the raw {@link splatBudget} option to a concrete cap: `undefined` ⇒ 0 (disabled), `"auto"` ⇒ a
|
|
10062
10562
|
* device-tiered default, a positive number ⇒ itself (floored).
|
|
@@ -10226,6 +10726,11 @@ declare namespace BABYLON {
|
|
|
10226
10726
|
* @returns sorted unique file indices
|
|
10227
10727
|
*/
|
|
10228
10728
|
private _collectAllFileIds;
|
|
10729
|
+
/**
|
|
10730
|
+
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
10731
|
+
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
10732
|
+
*/
|
|
10733
|
+
private _resolveLod0SplatCount;
|
|
10229
10734
|
/**
|
|
10230
10735
|
* Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
|
|
10231
10736
|
* each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.
|