@babylonjs/loaders 5.0.0-rc.7 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/index.js +4 -4
  3. package/OBJ/mtlFileLoader.d.ts +41 -41
  4. package/OBJ/mtlFileLoader.js +232 -232
  5. package/OBJ/mtlFileLoader.js.map +1 -1
  6. package/OBJ/objFileLoader.d.ts +126 -126
  7. package/OBJ/objFileLoader.js +296 -296
  8. package/OBJ/objFileLoader.js.map +1 -1
  9. package/OBJ/objLoadingOptions.d.ts +43 -43
  10. package/OBJ/objLoadingOptions.js +1 -1
  11. package/OBJ/objLoadingOptions.js.map +1 -1
  12. package/OBJ/solidParser.d.ts +154 -154
  13. package/OBJ/solidParser.js +693 -693
  14. package/OBJ/solidParser.js.map +1 -1
  15. package/STL/index.d.ts +1 -1
  16. package/STL/index.js +1 -1
  17. package/STL/stlFileLoader.d.ts +64 -64
  18. package/STL/stlFileLoader.js +233 -233
  19. package/STL/stlFileLoader.js.map +1 -1
  20. package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
  21. package/glTF/1.0/glTFBinaryExtension.js +60 -60
  22. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  23. package/glTF/1.0/glTFLoader.d.ts +136 -136
  24. package/glTF/1.0/glTFLoader.js +1814 -1815
  25. package/glTF/1.0/glTFLoader.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
  27. package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
  28. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  29. package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
  30. package/glTF/1.0/glTFLoaderUtils.js +250 -250
  31. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  32. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
  33. package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
  34. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  35. package/glTF/1.0/index.d.ts +5 -5
  36. package/glTF/1.0/index.js +5 -5
  37. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
  38. package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
  39. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  40. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
  41. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
  42. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  43. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
  44. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
  45. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  46. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
  47. package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
  48. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  49. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
  50. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
  51. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  52. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
  53. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
  54. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
  56. package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
  57. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
  59. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
  60. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
  62. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
  63. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
  65. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
  66. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  67. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
  68. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
  69. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  70. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
  71. package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
  72. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  73. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
  74. package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
  75. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  76. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
  77. package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
  78. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  79. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
  80. package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
  81. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  82. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
  83. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
  84. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  85. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
  86. package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
  87. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  88. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
  89. package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
  90. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  91. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
  92. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
  93. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  94. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
  95. package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
  96. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  97. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
  98. package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
  99. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  100. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
  101. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
  102. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  103. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
  104. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
  105. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  106. package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
  107. package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
  108. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  109. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
  110. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
  111. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  112. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
  113. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
  114. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  115. package/glTF/2.0/Extensions/index.d.ts +26 -26
  116. package/glTF/2.0/Extensions/index.js +26 -26
  117. package/glTF/2.0/glTFLoader.d.ts +406 -405
  118. package/glTF/2.0/glTFLoader.js +2366 -2366
  119. package/glTF/2.0/glTFLoader.js.map +1 -1
  120. package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
  121. package/glTF/2.0/glTFLoaderExtension.js +1 -1
  122. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  123. package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
  124. package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
  125. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  126. package/glTF/2.0/index.d.ts +4 -4
  127. package/glTF/2.0/index.js +5 -4
  128. package/glTF/2.0/index.js.map +1 -1
  129. package/glTF/glTFFileLoader.d.ts +433 -433
  130. package/glTF/glTFFileLoader.js +927 -927
  131. package/glTF/glTFFileLoader.js.map +1 -1
  132. package/glTF/glTFValidation.d.ts +29 -29
  133. package/glTF/glTFValidation.js +123 -123
  134. package/glTF/glTFValidation.js.map +1 -1
  135. package/glTF/index.d.ts +5 -5
  136. package/glTF/index.js +6 -5
  137. package/glTF/index.js.map +1 -1
  138. package/index.d.ts +3 -3
  139. package/index.js +4 -3
  140. package/index.js.map +1 -1
  141. package/legacy/legacy-glTF.d.ts +2 -2
  142. package/legacy/legacy-glTF.js +18 -18
  143. package/legacy/legacy-glTF.js.map +1 -1
  144. package/legacy/legacy-glTF1.d.ts +2 -2
  145. package/legacy/legacy-glTF1.js +15 -14
  146. package/legacy/legacy-glTF1.js.map +1 -1
  147. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  148. package/legacy/legacy-glTF1FileLoader.js +3 -3
  149. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  150. package/legacy/legacy-glTF2.d.ts +2 -2
  151. package/legacy/legacy-glTF2.js +33 -32
  152. package/legacy/legacy-glTF2.js.map +1 -1
  153. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  154. package/legacy/legacy-glTF2FileLoader.js +3 -3
  155. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  156. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  157. package/legacy/legacy-glTFFileLoader.js +4 -4
  158. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  159. package/legacy/legacy-objFileLoader.d.ts +1 -1
  160. package/legacy/legacy-objFileLoader.js +13 -12
  161. package/legacy/legacy-objFileLoader.js.map +1 -1
  162. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  163. package/legacy/legacy-stlFileLoader.js +13 -12
  164. package/legacy/legacy-stlFileLoader.js.map +1 -1
  165. package/legacy/legacy.d.ts +6 -6
  166. package/legacy/legacy.js +8 -7
  167. package/legacy/legacy.js.map +1 -1
  168. package/license.md +71 -0
  169. package/package.json +25 -6
