babylonjs-loaders 6.36.0 → 6.37.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.glTF2FileLoader.js +160 -353
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +160 -353
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +44 -53
- package/babylonjs.loaders.js +160 -353
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +91 -99
- package/package.json +3 -3
|
@@ -846,6 +846,40 @@ export class ExtrasAsMetadata implements IGLTFLoaderExtension {
|
|
|
846
846
|
createMaterial(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
+
}
|
|
850
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/gltfPathToObjectConverter" {
|
|
851
|
+
import { IObjectInfo, IPathToObjectConverter } from "babylonjs/ObjectModel/objectModelInterfaces";
|
|
852
|
+
import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
853
|
+
/**
|
|
854
|
+
* A converter that takes a glTF Object Model JSON Pointer
|
|
855
|
+
* and transforms it into an ObjectAccessorContainer, allowing
|
|
856
|
+
* objects referenced in the glTF to be associated with their
|
|
857
|
+
* respective Babylon.js objects.
|
|
858
|
+
*/
|
|
859
|
+
export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
|
|
860
|
+
private _gltf;
|
|
861
|
+
private _infoTree;
|
|
862
|
+
constructor(_gltf: IGLTF, _infoTree: any);
|
|
863
|
+
/**
|
|
864
|
+
* The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
|
|
865
|
+
* <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
|
|
866
|
+
* <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
|
|
867
|
+
* <assetIndex> := <digit> | <name>
|
|
868
|
+
* <propertyPath> := <extensionPath> | <standardPath>
|
|
869
|
+
* <extensionPath> := "extensions"/<name>/<standardPath>
|
|
870
|
+
* <standardPath> := <name> | <name>/<standardPath>
|
|
871
|
+
* <name> := W+
|
|
872
|
+
* <digit> := D+
|
|
873
|
+
*
|
|
874
|
+
* Examples:
|
|
875
|
+
* - "/nodes/0/rotation"
|
|
876
|
+
* - "/materials/2/emissiveFactor"
|
|
877
|
+
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
|
878
|
+
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
|
879
|
+
*/
|
|
880
|
+
convert(path: string): IObjectInfo<T>;
|
|
881
|
+
}
|
|
882
|
+
|
|
849
883
|
}
|
|
850
884
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/index" {
|
|
851
885
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/EXT_lights_image_based";
|
|
@@ -893,34 +927,16 @@ import { ISerializedFlowGraph } from "babylonjs/FlowGraph/typeDefinitions";
|
|
|
893
927
|
export function convertGLTFToSerializedFlowGraph(gltf: IKHRInteractivity): ISerializedFlowGraph;
|
|
894
928
|
|
|
895
929
|
}
|
|
896
|
-
declare module "babylonjs-loaders/glTF/2.0/Extensions/
|
|
897
|
-
import {
|
|
898
|
-
import {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
}
|
|
906
|
-
declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityPathExtensions" {
|
|
907
|
-
import { IPathExtension } from "babylonjs/FlowGraph/flowGraphPath";
|
|
908
|
-
export const interactivityPathExensions: IPathExtension[];
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityPathMaterialExtensions" {
|
|
912
|
-
import { FlowGraphPath } from "babylonjs/FlowGraph/flowGraphPath";
|
|
913
|
-
import { FlowGraphContext } from "babylonjs/FlowGraph/flowGraphContext";
|
|
914
|
-
export const pbrMaterialExtension: {
|
|
915
|
-
shouldProcess(path: FlowGraphPath): boolean;
|
|
916
|
-
processGet(path: FlowGraphPath, context: FlowGraphContext): any;
|
|
917
|
-
processSet(path: FlowGraphPath, context: FlowGraphContext, value: any): void;
|
|
918
|
-
};
|
|
919
|
-
|
|
930
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityPathToObjectConverter" {
|
|
931
|
+
import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
932
|
+
import { GLTFPathToObjectConverter } from "babylonjs-loaders/glTF/2.0/Extensions/gltfPathToObjectConverter";
|
|
933
|
+
import { IObjectAccessor } from "babylonjs/FlowGraph";
|
|
934
|
+
/**
|
|
935
|
+
* Class to convert an interactivity pointer path to a smart object
|
|
936
|
+
*/
|
|
937
|
+
export class InteractivityPathToObjectConverter extends GLTFPathToObjectConverter<IObjectAccessor> {
|
|
938
|
+
constructor(gltf: IGLTF);
|
|
920
939
|
}
|
|
921
|
-
declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityPathTransformNodeExtensions" {
|
|
922
|
-
import { IPathExtension } from "babylonjs/FlowGraph/flowGraphPath";
|
|
923
|
-
export const transformNodeExtension: IPathExtension;
|
|
924
940
|
|
|
925
941
|
}
|
|
926
942
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityUtils" {
|
|
@@ -947,6 +963,7 @@ export class KHR_animation_pointer implements IGLTFLoaderExtension {
|
|
|
947
963
|
*/
|
|
948
964
|
readonly name: string;
|
|
949
965
|
private _loader;
|
|
966
|
+
private _pathToObjectConverter?;
|
|
950
967
|
/**
|
|
951
968
|
* @internal
|
|
952
969
|
*/
|
|
@@ -967,24 +984,6 @@ export class KHR_animation_pointer implements IGLTFLoaderExtension {
|
|
|
967
984
|
* @returns A void promise that resolves when the load is complete or null if not handled
|
|
968
985
|
*/
|
|
969
986
|
_loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
|
|
970
|
-
/**
|
|
971
|
-
* The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
|
|
972
|
-
* <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
|
|
973
|
-
* <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
|
|
974
|
-
* <assetIndex> := <digit> | <name>
|
|
975
|
-
* <propertyPath> := <extensionPath> | <standardPath>
|
|
976
|
-
* <extensionPath> := "extensions"/<name>/<standardPath>
|
|
977
|
-
* <standardPath> := <name> | <name>/<standardPath>
|
|
978
|
-
* <name> := W+
|
|
979
|
-
* <digit> := D+
|
|
980
|
-
*
|
|
981
|
-
* Examples:
|
|
982
|
-
* - "/nodes/0/rotation"
|
|
983
|
-
* - "/materials/2/emissiveFactor"
|
|
984
|
-
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
|
985
|
-
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
|
986
|
-
*/
|
|
987
|
-
private _parseAnimationPointer;
|
|
988
987
|
}
|
|
989
988
|
|
|
990
989
|
}
|
|
@@ -1193,6 +1192,7 @@ export class KHR_interactivity implements IGLTFLoaderExtension {
|
|
|
1193
1192
|
* Defines whether this extension is enabled.
|
|
1194
1193
|
*/
|
|
1195
1194
|
enabled: boolean;
|
|
1195
|
+
private _pathConverter?;
|
|
1196
1196
|
/**
|
|
1197
1197
|
* @internal
|
|
1198
1198
|
* @param _loader
|
|
@@ -2141,6 +2141,7 @@ import { IDataBuffer } from "babylonjs/Misc/dataReader";
|
|
|
2141
2141
|
import { Light } from "babylonjs/Lights/light";
|
|
2142
2142
|
import { AssetContainer } from "babylonjs/assetContainer";
|
|
2143
2143
|
import { AnimationPropertyInfo } from "babylonjs-loaders/glTF/2.0/glTFLoaderAnimation";
|
|
2144
|
+
import { IObjectInfo } from "babylonjs/ObjectModel/objectModelInterfaces";
|
|
2144
2145
|
interface IWithMetadata {
|
|
2145
2146
|
metadata: any;
|
|
2146
2147
|
_internalMetadata: any;
|
|
@@ -2344,7 +2345,7 @@ export class GLTFLoader implements IGLTFLoader {
|
|
|
2344
2345
|
* @param onLoad Called for each animation loaded
|
|
2345
2346
|
* @returns A void promise that resolves when the load is complete
|
|
2346
2347
|
*/
|
|
2347
|
-
_loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, targetInfo:
|
|
2348
|
+
_loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, targetInfo: IObjectInfo<AnimationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
|
|
2348
2349
|
private _loadAnimationSamplerAsync;
|
|
2349
2350
|
/**
|
|
2350
2351
|
* Loads a glTF buffer.
|
|
@@ -4896,39 +4897,40 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
4896
4897
|
|
|
4897
4898
|
|
|
4898
4899
|
|
|
4899
|
-
}
|
|
4900
|
-
declare module BABYLON {
|
|
4901
|
-
|
|
4902
|
-
}
|
|
4903
|
-
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
4900
|
}
|
|
4908
4901
|
declare module BABYLON {
|
|
4909
4902
|
|
|
4910
4903
|
}
|
|
4911
4904
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4912
4905
|
/**
|
|
4913
|
-
*
|
|
4914
|
-
*
|
|
4915
|
-
*
|
|
4916
|
-
*
|
|
4906
|
+
* A converter that takes a glTF Object Model JSON Pointer
|
|
4907
|
+
* and transforms it into an ObjectAccessorContainer, allowing
|
|
4908
|
+
* objects referenced in the glTF to be associated with their
|
|
4909
|
+
* respective Babylon.js objects.
|
|
4917
4910
|
*/
|
|
4918
|
-
export
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4911
|
+
export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
|
|
4912
|
+
private _gltf;
|
|
4913
|
+
private _infoTree;
|
|
4914
|
+
constructor(_gltf: BABYLON.GLTF2.Loader.IGLTF, _infoTree: any);
|
|
4915
|
+
/**
|
|
4916
|
+
* The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
|
|
4917
|
+
* <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
|
|
4918
|
+
* <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
|
|
4919
|
+
* <assetIndex> := <digit> | <name>
|
|
4920
|
+
* <propertyPath> := <extensionPath> | <standardPath>
|
|
4921
|
+
* <extensionPath> := "extensions"/<name>/<standardPath>
|
|
4922
|
+
* <standardPath> := <name> | <name>/<standardPath>
|
|
4923
|
+
* <name> := W+
|
|
4924
|
+
* <digit> := D+
|
|
4925
|
+
*
|
|
4926
|
+
* Examples:
|
|
4927
|
+
* - "/nodes/0/rotation"
|
|
4928
|
+
* - "/materials/2/emissiveFactor"
|
|
4929
|
+
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
|
4930
|
+
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
|
4931
|
+
*/
|
|
4932
|
+
convert(path: string): IObjectInfo<T>;
|
|
4933
|
+
}
|
|
4932
4934
|
|
|
4933
4935
|
|
|
4934
4936
|
|
|
@@ -4937,8 +4939,7 @@ declare module BABYLON {
|
|
|
4937
4939
|
|
|
4938
4940
|
}
|
|
4939
4941
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
+
|
|
4942
4943
|
|
|
4943
4944
|
|
|
4944
4945
|
}
|
|
@@ -4946,11 +4947,13 @@ declare module BABYLON {
|
|
|
4946
4947
|
|
|
4947
4948
|
}
|
|
4948
4949
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4950
|
+
/**
|
|
4951
|
+
* @internal
|
|
4952
|
+
* Converts a glTF Interactivity Extension to a serialized flow graph.
|
|
4953
|
+
* @param gltf the interactivity data
|
|
4954
|
+
* @returns a serialized flow graph
|
|
4955
|
+
*/
|
|
4956
|
+
export function convertGLTFToSerializedFlowGraph(gltf: BABYLON.GLTF2.IKHRInteractivity): ISerializedFlowGraph;
|
|
4954
4957
|
|
|
4955
4958
|
|
|
4956
4959
|
|
|
@@ -4959,7 +4962,12 @@ declare module BABYLON {
|
|
|
4959
4962
|
|
|
4960
4963
|
}
|
|
4961
4964
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
4962
|
-
|
|
4965
|
+
/**
|
|
4966
|
+
* Class to convert an interactivity pointer path to a smart object
|
|
4967
|
+
*/
|
|
4968
|
+
export class InteractivityPathToObjectConverter extends BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<IObjectAccessor> {
|
|
4969
|
+
constructor(gltf: BABYLON.GLTF2.Loader.IGLTF);
|
|
4970
|
+
}
|
|
4963
4971
|
|
|
4964
4972
|
|
|
4965
4973
|
|
|
@@ -4990,6 +4998,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
4990
4998
|
*/
|
|
4991
4999
|
readonly name = "KHR_animation_pointer";
|
|
4992
5000
|
private _loader;
|
|
5001
|
+
private _pathToObjectConverter?;
|
|
4993
5002
|
/**
|
|
4994
5003
|
* @internal
|
|
4995
5004
|
*/
|
|
@@ -5010,24 +5019,6 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
5010
5019
|
* @returns A void promise that resolves when the load is complete or null if not handled
|
|
5011
5020
|
*/
|
|
5012
5021
|
_loadAnimationChannelAsync(context: string, animationContext: string, animation: BABYLON.GLTF2.Loader.IAnimation, channel: BABYLON.GLTF2.Loader.IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
|
|
5013
|
-
/**
|
|
5014
|
-
* The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
|
|
5015
|
-
* <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
|
|
5016
|
-
* <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
|
|
5017
|
-
* <assetIndex> := <digit> | <name>
|
|
5018
|
-
* <propertyPath> := <extensionPath> | <standardPath>
|
|
5019
|
-
* <extensionPath> := "extensions"/<name>/<standardPath>
|
|
5020
|
-
* <standardPath> := <name> | <name>/<standardPath>
|
|
5021
|
-
* <name> := W+
|
|
5022
|
-
* <digit> := D+
|
|
5023
|
-
*
|
|
5024
|
-
* Examples:
|
|
5025
|
-
* - "/nodes/0/rotation"
|
|
5026
|
-
* - "/materials/2/emissiveFactor"
|
|
5027
|
-
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
|
5028
|
-
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
|
5029
|
-
*/
|
|
5030
|
-
private _parseAnimationPointer;
|
|
5031
5022
|
}
|
|
5032
5023
|
|
|
5033
5024
|
|
|
@@ -5237,6 +5228,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
5237
5228
|
* Defines whether this extension is enabled.
|
|
5238
5229
|
*/
|
|
5239
5230
|
enabled: boolean;
|
|
5231
|
+
private _pathConverter?;
|
|
5240
5232
|
/**
|
|
5241
5233
|
* @internal
|
|
5242
5234
|
* @param _loader
|
|
@@ -6371,7 +6363,7 @@ declare module BABYLON.GLTF2 {
|
|
|
6371
6363
|
* @param onLoad Called for each animation loaded
|
|
6372
6364
|
* @returns A void promise that resolves when the load is complete
|
|
6373
6365
|
*/
|
|
6374
|
-
_loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: BABYLON.GLTF2.Loader.IAnimation, channel: BABYLON.GLTF2.Loader.IAnimationChannel, targetInfo:
|
|
6366
|
+
_loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: BABYLON.GLTF2.Loader.IAnimation, channel: BABYLON.GLTF2.Loader.IAnimationChannel, targetInfo: IObjectInfo<BABYLON.GLTF2.AnimationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
|
|
6375
6367
|
private _loadAnimationSamplerAsync;
|
|
6376
6368
|
/**
|
|
6377
6369
|
* Loads a glTF buffer.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-loaders",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.37.0",
|
|
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": "^6.
|
|
19
|
-
"babylonjs-gltf2interface": "^6.
|
|
18
|
+
"babylonjs": "^6.37.0",
|
|
19
|
+
"babylonjs-gltf2interface": "^6.37.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@dev/build-tools": "1.0.0",
|