@babylonjs/loaders 5.0.0-beta.9 → 5.0.0-rc.10
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/index.js +4 -4
- package/OBJ/index.js.map +1 -1
- package/OBJ/mtlFileLoader.d.ts +41 -40
- package/OBJ/mtlFileLoader.js +232 -221
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.d.ts +126 -133
- package/OBJ/objFileLoader.js +296 -300
- 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 -153
- package/OBJ/solidParser.js +693 -699
- package/OBJ/solidParser.js.map +1 -1
- package/STL/index.d.ts +1 -1
- package/STL/index.js +1 -1
- package/STL/index.js.map +1 -1
- package/STL/stlFileLoader.d.ts +64 -71
- package/STL/stlFileLoader.js +233 -239
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -61
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +136 -106
- package/glTF/1.0/glTFLoader.js +1814 -1696
- 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 -232
- 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 -127
- 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/1.0/index.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -36
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -110
- 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 -27
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -79
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -27
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -42
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -21
- package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -32
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -32
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -55
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -101
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -28
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -81
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -86
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -45
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -34
- package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -54
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -72
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -76
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -66
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -76
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -277
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -65
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -76
- package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -243
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -78
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -19
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -21
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -21
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -32
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -25
- package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -53
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -29
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -46
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -38
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -216
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -75
- package/glTF/2.0/Extensions/MSFT_lod.js +369 -333
- 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/Extensions/index.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +406 -357
- package/glTF/2.0/glTFLoader.js +2366 -2249
- 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 -209
- 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 -368
- package/glTF/glTFFileLoader.js +927 -869
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -121
- 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 -2
- 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 -2
- package/legacy/legacy-glTF2FileLoader.js.map +1 -1
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -3
- 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 -6
- package/legacy/legacy.js.map +1 -1
- package/package.json +23 -198
- package/readme.md +2 -2
package/glTF/glTFValidation.js
CHANGED
@@ -1,122 +1,124 @@
|
|
1
|
-
import { Tools } from
|
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 =
|
8
|
-
}
|
9
|
-
return
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
function
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
})
|
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
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
worker.removeEventListener("
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
worker.
|
101
|
-
worker.
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
}
|
121
|
-
|
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 };
|
122
124
|
//# sourceMappingURL=glTFValidation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFValidation.js","sourceRoot":"","sources":["../../../sourceES6/loaders/src/glTF/glTFValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAQnD,SAAS,aAAa,CAAC,IAA0B,EAAE,OAAe,EAAE,QAAgB,EAAE,mBAA0D;IAC5I,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,CAA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,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;aACI;YACD,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;IAvED;;OAEG;IACW,4BAAa,GAAiC;QACxD,GAAG,EAAE,iDAAiD;KACzD,CAAC;IAmEN,qBAAC;CAAA,AAzED,IAyEC;SAzEY,cAAc","sourcesContent":["import * as GLTF2 from 'babylonjs-gltf2interface';\r\nimport { Tools } from '@babylonjs/core/Misc/tools';\r\n\r\ndeclare var 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(data: string | ArrayBuffer, rootUrl: string, fileName: string, getExternalResource: (uri: string) => Promise<ArrayBuffer>): 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)\r\n ? GLTFValidator.validateBytes(new Uint8Array(data), options)\r\n : 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(data.data, data.rootUrl, data.fileName, (uri) => 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 })).then((value) => {\r\n postMessage({ id: \"validate.resolve\", value: value });\r\n }, (reason) => {\r\n postMessage({ id: \"validate.reject\", reason: reason });\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(data: string | ArrayBuffer, rootUrl: string, fileName: string, getExternalResource: (uri: string) => Promise<ArrayBuffer>): 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((value) => {\r\n worker.postMessage({ id: \"getExternalResource.resolve\", index: data.index, value: value }, [value]);\r\n }, (reason) => {\r\n worker.postMessage({ id: \"getExternalResource.reject\", index: data.index, reason: reason });\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 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 }\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 }\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":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\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";
|
3
|
+
export * from "./glTFValidation";
|
4
|
+
import * as GLTF1 from "./1.0/index";
|
5
|
+
import * as GLTF2 from "./2.0/index";
|
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":["
|
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";
|
3
|
+
export * from "./OBJ/index";
|
4
|
+
export * from "./STL/index";
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
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 "../glTF/glTFFileLoader";
|
2
|
-
export * from "../glTF/glTFValidation";
|
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 "../glTF/glTFFileLoader
|
2
|
-
import * as Validation from "../glTF/glTFValidation
|
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 =
|
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
|
18
|
-
export * from "../glTF/glTFValidation
|
1
|
+
import * as FileLoader from "../glTF/glTFFileLoader";
|
2
|
+
import * as Validation from "../glTF/glTFValidation";
|
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";
|
18
|
+
export * from "../glTF/glTFValidation";
|
19
19
|
//# sourceMappingURL=legacy-glTF.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF.js","sourceRoot":"","sources":["
|
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 "../glTF/1.0/index";
|
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";
|
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":["
|
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 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF1FileLoader.js","sourceRoot":"","sources":["
|
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 "../glTF/2.0/index";
|
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
|
-
|
13
|
-
|
14
|
-
|
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";
|
3
|
+
import * as Interfaces from "../glTF/2.0/glTFLoaderInterfaces";
|
4
|
+
import * as GLTF2 from "../glTF/2.0/index";
|
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":["
|
1
|
+
{"version":3,"file":"legacy-glTF2.js","sourceRoot":"","sources":["../../../../../lts/loaders/generated/legacy/legacy-glTF2.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,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;IAChE,IAAM,SAAO,GAAS,YAAa,CAAC,OAAO,CAAC;IAC5C,SAAO,CAAC,KAAK,GAAG,SAAO,CAAC,KAAK,IAAI,EAAE,CAAC;IACpC,SAAO,CAAC,KAAK,CAAC,MAAM,GAAG,SAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;IAClD,SAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,SAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IACxE,IAAM,IAAI,GAAG,EAAE,CAAC;IAChB,KAAK,IAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,SAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB;IACD,KAAK,IAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,SAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAS,UAAW,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 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF2FileLoader.js","sourceRoot":"","sources":["
|
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";
|