@@ -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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AO,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 * 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":"AAC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AC,OAAO,EAAE,OAAO,CAAC,CAAC;4BAC7C,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;4BACjD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;4BACpB,MAAM,CAAC,SAAS,EAAE,CAAC;yBACtB;qBACJ;gBACL,CAAC,CAAC;gBAEF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,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
- export * from "./glTFFileLoader.js";
2
- export * from "./glTFValidation.js";
3
- import * as GLTF1 from "./1.0/index.js";
4
- import * as GLTF2 from "./2.0/index.js";
5
- export { GLTF1, GLTF2 };
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":["export * 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"]}
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
- export * from "./glTF/index.js";
2
- export * from "./OBJ/index.js";
3
- export * from "./STL/index.js";
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":["export * from \"./glTF/index\";\r\nexport * from \"./OBJ/index\";\r\nexport * from \"./STL/index\";\r\n"]}
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"]}
@@ -1,2 +1,2 @@
1
- export * from "./glTF/glTFFileLoader.js";
2
- export * from "./glTF/glTFValidation.js";
1
+ export * from "../glTF/glTFFileLoader";
2
+ export * from "../glTF/glTFValidation";
@@ -1,19 +1,19 @@
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";
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,iCAAoC;AAC1D,OAAO,KAAK,UAAU,iCAAoC;AAE1D;;;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;AAED,yCAA4C;AAC5C,yCAA4C","sourcesContent":["import * as FileLoader from \"loaders/glTF/glTFFileLoader\";\r\nimport * as Validation from \"loaders/glTF/glTFValidation\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\r\n for (const key in FileLoader) {\r\n (<any>globalObject).BABYLON[key] = (<any>FileLoader)[key];\r\n }\r\n for (const key in Validation) {\r\n (<any>globalObject).BABYLON[key] = (<any>Validation)[key];\r\n }\r\n}\r\n\r\nexport * from \"loaders/glTF/glTFFileLoader\";\r\nexport * from \"loaders/glTF/glTFValidation\";\r\n"]}
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"]}
@@ -1,2 +1,2 @@
1
- import * as GLTF1 from "./glTF/1.0/index.js";
2
- export { GLTF1 };
1
+ import * as GLTF1 from "../glTF/1.0/index";
2
+ export { GLTF1 };
@@ -1,15 +1,16 @@
1
- import * as GLTF1 from "./glTF/1.0/index.js";
2
- /**
3
- * This is the entry point for the UMD module.
4
- * The entry point for a future ESM package should be index.ts
5
- */
6
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
7
- if (typeof globalObject !== "undefined") {
8
- globalObject.BABYLON = globalObject.BABYLON || {};
9
- globalObject.BABYLON.GLTF1 = globalObject.BABYLON.GLTF1 || {};
10
- for (var key in GLTF1) {
11
- globalObject.BABYLON.GLTF1[key] = GLTF1[key];
12
- }
13
- }
14
- export { GLTF1 };
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,4BAA+B;AAEhD;;;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;AAED,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import * as GLTF1 from \"loaders/glTF/1.0/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\r\n (<any>globalObject).BABYLON.GLTF1 = (<any>globalObject).BABYLON.GLTF1 || {};\r\n for (const key in GLTF1) {\r\n (<any>globalObject).BABYLON.GLTF1[key] = (<any>GLTF1)[key];\r\n }\r\n}\r\n\r\nexport { GLTF1 };\r\n"]}
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\r\nexport * from \"./legacy-glTF\";\r\nexport * from \"./legacy-glTF1\";\r\n"]}
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"]}
@@ -1,2 +1,2 @@
1
- import * as GLTF2 from "./glTF/2.0/index.js";
2
- export { GLTF2 };
1
+ import * as GLTF2 from "../glTF/2.0/index";
2
+ export { GLTF2 };
@@ -1,33 +1,34 @@
1
- import * as Extensions from "./glTF/2.0/Extensions/index.js";
2
- import * as Interfaces from "./glTF/2.0/glTFLoaderInterfaces.js";
3
- import * as GLTF2 from "./glTF/2.0/index.js";
4
- /**
5
- * This is the entry point for the UMD module.
6
- * The entry point for a future ESM package should be index.ts
7
- */
8
- var globalObject = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : undefined;
9
- if (typeof globalObject !== "undefined") {
10
- globalObject.BABYLON = globalObject.BABYLON || {};
11
- var BABYLON_1 = globalObject.BABYLON;
12
- BABYLON_1.GLTF2 = BABYLON_1.GLTF2 || {};
13
- BABYLON_1.GLTF2.Loader = BABYLON_1.GLTF2.Loader || {};
14
- BABYLON_1.GLTF2.Loader.Extensions = BABYLON_1.GLTF2.Loader.Extensions || {};
15
- var keys = [];
16
- for (var key in Extensions) {
17
- BABYLON_1.GLTF2.Loader.Extensions[key] = Extensions[key];
18
- keys.push(key);
19
- }
20
- for (var key in Interfaces) {
21
- BABYLON_1.GLTF2.Loader[key] = Interfaces[key];
22
- keys.push(key);
23
- }
24
- for (var key in GLTF2) {
25
- // Prevent Reassignment.
26
- if (keys.indexOf(key) > -1) {
27
- continue;
28
- }
29
- BABYLON_1.GLTF2[key] = GLTF2[key];
30
- }
31
- }
32
- export { GLTF2 };
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,OAAO,KAAK,UAAU,uCAA0C;AAChE,OAAO,KAAK,UAA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AO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAS,KAAM,CAAC,GAAG,CAAC,CAAC;KAC1C;CACJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import * as Extensions from \"loaders/glTF/2.0/Extensions/index\";\r\nimport * as Interfaces from \"loaders/glTF/2.0/glTFLoaderInterfaces\";\r\nimport * as GLTF2 from \"loaders/glTF/2.0/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\r\n const BABYLON = (<any>globalObject).BABYLON;\r\n BABYLON.GLTF2 = BABYLON.GLTF2 || {};\r\n BABYLON.GLTF2.Loader = BABYLON.GLTF2.Loader || {};\r\n BABYLON.GLTF2.Loader.Extensions = BABYLON.GLTF2.Loader.Extensions || {};\r\n\r\n const keys = [];\r\n for (const key in Extensions) {\r\n BABYLON.GLTF2.Loader.Extensions[key] = (<any>Extensions)[key];\r\n keys.push(key);\r\n }\r\n for (const key in Interfaces) {\r\n BABYLON.GLTF2.Loader[key] = (<any>Interfaces)[key];\r\n keys.push(key);\r\n }\r\n\r\n for (const key in GLTF2) {\r\n // Prevent Reassignment.\r\n if (keys.indexOf(key) > -1) {\r\n continue;\r\n }\r\n\r\n BABYLON.GLTF2[key] = (<any>GLTF2)[key];\r\n }\r\n}\r\n\r\nexport { GLTF2 };\r\n"]}
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;;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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\r\nexport * from \"./legacy-glTF\";\r\nexport * from \"./legacy-glTF2\";\r\n"]}
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";