@babylonjs/loaders 5.0.0-rc.6 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/OBJ/index.d.ts +4 -4
- package/OBJ/index.js +4 -4
- package/OBJ/mtlFileLoader.d.ts +41 -41
- package/OBJ/mtlFileLoader.js +232 -232
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.d.ts +126 -126
- package/OBJ/objFileLoader.js +296 -296
- package/OBJ/objFileLoader.js.map +1 -1
- package/OBJ/objLoadingOptions.d.ts +43 -43
- package/OBJ/objLoadingOptions.js +1 -1
- package/OBJ/objLoadingOptions.js.map +1 -1
- package/OBJ/solidParser.d.ts +154 -154
- package/OBJ/solidParser.js +693 -693
- package/OBJ/solidParser.js.map +1 -1
- package/STL/index.d.ts +1 -1
- package/STL/index.js +1 -1
- package/STL/stlFileLoader.d.ts +64 -64
- package/STL/stlFileLoader.js +233 -233
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -60
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +136 -136
- package/glTF/1.0/glTFLoader.js +1814 -1815
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
- package/glTF/1.0/glTFLoaderUtils.js +250 -250
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/1.0/index.d.ts +5 -5
- package/glTF/1.0/index.js +5 -5
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
- package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
- package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
- package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
- package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
- package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/Extensions/index.d.ts +26 -26
- package/glTF/2.0/Extensions/index.js +26 -26
- package/glTF/2.0/glTFLoader.d.ts +406 -405
- package/glTF/2.0/glTFLoader.js +2366 -2366
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
- package/glTF/2.0/glTFLoaderExtension.js +1 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
- package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/2.0/index.d.ts +4 -4
- package/glTF/2.0/index.js +5 -4
- package/glTF/2.0/index.js.map +1 -1
- package/glTF/glTFFileLoader.d.ts +433 -433
- package/glTF/glTFFileLoader.js +927 -927
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -123
- package/glTF/glTFValidation.js.map +1 -1
- package/glTF/index.d.ts +5 -5
- package/glTF/index.js +6 -5
- package/glTF/index.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js +18 -18
- package/legacy/legacy-glTF.js.map +1 -1
- package/legacy/legacy-glTF1.d.ts +2 -2
- package/legacy/legacy-glTF1.js +15 -14
- package/legacy/legacy-glTF1.js.map +1 -1
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF1FileLoader.js +3 -3
- package/legacy/legacy-glTF1FileLoader.js.map +1 -1
- package/legacy/legacy-glTF2.d.ts +2 -2
- package/legacy/legacy-glTF2.js +33 -32
- package/legacy/legacy-glTF2.js.map +1 -1
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.js +3 -3
- package/legacy/legacy-glTF2FileLoader.js.map +1 -1
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -4
- package/legacy/legacy-glTFFileLoader.js.map +1 -1
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js +13 -12
- package/legacy/legacy-objFileLoader.js.map +1 -1
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js +13 -12
- package/legacy/legacy-stlFileLoader.js.map +1 -1
- package/legacy/legacy.d.ts +6 -6
- package/legacy/legacy.js +8 -7
- package/legacy/legacy.js.map +1 -1
- package/license.md +71 -0
- package/package.json +25 -6
package/glTF/glTFValidation.js
CHANGED
@@ -1,124 +1,124 @@
|
|
1
|
-
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
2
|
-
function validateAsync(data, rootUrl, fileName, getExternalResource) {
|
3
|
-
var options = {
|
4
|
-
externalResourceFunction: function (uri) { return getExternalResource(uri).then(function (value) { return new Uint8Array(value); }); },
|
5
|
-
};
|
6
|
-
if (fileName) {
|
7
|
-
options.uri = rootUrl === "file:" ? fileName : rootUrl + fileName;
|
8
|
-
}
|
9
|
-
return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);
|
10
|
-
}
|
11
|
-
/**
|
12
|
-
* The worker function that gets converted to a blob url to pass into a worker.
|
13
|
-
*/
|
14
|
-
function workerFunc() {
|
15
|
-
var pendingExternalResources = [];
|
16
|
-
onmessage = function (message) {
|
17
|
-
var data = message.data;
|
18
|
-
switch (data.id) {
|
19
|
-
case "init": {
|
20
|
-
importScripts(data.url);
|
21
|
-
break;
|
22
|
-
}
|
23
|
-
case "validate": {
|
24
|
-
validateAsync(data.data, data.rootUrl, data.fileName, function (uri) {
|
25
|
-
return new Promise(function (resolve, reject) {
|
26
|
-
var index = pendingExternalResources.length;
|
27
|
-
pendingExternalResources.push({ resolve: resolve, reject: reject });
|
28
|
-
postMessage({ id: "getExternalResource", index: index, uri: uri });
|
29
|
-
});
|
30
|
-
}).then(function (value) {
|
31
|
-
postMessage({ id: "validate.resolve", value: value });
|
32
|
-
}, function (reason) {
|
33
|
-
postMessage({ id: "validate.reject", reason: reason });
|
34
|
-
});
|
35
|
-
break;
|
36
|
-
}
|
37
|
-
case "getExternalResource.resolve": {
|
38
|
-
pendingExternalResources[data.index].resolve(data.value);
|
39
|
-
break;
|
40
|
-
}
|
41
|
-
case "getExternalResource.reject": {
|
42
|
-
pendingExternalResources[data.index].reject(data.reason);
|
43
|
-
break;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
};
|
47
|
-
}
|
48
|
-
/**
|
49
|
-
* glTF validation
|
50
|
-
*/
|
51
|
-
var GLTFValidation = /** @class */ (function () {
|
52
|
-
function GLTFValidation() {
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* Validate a glTF asset using the glTF-Validator.
|
56
|
-
* @param data The JSON of a glTF or the array buffer of a binary glTF
|
57
|
-
* @param rootUrl The root url for the glTF
|
58
|
-
* @param fileName The file name for the glTF
|
59
|
-
* @param getExternalResource The callback to get external resources for the glTF validator
|
60
|
-
* @returns A promise that resolves with the glTF validation results once complete
|
61
|
-
*/
|
62
|
-
GLTFValidation.ValidateAsync = function (data, rootUrl, fileName, getExternalResource) {
|
63
|
-
var _this = this;
|
64
|
-
if (typeof Worker === "function") {
|
65
|
-
return new Promise(function (resolve, reject) {
|
66
|
-
var workerContent = "".concat(validateAsync, "(").concat(workerFunc, ")()");
|
67
|
-
var workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" }));
|
68
|
-
var worker = new Worker(workerBlobUrl);
|
69
|
-
var onError = function (error) {
|
70
|
-
worker.removeEventListener("error", onError);
|
71
|
-
worker.removeEventListener("message", onMessage);
|
72
|
-
reject(error);
|
73
|
-
};
|
74
|
-
var onMessage = function (message) {
|
75
|
-
var data = message.data;
|
76
|
-
switch (data.id) {
|
77
|
-
case "getExternalResource": {
|
78
|
-
getExternalResource(data.uri).then(function (value) {
|
79
|
-
worker.postMessage({ id: "getExternalResource.resolve", index: data.index, value: value }, [value]);
|
80
|
-
}, function (reason) {
|
81
|
-
worker.postMessage({ id: "getExternalResource.reject", index: data.index, reason: reason });
|
82
|
-
});
|
83
|
-
break;
|
84
|
-
}
|
85
|
-
case "validate.resolve": {
|
86
|
-
worker.removeEventListener("error", onError);
|
87
|
-
worker.removeEventListener("message", onMessage);
|
88
|
-
resolve(data.value);
|
89
|
-
worker.terminate();
|
90
|
-
break;
|
91
|
-
}
|
92
|
-
case "validate.reject": {
|
93
|
-
worker.removeEventListener("error", onError);
|
94
|
-
worker.removeEventListener("message", onMessage);
|
95
|
-
reject(data.reason);
|
96
|
-
worker.terminate();
|
97
|
-
}
|
98
|
-
}
|
99
|
-
};
|
100
|
-
worker.addEventListener("error", onError);
|
101
|
-
worker.addEventListener("message", onMessage);
|
102
|
-
worker.postMessage({ id: "init", url: _this.Configuration.url });
|
103
|
-
worker.postMessage({ id: "validate", data: data, rootUrl: rootUrl, fileName: fileName });
|
104
|
-
});
|
105
|
-
}
|
106
|
-
else {
|
107
|
-
if (!this._LoadScriptPromise) {
|
108
|
-
this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);
|
109
|
-
}
|
110
|
-
return this._LoadScriptPromise.then(function () {
|
111
|
-
return validateAsync(data, rootUrl, fileName, getExternalResource);
|
112
|
-
});
|
113
|
-
}
|
114
|
-
};
|
115
|
-
/**
|
116
|
-
* The configuration. Defaults to `{ url: "https://preview.babylonjs.com/gltf_validator.js" }`.
|
117
|
-
*/
|
118
|
-
GLTFValidation.Configuration = {
|
119
|
-
url: "https://preview.babylonjs.com/gltf_validator.js",
|
120
|
-
};
|
121
|
-
return GLTFValidation;
|
122
|
-
}());
|
123
|
-
export { GLTFValidation };
|
1
|
+
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
2
|
+
function validateAsync(data, rootUrl, fileName, getExternalResource) {
|
3
|
+
var options = {
|
4
|
+
externalResourceFunction: function (uri) { return getExternalResource(uri).then(function (value) { return new Uint8Array(value); }); },
|
5
|
+
};
|
6
|
+
if (fileName) {
|
7
|
+
options.uri = rootUrl === "file:" ? fileName : rootUrl + fileName;
|
8
|
+
}
|
9
|
+
return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* The worker function that gets converted to a blob url to pass into a worker.
|
13
|
+
*/
|
14
|
+
function workerFunc() {
|
15
|
+
var pendingExternalResources = [];
|
16
|
+
onmessage = function (message) {
|
17
|
+
var data = message.data;
|
18
|
+
switch (data.id) {
|
19
|
+
case "init": {
|
20
|
+
importScripts(data.url);
|
21
|
+
break;
|
22
|
+
}
|
23
|
+
case "validate": {
|
24
|
+
validateAsync(data.data, data.rootUrl, data.fileName, function (uri) {
|
25
|
+
return new Promise(function (resolve, reject) {
|
26
|
+
var index = pendingExternalResources.length;
|
27
|
+
pendingExternalResources.push({ resolve: resolve, reject: reject });
|
28
|
+
postMessage({ id: "getExternalResource", index: index, uri: uri });
|
29
|
+
});
|
30
|
+
}).then(function (value) {
|
31
|
+
postMessage({ id: "validate.resolve", value: value });
|
32
|
+
}, function (reason) {
|
33
|
+
postMessage({ id: "validate.reject", reason: reason });
|
34
|
+
});
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
case "getExternalResource.resolve": {
|
38
|
+
pendingExternalResources[data.index].resolve(data.value);
|
39
|
+
break;
|
40
|
+
}
|
41
|
+
case "getExternalResource.reject": {
|
42
|
+
pendingExternalResources[data.index].reject(data.reason);
|
43
|
+
break;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
};
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* glTF validation
|
50
|
+
*/
|
51
|
+
var GLTFValidation = /** @class */ (function () {
|
52
|
+
function GLTFValidation() {
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Validate a glTF asset using the glTF-Validator.
|
56
|
+
* @param data The JSON of a glTF or the array buffer of a binary glTF
|
57
|
+
* @param rootUrl The root url for the glTF
|
58
|
+
* @param fileName The file name for the glTF
|
59
|
+
* @param getExternalResource The callback to get external resources for the glTF validator
|
60
|
+
* @returns A promise that resolves with the glTF validation results once complete
|
61
|
+
*/
|
62
|
+
GLTFValidation.ValidateAsync = function (data, rootUrl, fileName, getExternalResource) {
|
63
|
+
var _this = this;
|
64
|
+
if (typeof Worker === "function") {
|
65
|
+
return new Promise(function (resolve, reject) {
|
66
|
+
var workerContent = "".concat(validateAsync, "(").concat(workerFunc, ")()");
|
67
|
+
var workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" }));
|
68
|
+
var worker = new Worker(workerBlobUrl);
|
69
|
+
var onError = function (error) {
|
70
|
+
worker.removeEventListener("error", onError);
|
71
|
+
worker.removeEventListener("message", onMessage);
|
72
|
+
reject(error);
|
73
|
+
};
|
74
|
+
var onMessage = function (message) {
|
75
|
+
var data = message.data;
|
76
|
+
switch (data.id) {
|
77
|
+
case "getExternalResource": {
|
78
|
+
getExternalResource(data.uri).then(function (value) {
|
79
|
+
worker.postMessage({ id: "getExternalResource.resolve", index: data.index, value: value }, [value]);
|
80
|
+
}, function (reason) {
|
81
|
+
worker.postMessage({ id: "getExternalResource.reject", index: data.index, reason: reason });
|
82
|
+
});
|
83
|
+
break;
|
84
|
+
}
|
85
|
+
case "validate.resolve": {
|
86
|
+
worker.removeEventListener("error", onError);
|
87
|
+
worker.removeEventListener("message", onMessage);
|
88
|
+
resolve(data.value);
|
89
|
+
worker.terminate();
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
case "validate.reject": {
|
93
|
+
worker.removeEventListener("error", onError);
|
94
|
+
worker.removeEventListener("message", onMessage);
|
95
|
+
reject(data.reason);
|
96
|
+
worker.terminate();
|
97
|
+
}
|
98
|
+
}
|
99
|
+
};
|
100
|
+
worker.addEventListener("error", onError);
|
101
|
+
worker.addEventListener("message", onMessage);
|
102
|
+
worker.postMessage({ id: "init", url: _this.Configuration.url });
|
103
|
+
worker.postMessage({ id: "validate", data: data, rootUrl: rootUrl, fileName: fileName });
|
104
|
+
});
|
105
|
+
}
|
106
|
+
else {
|
107
|
+
if (!this._LoadScriptPromise) {
|
108
|
+
this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);
|
109
|
+
}
|
110
|
+
return this._LoadScriptPromise.then(function () {
|
111
|
+
return validateAsync(data, rootUrl, fileName, getExternalResource);
|
112
|
+
});
|
113
|
+
}
|
114
|
+
};
|
115
|
+
/**
|
116
|
+
* The configuration. Defaults to `{ url: "https://preview.babylonjs.com/gltf_validator.js" }`.
|
117
|
+
*/
|
118
|
+
GLTFValidation.Configuration = {
|
119
|
+
url: "https://preview.babylonjs.com/gltf_validator.js",
|
120
|
+
};
|
121
|
+
return GLTFValidation;
|
122
|
+
}());
|
123
|
+
export { GLTFValidation };
|
124
124
|
//# sourceMappingURL=glTFValidation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFValidation.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/glTF/glTFValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AASxC,SAAS,aAAa,CAClB,IAA0B,EAC1B,OAAe,EACf,QAAgB,EAChB,mBAA0D;IAE1D,IAAM,OAAO,GAAiC;QAC1C,wBAAwB,EAAE,UAAC,GAAG,IAAK,OAAA,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK,IAAK,OAAA,IAAI,UAAU,CAAC,KAAK,CAAC,EAArB,CAAqB,CAAC,EAA/D,CAA+D;KACrG,CAAC;IAEF,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,GAAG,GAAG,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,GAAG,QAAQ,CAAC;KACrE;IAED,OAAO,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAClJ,CAAC;AAED;;GAEG;AACH,SAAS,UAAU;IACf,IAAM,wBAAwB,GAA2E,EAAE,CAAC;IAE5G,SAAS,GAAG,UAAC,OAAO;QAChB,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,QAAQ,IA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AAC,IAAI,CAAC;gBAChC,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAhFD;;OAEG;IACW,4BAAa,GAAiC;QACxD,GAAG,EAAE,iDAAiD;KACzD,CAAC;IA4EN,qBAAC;CAAA,AAlFD,IAkFC;SAlFY,cAAc","sourcesContent":["import * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let GLTFValidator: GLTF2.IGLTFValidator;\r\n\r\n// WorkerGlobalScope\r\ndeclare function importScripts(...urls: string[]): void;\r\ndeclare function postMessage(message: any, transfer?: any[]): void;\r\n\r\nfunction validateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n): Promise<GLTF2.IGLTFValidationResults> {\r\n const options: GLTF2.IGLTFValidationOptions = {\r\n externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)),\r\n };\r\n\r\n if (fileName) {\r\n options.uri = rootUrl === \"file:\" ? fileName : rootUrl + fileName;\r\n }\r\n\r\n return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);\r\n}\r\n\r\n/**\r\n * The worker function that gets converted to a blob url to pass into a worker.\r\n */\r\nfunction workerFunc(): void {\r\n const pendingExternalResources: Array<{ resolve: (data: any) => void; reject: (reason: any) => void }> = [];\r\n\r\n onmessage = (message) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"init\": {\r\n importScripts(data.url);\r\n break;\r\n }\r\n case \"validate\": {\r\n validateAsync(\r\n data.data,\r\n data.rootUrl,\r\n data.fileName,\r\n (uri) =>\r\n new Promise((resolve, reject) => {\r\n const index = pendingExternalResources.length;\r\n pendingExternalResources.push({ resolve, reject });\r\n postMessage({ id: \"getExternalResource\", index: index, uri: uri });\r\n })\r\n ).then(\r\n (value) => {\r\n postMessage({ id: \"validate.resolve\", value: value });\r\n },\r\n (reason) => {\r\n postMessage({ id: \"validate.reject\", reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"getExternalResource.resolve\": {\r\n pendingExternalResources[data.index].resolve(data.value);\r\n break;\r\n }\r\n case \"getExternalResource.reject\": {\r\n pendingExternalResources[data.index].reject(data.reason);\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Configuration for glTF validation\r\n */\r\nexport interface IGLTFValidationConfiguration {\r\n /**\r\n * The url of the glTF validator.\r\n */\r\n url: string;\r\n}\r\n\r\n/**\r\n * glTF validation\r\n */\r\nexport class GLTFValidation {\r\n /**\r\n * The configuration. Defaults to `{ url: \"https://preview.babylonjs.com/gltf_validator.js\" }`.\r\n */\r\n public static Configuration: IGLTFValidationConfiguration = {\r\n url: \"https://preview.babylonjs.com/gltf_validator.js\",\r\n };\r\n\r\n private static _LoadScriptPromise: Promise<void>;\r\n\r\n /**\r\n * Validate a glTF asset using the glTF-Validator.\r\n * @param data The JSON of a glTF or the array buffer of a binary glTF\r\n * @param rootUrl The root url for the glTF\r\n * @param fileName The file name for the glTF\r\n * @param getExternalResource The callback to get external resources for the glTF validator\r\n * @returns A promise that resolves with the glTF validation results once complete\r\n */\r\n public static ValidateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n ): Promise<GLTF2.IGLTFValidationResults> {\r\n if (typeof Worker === \"function\") {\r\n return new Promise((resolve, reject) => {\r\n const workerContent = `${validateAsync}(${workerFunc})()`;\r\n const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: \"application/javascript\" }));\r\n const worker = new Worker(workerBlobUrl);\r\n\r\n const onError = (error: ErrorEvent) => {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(error);\r\n };\r\n\r\n const onMessage = (message: MessageEvent) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"getExternalResource\": {\r\n getExternalResource(data.uri).then(\r\n (value) => {\r\n worker.postMessage({ id: \"getExternalResource.resolve\", index: data.index, value: value }, [value]);\r\n },\r\n (reason) => {\r\n worker.postMessage({ id: \"getExternalResource.reject\", index: data.index, reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"validate.resolve\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n resolve(data.value);\r\n worker.terminate();\r\n break;\r\n }\r\n case \"validate.reject\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(data.reason);\r\n worker.terminate();\r\n }\r\n }\r\n };\r\n\r\n worker.addEventListener(\"error\", onError);\r\n worker.addEventListener(\"message\", onMessage);\r\n\r\n worker.postMessage({ id: \"init\", url: this.Configuration.url });\r\n worker.postMessage({ id: \"validate\", data: data, rootUrl: rootUrl, fileName: fileName });\r\n });\r\n } else {\r\n if (!this._LoadScriptPromise) {\r\n this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);\r\n }\r\n\r\n return this._LoadScriptPromise.then(() => {\r\n return validateAsync(data, rootUrl, fileName, getExternalResource);\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"glTFValidation.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/glTF/glTFValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AASxC,SAAS,aAAa,CAClB,IAA0B,EAC1B,OAAe,EACf,QAAgB,EAChB,mBAA0D;IAE1D,IAAM,OAAO,GAAiC;QAC1C,wBAAwB,EAAE,UAAC,GAAG,IAAK,OAAA,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK,IAAK,OAAA,IAAI,UAAU,CAAC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OAAO,CAAC,CAAC;gBAC1C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBAE9C,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC;gBAChE,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC7F,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;gBAC1B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;aAC3E;YAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;gBAChC,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAhFD;;OAEG;IACW,4BAAa,GAAiC;QACxD,GAAG,EAAE,iDAAiD;KACzD,CAAC;IA4EN,qBAAC;CAAA,AAlFD,IAkFC;SAlFY,cAAc","sourcesContent":["import type * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let GLTFValidator: GLTF2.IGLTFValidator;\r\n\r\n// WorkerGlobalScope\r\ndeclare function importScripts(...urls: string[]): void;\r\ndeclare function postMessage(message: any, transfer?: any[]): void;\r\n\r\nfunction validateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n): Promise<GLTF2.IGLTFValidationResults> {\r\n const options: GLTF2.IGLTFValidationOptions = {\r\n externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)),\r\n };\r\n\r\n if (fileName) {\r\n options.uri = rootUrl === \"file:\" ? fileName : rootUrl + fileName;\r\n }\r\n\r\n return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);\r\n}\r\n\r\n/**\r\n * The worker function that gets converted to a blob url to pass into a worker.\r\n */\r\nfunction workerFunc(): void {\r\n const pendingExternalResources: Array<{ resolve: (data: any) => void; reject: (reason: any) => void }> = [];\r\n\r\n onmessage = (message) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"init\": {\r\n importScripts(data.url);\r\n break;\r\n }\r\n case \"validate\": {\r\n validateAsync(\r\n data.data,\r\n data.rootUrl,\r\n data.fileName,\r\n (uri) =>\r\n new Promise((resolve, reject) => {\r\n const index = pendingExternalResources.length;\r\n pendingExternalResources.push({ resolve, reject });\r\n postMessage({ id: \"getExternalResource\", index: index, uri: uri });\r\n })\r\n ).then(\r\n (value) => {\r\n postMessage({ id: \"validate.resolve\", value: value });\r\n },\r\n (reason) => {\r\n postMessage({ id: \"validate.reject\", reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"getExternalResource.resolve\": {\r\n pendingExternalResources[data.index].resolve(data.value);\r\n break;\r\n }\r\n case \"getExternalResource.reject\": {\r\n pendingExternalResources[data.index].reject(data.reason);\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Configuration for glTF validation\r\n */\r\nexport interface IGLTFValidationConfiguration {\r\n /**\r\n * The url of the glTF validator.\r\n */\r\n url: string;\r\n}\r\n\r\n/**\r\n * glTF validation\r\n */\r\nexport class GLTFValidation {\r\n /**\r\n * The configuration. Defaults to `{ url: \"https://preview.babylonjs.com/gltf_validator.js\" }`.\r\n */\r\n public static Configuration: IGLTFValidationConfiguration = {\r\n url: \"https://preview.babylonjs.com/gltf_validator.js\",\r\n };\r\n\r\n private static _LoadScriptPromise: Promise<void>;\r\n\r\n /**\r\n * Validate a glTF asset using the glTF-Validator.\r\n * @param data The JSON of a glTF or the array buffer of a binary glTF\r\n * @param rootUrl The root url for the glTF\r\n * @param fileName The file name for the glTF\r\n * @param getExternalResource The callback to get external resources for the glTF validator\r\n * @returns A promise that resolves with the glTF validation results once complete\r\n */\r\n public static ValidateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n ): Promise<GLTF2.IGLTFValidationResults> {\r\n if (typeof Worker === \"function\") {\r\n return new Promise((resolve, reject) => {\r\n const workerContent = `${validateAsync}(${workerFunc})()`;\r\n const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: \"application/javascript\" }));\r\n const worker = new Worker(workerBlobUrl);\r\n\r\n const onError = (error: ErrorEvent) => {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(error);\r\n };\r\n\r\n const onMessage = (message: MessageEvent) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"getExternalResource\": {\r\n getExternalResource(data.uri).then(\r\n (value) => {\r\n worker.postMessage({ id: \"getExternalResource.resolve\", index: data.index, value: value }, [value]);\r\n },\r\n (reason) => {\r\n worker.postMessage({ id: \"getExternalResource.reject\", index: data.index, reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"validate.resolve\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n resolve(data.value);\r\n worker.terminate();\r\n break;\r\n }\r\n case \"validate.reject\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(data.reason);\r\n worker.terminate();\r\n }\r\n }\r\n };\r\n\r\n worker.addEventListener(\"error\", onError);\r\n worker.addEventListener(\"message\", onMessage);\r\n\r\n worker.postMessage({ id: \"init\", url: this.Configuration.url });\r\n worker.postMessage({ id: \"validate\", data: data, rootUrl: rootUrl, fileName: fileName });\r\n });\r\n } else {\r\n if (!this._LoadScriptPromise) {\r\n this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);\r\n }\r\n\r\n return this._LoadScriptPromise.then(() => {\r\n return validateAsync(data, rootUrl, fileName, getExternalResource);\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
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";
|
5
|
-
export { GLTF1, GLTF2 };
|
1
|
+
export * from "./glTFFileLoader";
|
2
|
+
export * from "./glTFValidation";
|
3
|
+
import * as GLTF1 from "./1.0/index";
|
4
|
+
import * as GLTF2 from "./2.0/index";
|
5
|
+
export { GLTF1, GLTF2 };
|
package/glTF/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
export * from "./
|
3
|
-
|
4
|
-
import * as
|
5
|
-
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
2
|
+
export * from "./glTFFileLoader.js";
|
3
|
+
export * from "./glTFValidation.js";
|
4
|
+
import * as GLTF1 from "./1.0/index.js";
|
5
|
+
import * as GLTF2 from "./2.0/index.js";
|
6
|
+
export { GLTF1, GLTF2 };
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/glTF/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/glTF/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC","sourcesContent":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/glTF/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./glTFFileLoader\";\r\nexport * from \"./glTFValidation\";\r\nimport * as GLTF1 from \"./1.0/index\";\r\nimport * as GLTF2 from \"./2.0/index\";\r\nexport { GLTF1, GLTF2 };\r\n"]}
|
package/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from "./glTF/index";
|
2
|
-
export * from "./OBJ/index";
|
3
|
-
export * from "./STL/index";
|
1
|
+
export * from "./glTF/index";
|
2
|
+
export * from "./OBJ/index";
|
3
|
+
export * from "./STL/index";
|
package/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
2
|
-
export * from "./
|
3
|
-
export * from "./
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
2
|
+
export * from "./glTF/index.js";
|
3
|
+
export * from "./OBJ/index.js";
|
4
|
+
export * from "./STL/index.js";
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lts/loaders/generated/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lts/loaders/generated/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./glTF/index\";\r\nexport * from \"./OBJ/index\";\r\nexport * from \"./STL/index\";\r\n"]}
|
package/legacy/legacy-glTF.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "
|
2
|
-
export * from "
|
1
|
+
export * from "../glTF/glTFFileLoader";
|
2
|
+
export * from "../glTF/glTFValidation";
|
package/legacy/legacy-glTF.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import * as FileLoader from "
|
2
|
-
import * as Validation from "
|
3
|
-
/**
|
4
|
-
* This is the entry point for the UMD module.
|
5
|
-
* The entry point for a future ESM package should be index.ts
|
6
|
-
*/
|
7
|
-
var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
|
8
|
-
if (typeof globalObject !== "undefined") {
|
9
|
-
globalObject.BABYLON = globalObject.BABYLON || {};
|
10
|
-
for (var key in FileLoader) {
|
11
|
-
globalObject.BABYLON[key] = FileLoader[key];
|
12
|
-
}
|
13
|
-
for (var key in Validation) {
|
14
|
-
globalObject.BABYLON[key] = Validation[key];
|
15
|
-
}
|
16
|
-
}
|
17
|
-
export * from "
|
18
|
-
export * from "
|
1
|
+
import * as FileLoader from "../glTF/glTFFileLoader.js";
|
2
|
+
import * as Validation from "../glTF/glTFValidation.js";
|
3
|
+
/**
|
4
|
+
* This is the entry point for the UMD module.
|
5
|
+
* The entry point for a future ESM package should be index.ts
|
6
|
+
*/
|
7
|
+
var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
|
8
|
+
if (typeof globalObject !== "undefined") {
|
9
|
+
globalObject.BABYLON = globalObject.BABYLON || {};
|
10
|
+
for (var key in FileLoader) {
|
11
|
+
globalObject.BABYLON[key] = FileLoader[key];
|
12
|
+
}
|
13
|
+
for (var key in Validation) {
|
14
|
+
globalObject.BABYLON[key] = Validation[key];
|
15
|
+
}
|
16
|
+
}
|
17
|
+
export * from "../glTF/glTFFileLoader.js";
|
18
|
+
export * from "../glTF/glTFValidation.js";
|
19
19
|
//# sourceMappingURL=legacy-glTF.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,
|
1
|
+
{"version":3,"file":"legacy-glTF.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAChE,KAAK,IAAM,GAAG,IAAI,UAAU,EAAE;QACpB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;IACD,KAAK,IAAM,GAAG,IAAI,UAAU,EAAE;QACpB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;CACJ;AACD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["import * as FileLoader from \"../glTF/glTFFileLoader\";\nimport * as Validation from \"../glTF/glTFValidation\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\n for (const key in FileLoader) {\n (<any>globalObject).BABYLON[key] = (<any>FileLoader)[key];\n }\n for (const key in Validation) {\n (<any>globalObject).BABYLON[key] = (<any>Validation)[key];\n }\n}\nexport * from \"../glTF/glTFFileLoader\";\nexport * from \"../glTF/glTFValidation\";\n"]}
|
package/legacy/legacy-glTF1.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import * as GLTF1 from "
|
2
|
-
export { GLTF1 };
|
1
|
+
import * as GLTF1 from "../glTF/1.0/index";
|
2
|
+
export { GLTF1 };
|
package/legacy/legacy-glTF1.js
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
*
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
globalObject.BABYLON
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
2
|
+
import * as GLTF1 from "../glTF/1.0/index.js";
|
3
|
+
/**
|
4
|
+
* This is the entry point for the UMD module.
|
5
|
+
* The entry point for a future ESM package should be index.ts
|
6
|
+
*/
|
7
|
+
var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
|
8
|
+
if (typeof globalObject !== "undefined") {
|
9
|
+
globalObject.BABYLON = globalObject.BABYLON || {};
|
10
|
+
globalObject.BABYLON.GLTF1 = globalObject.BABYLON.GLTF1 || {};
|
11
|
+
for (var key in GLTF1) {
|
12
|
+
globalObject.BABYLON.GLTF1[key] = GLTF1[key];
|
13
|
+
}
|
14
|
+
}
|
15
|
+
export { GLTF1 };
|
15
16
|
//# sourceMappingURL=legacy-glTF1.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF1.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,
|
1
|
+
{"version":3,"file":"legacy-glTF1.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF1.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C;;;GAGG;AACH,IAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAC1D,YAAa,CAAC,OAAO,CAAC,KAAK,GAAS,YAAa,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;IAC5E,KAAK,IAAM,GAAG,IAAI,KAAK,EAAE;QACf,YAAa,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAS,KAAM,CAAC,GAAG,CAAC,CAAC;KAC9D;CACJ;AACD,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as GLTF1 from \"../glTF/1.0/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\n (<any>globalObject).BABYLON.GLTF1 = (<any>globalObject).BABYLON.GLTF1 || {};\n for (const key in GLTF1) {\n (<any>globalObject).BABYLON.GLTF1[key] = (<any>GLTF1)[key];\n }\n}\nexport { GLTF1 };\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF1";
|
1
|
+
export * from "./legacy-glTF";
|
2
|
+
export * from "./legacy-glTF1";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// eslint-disable-next-line import/export
|
2
|
-
export * from "./legacy-glTF.js";
|
3
|
-
export * from "./legacy-glTF1.js";
|
1
|
+
// eslint-disable-next-line import/export
|
2
|
+
export * from "./legacy-glTF.js";
|
3
|
+
export * from "./legacy-glTF1.js";
|
4
4
|
//# sourceMappingURL=legacy-glTF1FileLoader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF1FileLoader.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF1FileLoader.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["// eslint-disable-next-line import/export\
|
1
|
+
{"version":3,"file":"legacy-glTF1FileLoader.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF1FileLoader.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["// eslint-disable-next-line import/export\nexport * from \"./legacy-glTF\";\nexport * from \"./legacy-glTF1\";\n"]}
|
package/legacy/legacy-glTF2.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import * as GLTF2 from "
|
2
|
-
export { GLTF2 };
|
1
|
+
import * as GLTF2 from "../glTF/2.0/index";
|
2
|
+
export { GLTF2 };
|
package/legacy/legacy-glTF2.js
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
|
2
|
-
import * as
|
3
|
-
import * as
|
4
|
-
|
5
|
-
|
6
|
-
*
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
BABYLON_1
|
13
|
-
BABYLON_1.GLTF2
|
14
|
-
BABYLON_1.GLTF2.Loader
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
}
|
32
|
-
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
2
|
+
import * as Extensions from "../glTF/2.0/Extensions/index.js";
|
3
|
+
import * as Interfaces from "../glTF/2.0/glTFLoaderInterfaces.js";
|
4
|
+
import * as GLTF2 from "../glTF/2.0/index.js";
|
5
|
+
/**
|
6
|
+
* This is the entry point for the UMD module.
|
7
|
+
* The entry point for a future ESM package should be index.ts
|
8
|
+
*/
|
9
|
+
var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
|
10
|
+
if (typeof globalObject !== "undefined") {
|
11
|
+
globalObject.BABYLON = globalObject.BABYLON || {};
|
12
|
+
var BABYLON_1 = globalObject.BABYLON;
|
13
|
+
BABYLON_1.GLTF2 = BABYLON_1.GLTF2 || {};
|
14
|
+
BABYLON_1.GLTF2.Loader = BABYLON_1.GLTF2.Loader || {};
|
15
|
+
BABYLON_1.GLTF2.Loader.Extensions = BABYLON_1.GLTF2.Loader.Extensions || {};
|
16
|
+
var keys = [];
|
17
|
+
for (var key in Extensions) {
|
18
|
+
BABYLON_1.GLTF2.Loader.Extensions[key] = Extensions[key];
|
19
|
+
keys.push(key);
|
20
|
+
}
|
21
|
+
for (var key in Interfaces) {
|
22
|
+
BABYLON_1.GLTF2.Loader[key] = Interfaces[key];
|
23
|
+
keys.push(key);
|
24
|
+
}
|
25
|
+
for (var key in GLTF2) {
|
26
|
+
// Prevent Reassignment.
|
27
|
+
if (keys.indexOf(key) > -1) {
|
28
|
+
continue;
|
29
|
+
}
|
30
|
+
BABYLON_1.GLTF2[key] = GLTF2[key];
|
31
|
+
}
|
32
|
+
}
|
33
|
+
export { GLTF2 };
|
33
34
|
//# sourceMappingURL=legacy-glTF2.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF2.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF2.ts"],"names":[],"mappings":"AAAA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CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB;IACD,KAAK,IAAM,GAAG,IAAI,KAAK,EAAE;QACrB,wBAAwB;QACxB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;YACxB,SAAS;SACZ;QACD,SAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAS,KAAM,CAAC,GAAG,CAAC,CAAC;KAC1C;CACJ;AACD,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport * as Extensions from \"../glTF/2.0/Extensions/index\";\nimport * as Interfaces from \"../glTF/2.0/glTFLoaderInterfaces\";\nimport * as GLTF2 from \"../glTF/2.0/index\";\n/**\n * This is the entry point for the UMD module.\n * The entry point for a future ESM package should be index.ts\n */\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\nif (typeof globalObject !== \"undefined\") {\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\n const BABYLON = (<any>globalObject).BABYLON;\n BABYLON.GLTF2 = BABYLON.GLTF2 || {};\n BABYLON.GLTF2.Loader = BABYLON.GLTF2.Loader || {};\n BABYLON.GLTF2.Loader.Extensions = BABYLON.GLTF2.Loader.Extensions || {};\n const keys = [];\n for (const key in Extensions) {\n BABYLON.GLTF2.Loader.Extensions[key] = (<any>Extensions)[key];\n keys.push(key);\n }\n for (const key in Interfaces) {\n BABYLON.GLTF2.Loader[key] = (<any>Interfaces)[key];\n keys.push(key);\n }\n for (const key in GLTF2) {\n // Prevent Reassignment.\n if (keys.indexOf(key) > -1) {\n continue;\n }\n BABYLON.GLTF2[key] = (<any>GLTF2)[key];\n }\n}\nexport { GLTF2 };\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF2";
|
1
|
+
export * from "./legacy-glTF";
|
2
|
+
export * from "./legacy-glTF2";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// eslint-disable-next-line import/export
|
2
|
-
export * from "./legacy-glTF.js";
|
3
|
-
export * from "./legacy-glTF2.js";
|
1
|
+
// eslint-disable-next-line import/export
|
2
|
+
export * from "./legacy-glTF.js";
|
3
|
+
export * from "./legacy-glTF2.js";
|
4
4
|
//# sourceMappingURL=legacy-glTF2FileLoader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF2FileLoader.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF2FileLoader.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["// eslint-disable-next-line import/export\
|
1
|
+
{"version":3,"file":"legacy-glTF2FileLoader.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF2FileLoader.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["// eslint-disable-next-line import/export\nexport * from \"./legacy-glTF\";\nexport * from \"./legacy-glTF2\";\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from "./legacy-glTF";
|
2
|
-
export * from "./legacy-glTF1";
|
3
|
-
export * from "./legacy-glTF2";
|
1
|
+
export * from "./legacy-glTF";
|
2
|
+
export * from "./legacy-glTF1";
|
3
|
+
export * from "./legacy-glTF2";
|