babylonjs-loaders 6.39.0 → 6.40.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 +28 -3
- package/babylon.glTF1FileLoader.min.js.map +1 -1
- package/babylon.glTF2FileLoader.js +26 -11
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +51 -12
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +33 -9
- package/babylonjs.loaders.js +85 -22
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +66 -18
- package/package.json +3 -3
package/babylonjs.loaders.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ declare module BABYLON.GLTF1 {
|
|
|
85
85
|
* @param rootUrl
|
|
86
86
|
* @param onSuccess
|
|
87
87
|
* @param onError
|
|
88
|
+
* @returns true to stop further extensions from loading the runtime
|
|
88
89
|
*/
|
|
89
90
|
loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: BABYLON.GLTF1.IGLTFRuntime) => void, onError?: (message: string) => void): boolean;
|
|
90
91
|
/**
|
|
@@ -93,6 +94,7 @@ declare module BABYLON.GLTF1 {
|
|
|
93
94
|
* @param gltfRuntime
|
|
94
95
|
* @param onSuccess
|
|
95
96
|
* @param onError
|
|
97
|
+
* @returns true to stop further extensions from creating the runtime
|
|
96
98
|
*/
|
|
97
99
|
loadRuntimeExtensionsAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): boolean;
|
|
98
100
|
/**
|
|
@@ -103,6 +105,7 @@ declare module BABYLON.GLTF1 {
|
|
|
103
105
|
* @param onSuccess
|
|
104
106
|
* @param onError
|
|
105
107
|
* @param onProgress
|
|
108
|
+
* @returns true to stop further extensions from loading this buffer
|
|
106
109
|
*/
|
|
107
110
|
loadBufferAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
|
|
108
111
|
/**
|
|
@@ -112,6 +115,7 @@ declare module BABYLON.GLTF1 {
|
|
|
112
115
|
* @param id
|
|
113
116
|
* @param onSuccess
|
|
114
117
|
* @param onError
|
|
118
|
+
* @returns true to stop further extensions from loading this texture data
|
|
115
119
|
*/
|
|
116
120
|
loadTextureBufferAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
|
|
117
121
|
/**
|
|
@@ -122,6 +126,7 @@ declare module BABYLON.GLTF1 {
|
|
|
122
126
|
* @param buffer
|
|
123
127
|
* @param onSuccess
|
|
124
128
|
* @param onError
|
|
129
|
+
* @returns true to stop further extensions from loading this texture
|
|
125
130
|
*/
|
|
126
131
|
createTextureAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
|
|
127
132
|
/**
|
|
@@ -131,6 +136,7 @@ declare module BABYLON.GLTF1 {
|
|
|
131
136
|
* @param id
|
|
132
137
|
* @param onSuccess
|
|
133
138
|
* @param onError
|
|
139
|
+
* @returns true to stop further extensions from loading this shader data
|
|
134
140
|
*/
|
|
135
141
|
loadShaderStringAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
|
|
136
142
|
/**
|
|
@@ -140,6 +146,7 @@ declare module BABYLON.GLTF1 {
|
|
|
140
146
|
* @param id
|
|
141
147
|
* @param onSuccess
|
|
142
148
|
* @param onError
|
|
149
|
+
* @returns true to stop further extensions from loading this material
|
|
143
150
|
*/
|
|
144
151
|
loadMaterialAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
|
145
152
|
static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: BABYLON.GLTF1.IGLTFRuntime) => void, onError?: (message: string) => void): void;
|
|
@@ -594,16 +601,19 @@ declare module BABYLON.GLTF1 {
|
|
|
594
601
|
* @param uniform the name of the shader's uniform
|
|
595
602
|
* @param value the value of the uniform
|
|
596
603
|
* @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
|
|
604
|
+
* @returns true if set, else false
|
|
597
605
|
*/
|
|
598
606
|
static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean;
|
|
599
607
|
/**
|
|
600
608
|
* Returns the wrap mode of the texture
|
|
601
609
|
* @param mode the mode value
|
|
610
|
+
* @returns the wrap mode (TEXTURE_WRAP_ADDRESSMODE, MIRROR_ADDRESSMODE or CLAMP_ADDRESSMODE)
|
|
602
611
|
*/
|
|
603
612
|
static GetWrapMode(mode: number): number;
|
|
604
613
|
/**
|
|
605
614
|
* Returns the byte stride giving an accessor
|
|
606
615
|
* @param accessor the GLTF accessor objet
|
|
616
|
+
* @returns the byte stride
|
|
607
617
|
*/
|
|
608
618
|
static GetByteStrideFromType(accessor: BABYLON.GLTF1.IGLTFAccessor): number;
|
|
609
619
|
/**
|
|
@@ -617,17 +627,20 @@ declare module BABYLON.GLTF1 {
|
|
|
617
627
|
* Returns a buffer from its accessor
|
|
618
628
|
* @param gltfRuntime the GLTF runtime
|
|
619
629
|
* @param accessor the GLTF accessor
|
|
630
|
+
* @returns an array buffer view
|
|
620
631
|
*/
|
|
621
632
|
static GetBufferFromAccessor(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, accessor: BABYLON.GLTF1.IGLTFAccessor): any;
|
|
622
633
|
/**
|
|
623
634
|
* Decodes a buffer view into a string
|
|
624
635
|
* @param view the buffer view
|
|
636
|
+
* @returns a string
|
|
625
637
|
*/
|
|
626
638
|
static DecodeBufferToText(view: ArrayBufferView): string;
|
|
627
639
|
/**
|
|
628
640
|
* Returns the default material of gltf. Related to
|
|
629
641
|
* https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material
|
|
630
642
|
* @param scene the Babylon.js scene
|
|
643
|
+
* @returns the default Babylon material
|
|
631
644
|
*/
|
|
632
645
|
static GetDefaultMaterial(scene: Scene): ShaderMaterial;
|
|
633
646
|
private static _DefaultMaterial;
|
|
@@ -870,6 +883,9 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
870
883
|
* - "/materials/2/emissiveFactor"
|
|
871
884
|
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
|
872
885
|
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
|
886
|
+
*
|
|
887
|
+
* @param path The path to convert
|
|
888
|
+
* @returns The object and info associated with the path
|
|
873
889
|
*/
|
|
874
890
|
convert(path: string): IObjectInfo<T>;
|
|
875
891
|
}
|
|
@@ -2040,7 +2056,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
2040
2056
|
loadBufferAsync(context: string, buffer: BABYLON.GLTF2.Loader.IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;
|
|
2041
2057
|
private _loadBufferLOD;
|
|
2042
2058
|
/**
|
|
2043
|
-
*
|
|
2059
|
+
* @returns an array of LOD properties from lowest to highest.
|
|
2044
2060
|
* @param context
|
|
2045
2061
|
* @param property
|
|
2046
2062
|
* @param array
|
|
@@ -2198,9 +2214,9 @@ declare module BABYLON.GLTF2 {
|
|
|
2198
2214
|
*/
|
|
2199
2215
|
get babylonScene(): Scene;
|
|
2200
2216
|
/**
|
|
2201
|
-
* The root Babylon
|
|
2217
|
+
* The root Babylon node when loading the asset.
|
|
2202
2218
|
*/
|
|
2203
|
-
get rootBabylonMesh(): Nullable<
|
|
2219
|
+
get rootBabylonMesh(): Nullable<TransformNode>;
|
|
2204
2220
|
/**
|
|
2205
2221
|
* The root url when loading the asset.
|
|
2206
2222
|
*/
|
|
@@ -3143,9 +3159,15 @@ declare module BABYLON {
|
|
|
3143
3159
|
alwaysComputeSkeletonRootNode: boolean;
|
|
3144
3160
|
/**
|
|
3145
3161
|
* Function called before loading a url referenced by the asset.
|
|
3146
|
-
* @param url
|
|
3162
|
+
* @param url url referenced by the asset
|
|
3163
|
+
* @returns Async url to load
|
|
3147
3164
|
*/
|
|
3148
3165
|
preprocessUrlAsync: (url: string) => Promise<string>;
|
|
3166
|
+
/**
|
|
3167
|
+
* Defines the node to use as the root of the hierarchy when loading the scene (default: undefined). If not defined, a root node will be automatically created.
|
|
3168
|
+
* You can also pass null if you don't want a root node to be created.
|
|
3169
|
+
*/
|
|
3170
|
+
customRootNode?: Nullable<TransformNode>;
|
|
3149
3171
|
/**
|
|
3150
3172
|
* Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
|
|
3151
3173
|
* Note that the observable is raised as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
|
|
@@ -3796,11 +3818,13 @@ declare module BABYLON {
|
|
|
3796
3818
|
* Code from https://github.com/dylanebert/gsplat.js/blob/main/src/loaders/PLYLoader.ts Under MIT license
|
|
3797
3819
|
* Loads a .ply from data array buffer
|
|
3798
3820
|
* if data array buffer is not ply, returns the original buffer
|
|
3821
|
+
* @param data the data to load
|
|
3822
|
+
* @returns the loaded buffer
|
|
3799
3823
|
*/
|
|
3800
3824
|
private _loadPLY;
|
|
3801
3825
|
/**
|
|
3802
3826
|
* Imports from the loaded gaussian splatting data and adds them to the scene
|
|
3803
|
-
* @param
|
|
3827
|
+
* @param _meshesNames a string or array of strings of the mesh names that should be loaded from the file
|
|
3804
3828
|
* @param scene the scene the meshes should be added to
|
|
3805
3829
|
* @param data the gaussian splatting data to load
|
|
3806
3830
|
* @param rootUrl root url to load from
|
|
@@ -3811,15 +3835,15 @@ declare module BABYLON {
|
|
|
3811
3835
|
* Imports all objects from the loaded gaussian splatting data and adds them to the scene
|
|
3812
3836
|
* @param scene the scene the objects should be added to
|
|
3813
3837
|
* @param data the gaussian splatting data to load
|
|
3814
|
-
* @param
|
|
3838
|
+
* @param _rootUrl root url to load from
|
|
3815
3839
|
* @returns a promise which completes when objects have been loaded to the scene
|
|
3816
3840
|
*/
|
|
3817
3841
|
loadAsync(scene: Scene, data: any, _rootUrl: string): Promise<void>;
|
|
3818
3842
|
/**
|
|
3819
3843
|
* Load into an asset container.
|
|
3820
|
-
* @param
|
|
3821
|
-
* @param
|
|
3822
|
-
* @param
|
|
3844
|
+
* @param _scene The scene to load into
|
|
3845
|
+
* @param _data The data to import
|
|
3846
|
+
* @param _rootUrl The root url for scene and resources
|
|
3823
3847
|
* @returns The loaded asset container
|
|
3824
3848
|
*/
|
|
3825
3849
|
loadAssetContainerAsync(_scene: Scene, _data: string, _rootUrl: string): Promise<AssetContainer>;
|