@babylonjs/loaders 8.2.0 → 8.2.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/OBJ/index.d.ts +4 -4
- package/OBJ/objFileLoader.d.ts +2 -2
- package/OBJ/solidParser.d.ts +1 -1
- package/SPLAT/index.d.ts +2 -2
- package/SPLAT/splatFileLoader.d.ts +2 -2
- package/STL/index.d.ts +1 -1
- package/STL/stlFileLoader.d.ts +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +3 -3
- package/glTF/1.0/glTFLoader.d.ts +2 -2
- package/glTF/1.0/glTFLoaderUtils.d.ts +2 -2
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +2 -2
- package/glTF/1.0/index.d.ts +5 -5
- package/glTF/2.0/Extensions/EXT_lights_ies.d.ts +4 -4
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +4 -4
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +4 -4
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +4 -4
- package/glTF/2.0/Extensions/EXT_texture_avif.d.ts +4 -4
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +4 -4
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +5 -5
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +6 -3
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +46 -24
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +7 -2
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +5 -5
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_node_hoverability.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_node_selectability.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_node_visibility.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +3 -3
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +4 -4
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +4 -4
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +4 -4
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +4 -4
- package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +9 -1
- package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +17 -2
- package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -1
- package/glTF/2.0/Extensions/index.d.ts +38 -38
- package/glTF/2.0/Extensions/objectModelMapping.d.ts +2 -2
- package/glTF/2.0/glTFLoader.d.ts +5 -5
- package/glTF/2.0/glTFLoaderAnimation.d.ts +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +2 -2
- package/glTF/2.0/glTFLoaderExtensionRegistry.d.ts +2 -2
- package/glTF/2.0/index.d.ts +6 -6
- package/glTF/glTFFileLoader.d.ts +1 -1
- package/glTF/index.d.ts +4 -4
- package/index.d.ts +4 -4
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy.d.ts +5 -5
- package/package.json +3 -3
@@ -3,11 +3,11 @@ import { Observable } from "@babylonjs/core/Misc/observable.js";
|
|
3
3
|
import type { Material } from "@babylonjs/core/Materials/material.js";
|
4
4
|
import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
5
5
|
import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
6
|
-
import type { INode, IMaterial, IBuffer, IScene } from "../glTFLoaderInterfaces";
|
7
|
-
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
8
|
-
import { GLTFLoader } from "../glTFLoader";
|
6
|
+
import type { INode, IMaterial, IBuffer, IScene } from "../glTFLoaderInterfaces.js";
|
7
|
+
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
|
8
|
+
import { GLTFLoader } from "../glTFLoader.js";
|
9
9
|
import type { IProperty } from "babylonjs-gltf2interface";
|
10
|
-
declare module "../../glTFFileLoader" {
|
10
|
+
declare module "../../glTFFileLoader.js" {
|
11
11
|
interface GLTFLoaderExtensionOptions {
|
12
12
|
/**
|
13
13
|
* Defines options for the MSFT_lod extension.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Nullable } from "@babylonjs/core/types.js";
|
2
2
|
import type { Material } from "@babylonjs/core/Materials/material.js";
|
3
|
-
import type { IMaterial } from "../glTFLoaderInterfaces";
|
4
|
-
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
-
import { GLTFLoader } from "../glTFLoader";
|
6
|
-
declare module "../../glTFFileLoader" {
|
3
|
+
import type { IMaterial } from "../glTFLoaderInterfaces.js";
|
4
|
+
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
|
5
|
+
import { GLTFLoader } from "../glTFLoader.js";
|
6
|
+
declare module "../../glTFFileLoader.js" {
|
7
7
|
interface GLTFLoaderExtensionOptions {
|
8
8
|
/**
|
9
9
|
* Defines options for the MSFT_minecraftMesh extension.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Nullable } from "@babylonjs/core/types.js";
|
2
2
|
import type { Material } from "@babylonjs/core/Materials/material.js";
|
3
|
-
import type { IMaterial } from "../glTFLoaderInterfaces";
|
4
|
-
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
-
import { GLTFLoader } from "../glTFLoader";
|
6
|
-
declare module "../../glTFFileLoader" {
|
3
|
+
import type { IMaterial } from "../glTFLoaderInterfaces.js";
|
4
|
+
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
|
5
|
+
import { GLTFLoader } from "../glTFLoader.js";
|
6
|
+
declare module "../../glTFFileLoader.js" {
|
7
7
|
interface GLTFLoaderExtensionOptions {
|
8
8
|
/**
|
9
9
|
* Defines options for the MSFT_sRGBFactors extension.
|
@@ -1,6 +1,14 @@
|
|
1
1
|
import type { IObjectInfo, IPathToObjectConverter } from "@babylonjs/core/ObjectModel/objectModelInterfaces.js";
|
2
|
-
import type { IGLTF } from "../glTFLoaderInterfaces";
|
2
|
+
import type { IGLTF } from "../glTFLoaderInterfaces.js";
|
3
3
|
import type { IObjectAccessor } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
|
4
|
+
/**
|
5
|
+
* Adding an exception here will break traversing through the glTF object tree.
|
6
|
+
* This is used for properties that might not be in the glTF object model, but are optional and have a default value.
|
7
|
+
* For example, the path /nodes/\{\}/extensions/KHR_node_visibility/visible is optional - the object can be deferred without the object fully existing.
|
8
|
+
*/
|
9
|
+
export declare const OptionalPathExceptionsList: {
|
10
|
+
regex: RegExp;
|
11
|
+
}[];
|
4
12
|
/**
|
5
13
|
* A converter that takes a glTF Object Model JSON Pointer
|
6
14
|
* and transforms it into an ObjectAccessorContainer, allowing
|
@@ -1,3 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* Adding an exception here will break traversing through the glTF object tree.
|
3
|
+
* This is used for properties that might not be in the glTF object model, but are optional and have a default value.
|
4
|
+
* For example, the path /nodes/\{\}/extensions/KHR_node_visibility/visible is optional - the object can be deferred without the object fully existing.
|
5
|
+
*/
|
6
|
+
export const OptionalPathExceptionsList = [
|
7
|
+
{
|
8
|
+
// get the node as object when reading an extension
|
9
|
+
regex: new RegExp(`^/nodes/\\d+/extensions/`),
|
10
|
+
},
|
11
|
+
];
|
1
12
|
/**
|
2
13
|
* A converter that takes a glTF Object Model JSON Pointer
|
3
14
|
* and transforms it into an ObjectAccessorContainer, allowing
|
@@ -67,9 +78,13 @@ export class GLTFPathToObjectConverter {
|
|
67
78
|
}
|
68
79
|
if (!ignoreObjectTree) {
|
69
80
|
if (objectTree === undefined) {
|
70
|
-
|
81
|
+
// check if the path is in the exception list. If it is, break and return the last object that was found
|
82
|
+
const exception = OptionalPathExceptionsList.find((e) => e.regex.test(path));
|
83
|
+
if (!exception) {
|
84
|
+
throw new Error(`Path ${path} is invalid`);
|
85
|
+
}
|
71
86
|
}
|
72
|
-
if (!isLength) {
|
87
|
+
else if (!isLength) {
|
73
88
|
objectTree = objectTree?.[part];
|
74
89
|
}
|
75
90
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gltfPathToObjectConverter.js","sourceRoot":"","sources":["../../../../../../dev/loaders/src/glTF/2.0/Extensions/gltfPathToObjectConverter.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAClC,YACY,KAAY,EACZ,SAAc;QADd,UAAK,GAAL,KAAK,CAAO;QACZ,cAAS,GAAT,SAAS,CAAK;IACvB,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,OAAO,CAAC,IAAY;QACvB,IAAI,UAAU,GAAQ,IAAI,CAAC,KAAK,CAAC;QACjC,IAAI,QAAQ,GAAQ,IAAI,CAAC,SAAS,CAAC;QACnC,IAAI,MAAM,GAAQ,SAAS,CAAC;QAE5B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,CAAC,KAAK,EAAE,CAAC;QAEd,sEAAsE;QACtE,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9C,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClC,KAAK,CAAC,GAAG,EAAE,CAAC;YACZ,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,QAAQ,GAAG,IAAI,KA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1B,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACZ,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;gBAC/C,CAAC;YACL,CAAC;YACD,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACpB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;oBAC3B,wGAAwG;oBACxG,MAAM,SAAS,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC7E,IAAI,CAAC,SAAS,EAAE,CAAC;wBACb,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,aAAa,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;qBAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACnB,UAAU,GAAG,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC;gBACpC,CAAC;YACL,CAAC;YAED,IAAI,QAAQ,CAAC,UAAU,IAAI,QAAQ,EAAE,CAAC;gBAClC,MAAM,GAAG,UAAU,CAAC;YACxB,CAAC;QACL,CAAC;QAED,OAAO;YACH,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACjB,CAAC;IACN,CAAC;CACJ","sourcesContent":["import type { IObjectInfo, IPathToObjectConverter } from \"core/ObjectModel/objectModelInterfaces\";\r\nimport type { IGLTF } from \"../glTFLoaderInterfaces\";\r\nimport type { IObjectAccessor } from \"core/FlowGraph/typeDefinitions\";\r\n\r\n/**\r\n * Adding an exception here will break traversing through the glTF object tree.\r\n * This is used for properties that might not be in the glTF object model, but are optional and have a default value.\r\n * For example, the path /nodes/\\{\\}/extensions/KHR_node_visibility/visible is optional - the object can be deferred without the object fully existing.\r\n */\r\nexport const OptionalPathExceptionsList: {\r\n regex: RegExp;\r\n}[] = [\r\n {\r\n // get the node as object when reading an extension\r\n regex: new RegExp(`^/nodes/\\\\d+/extensions/`),\r\n },\r\n];\r\n\r\n/**\r\n * A converter that takes a glTF Object Model JSON Pointer\r\n * and transforms it into an ObjectAccessorContainer, allowing\r\n * objects referenced in the glTF to be associated with their\r\n * respective Babylon.js objects.\r\n */\r\nexport class GLTFPathToObjectConverter<T, BabylonType, BabylonValue> implements IPathToObjectConverter<IObjectAccessor<T, BabylonType, BabylonValue>> {\r\n public constructor(\r\n private _gltf: IGLTF,\r\n private _infoTree: any\r\n ) {}\r\n\r\n /**\r\n * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).\r\n * See also https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/ObjectModel.adoc#core-pointers\r\n * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>\r\n * <rootNode> := \"nodes\" | \"materials\" | \"meshes\" | \"cameras\" | \"extensions\"\r\n * <assetIndex> := <digit> | <name>\r\n * <propertyPath> := <extensionPath> | <standardPath>\r\n * <extensionPath> := \"extensions\"/<name>/<standardPath>\r\n * <standardPath> := <name> | <name>/<standardPath>\r\n * <name> := W+\r\n * <digit> := D+\r\n *\r\n * Examples:\r\n * - \"/nodes/0/rotation\"\r\n * - \"/nodes.length\"\r\n * - \"/materials/2/emissiveFactor\"\r\n * - \"/materials/2/pbrMetallicRoughness/baseColorFactor\"\r\n * - \"/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength\"\r\n *\r\n * @param path The path to convert\r\n * @returns The object and info associated with the path\r\n */\r\n public convert(path: string): IObjectInfo<IObjectAccessor<T, BabylonType, BabylonValue>> {\r\n let objectTree: any = this._gltf;\r\n let infoTree: any = this._infoTree;\r\n let target: any = undefined;\r\n\r\n if (!path.startsWith(\"/\")) {\r\n throw new Error(\"Path must start with a /\");\r\n }\r\n const parts = path.split(\"/\");\r\n parts.shift();\r\n\r\n //if the last part has \".length\" in it, separate that as an extra part\r\n if (parts[parts.length - 1].includes(\".length\")) {\r\n const lastPart = parts[parts.length - 1];\r\n const split = lastPart.split(\".\");\r\n parts.pop();\r\n parts.push(...split);\r\n }\r\n\r\n let ignoreObjectTree = false;\r\n\r\n for (const part of parts) {\r\n const isLength = part === \"length\";\r\n if (isLength && !infoTree.__array__) {\r\n throw new Error(`Path ${path} is invalid`);\r\n }\r\n if (infoTree.__ignoreObjectTree__) {\r\n ignoreObjectTree = true;\r\n }\r\n if (infoTree.__array__ && !isLength) {\r\n infoTree = infoTree.__array__;\r\n } else {\r\n infoTree = infoTree[part];\r\n if (!infoTree) {\r\n throw new Error(`Path ${path} is invalid`);\r\n }\r\n }\r\n if (!ignoreObjectTree) {\r\n if (objectTree === undefined) {\r\n // check if the path is in the exception list. If it is, break and return the last object that was found\r\n const exception = OptionalPathExceptionsList.find((e) => e.regex.test(path));\r\n if (!exception) {\r\n throw new Error(`Path ${path} is invalid`);\r\n }\r\n } else if (!isLength) {\r\n objectTree = objectTree?.[part];\r\n }\r\n }\r\n\r\n if (infoTree.__target__ || isLength) {\r\n target = objectTree;\r\n }\r\n }\r\n\r\n return {\r\n object: target,\r\n info: infoTree,\r\n };\r\n }\r\n}\r\n"]}
|
@@ -1,38 +1,38 @@
|
|
1
|
-
export * from "./objectModelMapping";
|
2
|
-
export * from "./EXT_lights_image_based";
|
3
|
-
export * from "./EXT_mesh_gpu_instancing";
|
4
|
-
export * from "./EXT_meshopt_compression";
|
5
|
-
export * from "./EXT_texture_webp";
|
6
|
-
export * from "./EXT_texture_avif";
|
7
|
-
export * from "./EXT_lights_ies";
|
8
|
-
export * from "./KHR_draco_mesh_compression";
|
9
|
-
export * from "./KHR_lights_punctual";
|
10
|
-
export * from "./KHR_materials_pbrSpecularGlossiness";
|
11
|
-
export * from "./KHR_materials_unlit";
|
12
|
-
export * from "./KHR_materials_clearcoat";
|
13
|
-
export * from "./KHR_materials_iridescence";
|
14
|
-
export * from "./KHR_materials_anisotropy";
|
15
|
-
export * from "./KHR_materials_emissive_strength";
|
16
|
-
export * from "./KHR_materials_sheen";
|
17
|
-
export * from "./KHR_materials_specular";
|
18
|
-
export * from "./KHR_materials_ior";
|
19
|
-
export * from "./KHR_materials_variants";
|
20
|
-
export * from "./KHR_materials_transmission";
|
21
|
-
export * from "./KHR_materials_diffuse_transmission";
|
22
|
-
export * from "./KHR_materials_volume";
|
23
|
-
export * from "./KHR_materials_dispersion";
|
24
|
-
export * from "./KHR_mesh_quantization";
|
25
|
-
export * from "./KHR_texture_basisu";
|
26
|
-
export * from "./KHR_texture_transform";
|
27
|
-
export * from "./KHR_xmp_json_ld";
|
28
|
-
export * from "./KHR_animation_pointer";
|
29
|
-
export * from "./MSFT_audio_emitter";
|
30
|
-
export * from "./MSFT_lod";
|
31
|
-
export * from "./MSFT_minecraftMesh";
|
32
|
-
export * from "./MSFT_sRGBFactors";
|
33
|
-
export * from "./KHR_interactivity";
|
34
|
-
export * from "./KHR_node_visibility";
|
35
|
-
export * from "./KHR_node_selectability";
|
36
|
-
export * from "./KHR_node_hoverability";
|
37
|
-
export * from "./ExtrasAsMetadata";
|
38
|
-
export * from "./KHR_interactivity/index";
|
1
|
+
export * from "./objectModelMapping.js";
|
2
|
+
export * from "./EXT_lights_image_based.js";
|
3
|
+
export * from "./EXT_mesh_gpu_instancing.js";
|
4
|
+
export * from "./EXT_meshopt_compression.js";
|
5
|
+
export * from "./EXT_texture_webp.js";
|
6
|
+
export * from "./EXT_texture_avif.js";
|
7
|
+
export * from "./EXT_lights_ies.js";
|
8
|
+
export * from "./KHR_draco_mesh_compression.js";
|
9
|
+
export * from "./KHR_lights_punctual.js";
|
10
|
+
export * from "./KHR_materials_pbrSpecularGlossiness.js";
|
11
|
+
export * from "./KHR_materials_unlit.js";
|
12
|
+
export * from "./KHR_materials_clearcoat.js";
|
13
|
+
export * from "./KHR_materials_iridescence.js";
|
14
|
+
export * from "./KHR_materials_anisotropy.js";
|
15
|
+
export * from "./KHR_materials_emissive_strength.js";
|
16
|
+
export * from "./KHR_materials_sheen.js";
|
17
|
+
export * from "./KHR_materials_specular.js";
|
18
|
+
export * from "./KHR_materials_ior.js";
|
19
|
+
export * from "./KHR_materials_variants.js";
|
20
|
+
export * from "./KHR_materials_transmission.js";
|
21
|
+
export * from "./KHR_materials_diffuse_transmission.js";
|
22
|
+
export * from "./KHR_materials_volume.js";
|
23
|
+
export * from "./KHR_materials_dispersion.js";
|
24
|
+
export * from "./KHR_mesh_quantization.js";
|
25
|
+
export * from "./KHR_texture_basisu.js";
|
26
|
+
export * from "./KHR_texture_transform.js";
|
27
|
+
export * from "./KHR_xmp_json_ld.js";
|
28
|
+
export * from "./KHR_animation_pointer.js";
|
29
|
+
export * from "./MSFT_audio_emitter.js";
|
30
|
+
export * from "./MSFT_lod.js";
|
31
|
+
export * from "./MSFT_minecraftMesh.js";
|
32
|
+
export * from "./MSFT_sRGBFactors.js";
|
33
|
+
export * from "./KHR_interactivity.js";
|
34
|
+
export * from "./KHR_node_visibility.js";
|
35
|
+
export * from "./KHR_node_selectability.js";
|
36
|
+
export * from "./KHR_node_hoverability.js";
|
37
|
+
export * from "./ExtrasAsMetadata.js";
|
38
|
+
export * from "./KHR_interactivity/index.js";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
2
|
-
import type { IAnimation, ICamera, IGLTF, IKHRLightsPunctual_Light, IMaterial, IMesh, INode } from "../glTFLoaderInterfaces";
|
2
|
+
import type { IAnimation, ICamera, IGLTF, IKHRLightsPunctual_Light, IMaterial, IMesh, INode } from "../glTFLoaderInterfaces.js";
|
3
3
|
import type { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
4
4
|
import { Matrix, Quaternion, Vector2 } from "@babylonjs/core/Maths/math.vector.js";
|
5
5
|
import type { Color3 } from "@babylonjs/core/Maths/math.color.js";
|
@@ -10,7 +10,7 @@ import type { Nullable } from "@babylonjs/core/types.js";
|
|
10
10
|
import type { IEXTLightsImageBased_LightImageBased } from "babylonjs-gltf2interface";
|
11
11
|
import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
12
12
|
import type { IInterpolationPropertyInfo, IObjectAccessor } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
|
13
|
-
import { GLTFPathToObjectConverter } from "./gltfPathToObjectConverter";
|
13
|
+
import { GLTFPathToObjectConverter } from "./gltfPathToObjectConverter.js";
|
14
14
|
import type { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
15
15
|
import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
16
16
|
export interface IGLTFObjectModelTree {
|
package/glTF/2.0/glTFLoader.d.ts
CHANGED
@@ -12,16 +12,16 @@ import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
|
12
12
|
import type { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
|
13
13
|
import type { Scene } from "@babylonjs/core/scene.js";
|
14
14
|
import type { IProperty } from "babylonjs-gltf2interface";
|
15
|
-
import type { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem, IAnimationChannel } from "./glTFLoaderInterfaces";
|
16
|
-
import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
|
17
|
-
import { GLTFFileLoader } from "../glTFFileLoader";
|
15
|
+
import type { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem, IAnimationChannel } from "./glTFLoaderInterfaces.js";
|
16
|
+
import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader.js";
|
17
|
+
import { GLTFFileLoader } from "../glTFFileLoader.js";
|
18
18
|
import type { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
|
19
19
|
import type { Light } from "@babylonjs/core/Lights/light.js";
|
20
20
|
import { BoundingInfo } from "@babylonjs/core/Culling/boundingInfo.js";
|
21
21
|
import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
|
22
|
-
import type { AnimationPropertyInfo } from "./glTFLoaderAnimation";
|
22
|
+
import type { AnimationPropertyInfo } from "./glTFLoaderAnimation.js";
|
23
23
|
import type { IObjectInfo } from "@babylonjs/core/ObjectModel/objectModelInterfaces.js";
|
24
|
-
import type { GLTFExtensionFactory } from "./glTFLoaderExtensionRegistry";
|
24
|
+
import type { GLTFExtensionFactory } from "./glTFLoaderExtensionRegistry.js";
|
25
25
|
import type { IInterpolationPropertyInfo } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
|
26
26
|
export { GLTFFileLoader };
|
27
27
|
interface IWithMetadata {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Animation } from "@babylonjs/core/Animations/animation.js";
|
2
2
|
import { Quaternion, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
-
import type { INode } from "./glTFLoaderInterfaces";
|
3
|
+
import type { INode } from "./glTFLoaderInterfaces.js";
|
4
4
|
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
5
5
|
/** @internal */
|
6
6
|
export type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;
|
@@ -9,8 +9,8 @@ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture
|
|
9
9
|
import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
10
10
|
import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
11
11
|
import type { IDisposable } from "@babylonjs/core/scene.js";
|
12
|
-
import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer, IAnimationChannel } from "./glTFLoaderInterfaces";
|
13
|
-
import type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
|
12
|
+
import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer, IAnimationChannel } from "./glTFLoaderInterfaces.js";
|
13
|
+
import type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader.js";
|
14
14
|
import type { IProperty } from "babylonjs-gltf2interface";
|
15
15
|
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
16
16
|
/**
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { GLTFLoader } from "./glTFLoader";
|
2
|
-
import type { IGLTFLoaderExtension } from "./glTFLoaderExtension";
|
1
|
+
import type { GLTFLoader } from "./glTFLoader.js";
|
2
|
+
import type { IGLTFLoaderExtension } from "./glTFLoaderExtension.js";
|
3
3
|
interface IRegisteredGLTFExtension {
|
4
4
|
isGLTFExtension: boolean;
|
5
5
|
factory: GLTFExtensionFactory;
|
package/glTF/2.0/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from "./glTFLoader";
|
2
|
-
export * from "./glTFLoaderExtension";
|
3
|
-
export * from "./glTFLoaderExtensionRegistry";
|
4
|
-
export * from "./glTFLoaderInterfaces";
|
5
|
-
export * from "./glTFLoaderAnimation";
|
6
|
-
export * from "./Extensions/index";
|
1
|
+
export * from "./glTFLoader.js";
|
2
|
+
export * from "./glTFLoaderExtension.js";
|
3
|
+
export * from "./glTFLoaderExtensionRegistry.js";
|
4
|
+
export * from "./glTFLoaderInterfaces.js";
|
5
|
+
export * from "./glTFLoaderAnimation.js";
|
6
|
+
export * from "./Extensions/index.js";
|
package/glTF/glTFFileLoader.d.ts
CHANGED
@@ -11,7 +11,7 @@ import type { Scene, IDisposable } from "@babylonjs/core/scene.js";
|
|
11
11
|
import type { WebRequest } from "@babylonjs/core/Misc/webRequest.js";
|
12
12
|
import type { IFileRequest } from "@babylonjs/core/Misc/fileRequest.js";
|
13
13
|
import type { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
|
14
|
-
import { GLTFFileLoaderMetadata } from "./glTFFileLoader.metadata";
|
14
|
+
import { GLTFFileLoaderMetadata } from "./glTFFileLoader.metadata.js";
|
15
15
|
import type { LoadFileError } from "@babylonjs/core/Misc/fileTools.js";
|
16
16
|
import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
17
17
|
/**
|
package/glTF/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export * from "./glTFFileLoader";
|
2
|
-
export * from "./glTFValidation";
|
3
|
-
import * as GLTF1 from "./1.0/index";
|
4
|
-
import * as GLTF2 from "./2.0/index";
|
1
|
+
export * from "./glTFFileLoader.js";
|
2
|
+
export * from "./glTFValidation.js";
|
3
|
+
import * as GLTF1 from "./1.0/index.js";
|
4
|
+
import * as GLTF2 from "./2.0/index.js";
|
5
5
|
export { GLTF1, GLTF2 };
|
package/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export * from "./glTF/index";
|
2
|
-
export * from "./OBJ/index";
|
3
|
-
export * from "./STL/index";
|
4
|
-
export * from "./SPLAT/index";
|
1
|
+
export * from "./glTF/index.js";
|
2
|
+
export * from "./OBJ/index.js";
|
3
|
+
export * from "./STL/index.js";
|
4
|
+
export * from "./SPLAT/index.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF1";
|
1
|
+
export * from "./legacy-glTF.js";
|
2
|
+
export * from "./legacy-glTF1.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF2";
|
1
|
+
export * from "./legacy-glTF.js";
|
2
|
+
export * from "./legacy-glTF2.js";
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF1";
|
3
|
-
export * from "./legacy-glTF2";
|
1
|
+
export * from "./legacy-glTF.js";
|
2
|
+
export * from "./legacy-glTF1.js";
|
3
|
+
export * from "./legacy-glTF2.js";
|
package/legacy/legacy.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "../index.js";
|
2
|
-
export * from "./legacy-glTF";
|
3
|
-
export * from "./legacy-glTF1";
|
4
|
-
export * from "./legacy-glTF2";
|
5
|
-
export * from "./legacy-objFileLoader";
|
6
|
-
export * from "./legacy-stlFileLoader";
|
2
|
+
export * from "./legacy-glTF.js";
|
3
|
+
export * from "./legacy-glTF1.js";
|
4
|
+
export * from "./legacy-glTF2.js";
|
5
|
+
export * from "./legacy-objFileLoader.js";
|
6
|
+
export * from "./legacy-stlFileLoader.js";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babylonjs/loaders",
|
3
|
-
"version": "8.2.
|
3
|
+
"version": "8.2.1",
|
4
4
|
"main": "index.js",
|
5
5
|
"module": "index.js",
|
6
6
|
"types": "index.d.ts",
|
@@ -18,10 +18,10 @@
|
|
18
18
|
"postcompile": "build-tools -c add-js-to-es6"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@babylonjs/core": "^8.2.
|
21
|
+
"@babylonjs/core": "^8.2.1",
|
22
22
|
"@dev/build-tools": "^1.0.0",
|
23
23
|
"@lts/loaders": "^1.0.0",
|
24
|
-
"babylonjs-gltf2interface": "^8.2.
|
24
|
+
"babylonjs-gltf2interface": "^8.2.1"
|
25
25
|
},
|
26
26
|
"peerDependencies": {
|
27
27
|
"@babylonjs/core": "^8.0.0",
|