@babylonjs/loaders 5.0.0-rc.1 → 5.0.0-rc.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/index.js +4 -4
  3. package/OBJ/index.js.map +1 -1
  4. package/OBJ/mtlFileLoader.d.ts +41 -40
  5. package/OBJ/mtlFileLoader.js +232 -231
  6. package/OBJ/mtlFileLoader.js.map +1 -1
  7. package/OBJ/objFileLoader.d.ts +126 -133
  8. package/OBJ/objFileLoader.js +296 -300
  9. package/OBJ/objFileLoader.js.map +1 -1
  10. package/OBJ/objLoadingOptions.d.ts +43 -43
  11. package/OBJ/objLoadingOptions.js +1 -1
  12. package/OBJ/objLoadingOptions.js.map +1 -1
  13. package/OBJ/solidParser.d.ts +154 -153
  14. package/OBJ/solidParser.js +693 -699
  15. package/OBJ/solidParser.js.map +1 -1
  16. package/STL/index.d.ts +1 -1
  17. package/STL/index.js +1 -1
  18. package/STL/index.js.map +1 -1
  19. package/STL/stlFileLoader.d.ts +64 -71
  20. package/STL/stlFileLoader.js +233 -239
  21. package/STL/stlFileLoader.js.map +1 -1
  22. package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
  23. package/glTF/1.0/glTFBinaryExtension.js +60 -61
  24. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  25. package/glTF/1.0/glTFLoader.d.ts +136 -106
  26. package/glTF/1.0/glTFLoader.js +1814 -1696
  27. package/glTF/1.0/glTFLoader.js.map +1 -1
  28. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
  29. package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
  30. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  31. package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
  32. package/glTF/1.0/glTFLoaderUtils.js +250 -232
  33. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  34. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
  35. package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -127
  36. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  37. package/glTF/1.0/index.d.ts +5 -5
  38. package/glTF/1.0/index.js +5 -5
  39. package/glTF/1.0/index.js.map +1 -1
  40. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -36
  41. package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -110
  42. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  43. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -28
  44. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -80
  45. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  46. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -27
  47. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -42
  48. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  49. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -21
  50. package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -32
  51. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  52. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -32
  53. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -55
  54. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -31
  56. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -101
  57. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -28
  59. package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -81
  60. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -31
  62. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -86
  63. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -30
  65. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -45
  66. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  67. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -34
  68. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -54
  69. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  70. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -30
  71. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -72
  72. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  73. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -31
  74. package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -76
  75. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  76. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -30
  77. package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -66
  78. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  79. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -31
  80. package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -76
  81. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  82. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -30
  83. package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -277
  84. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  85. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -30
  86. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -65
  87. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  88. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -76
  89. package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -243
  90. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  91. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -31
  92. package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -78
  93. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  94. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -19
  95. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -21
  96. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  97. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -21
  98. package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -32
  99. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  100. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -25
  101. package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -53
  102. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  103. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -29
  104. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -46
  105. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  106. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -38
  107. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -216
  108. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  109. package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -75
  110. package/glTF/2.0/Extensions/MSFT_lod.js +369 -333
  111. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  112. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
  113. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
  114. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  115. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
  116. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
  117. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  118. package/glTF/2.0/Extensions/index.d.ts +26 -26
  119. package/glTF/2.0/Extensions/index.js +26 -26
  120. package/glTF/2.0/Extensions/index.js.map +1 -1
  121. package/glTF/2.0/glTFLoader.d.ts +406 -357
  122. package/glTF/2.0/glTFLoader.js +2366 -2266
  123. package/glTF/2.0/glTFLoader.js.map +1 -1
  124. package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
  125. package/glTF/2.0/glTFLoaderExtension.js +1 -1
  126. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  127. package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -209
  128. package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
  129. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  130. package/glTF/2.0/index.d.ts +4 -4
  131. package/glTF/2.0/index.js +5 -4
  132. package/glTF/2.0/index.js.map +1 -1
  133. package/glTF/glTFFileLoader.d.ts +433 -373
  134. package/glTF/glTFFileLoader.js +927 -870
  135. package/glTF/glTFFileLoader.js.map +1 -1
  136. package/glTF/glTFValidation.d.ts +29 -29
  137. package/glTF/glTFValidation.js +123 -121
  138. package/glTF/glTFValidation.js.map +1 -1
  139. package/glTF/index.d.ts +5 -5
  140. package/glTF/index.js +6 -5
  141. package/glTF/index.js.map +1 -1
  142. package/index.d.ts +3 -3
  143. package/index.js +4 -3
  144. package/index.js.map +1 -1
  145. package/legacy/legacy-glTF.d.ts +2 -2
  146. package/legacy/legacy-glTF.js +18 -18
  147. package/legacy/legacy-glTF.js.map +1 -1
  148. package/legacy/legacy-glTF1.d.ts +2 -2
  149. package/legacy/legacy-glTF1.js +15 -14
  150. package/legacy/legacy-glTF1.js.map +1 -1
  151. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  152. package/legacy/legacy-glTF1FileLoader.js +3 -2
  153. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  154. package/legacy/legacy-glTF2.d.ts +2 -2
  155. package/legacy/legacy-glTF2.js +33 -32
  156. package/legacy/legacy-glTF2.js.map +1 -1
  157. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  158. package/legacy/legacy-glTF2FileLoader.js +3 -2
  159. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  160. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  161. package/legacy/legacy-glTFFileLoader.js +4 -3
  162. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  163. package/legacy/legacy-objFileLoader.d.ts +1 -1
  164. package/legacy/legacy-objFileLoader.js +13 -12
  165. package/legacy/legacy-objFileLoader.js.map +1 -1
  166. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  167. package/legacy/legacy-stlFileLoader.js +13 -12
  168. package/legacy/legacy-stlFileLoader.js.map +1 -1
  169. package/legacy/legacy.d.ts +6 -6
  170. package/legacy/legacy.js +8 -6
  171. package/legacy/legacy.js.map +1 -1
  172. package/license.md +71 -0
  173. package/package.json +37 -193
  174. package/readme.md +2 -2
@@ -1,122 +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)
10
- ? GLTFValidator.validateBytes(new Uint8Array(data), options)
11
- : GLTFValidator.validateString(data, options);
12
- }
13
- /**
14
- * The worker function that gets converted to a blob url to pass into a worker.
15
- */
16
- function workerFunc() {
17
- var pendingExternalResources = [];
18
- onmessage = function (message) {
19
- var data = message.data;
20
- switch (data.id) {
21
- case "init": {
22
- importScripts(data.url);
23
- break;
24
- }
25
- case "validate": {
26
- validateAsync(data.data, data.rootUrl, data.fileName, function (uri) { return new Promise(function (resolve, reject) {
27
- var index = pendingExternalResources.length;
28
- pendingExternalResources.push({ resolve: resolve, reject: reject });
29
- postMessage({ id: "getExternalResource", index: index, uri: uri });
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
- break;
90
- }
91
- case "validate.reject": {
92
- worker.removeEventListener("error", onError);
93
- worker.removeEventListener("message", onMessage);
94
- reject(data.reason);
95
- }
96
- }
97
- };
98
- worker.addEventListener("error", onError);
99
- worker.addEventListener("message", onMessage);
100
- worker.postMessage({ id: "init", url: _this.Configuration.url });
101
- worker.postMessage({ id: "validate", data: data, rootUrl: rootUrl, fileName: fileName });
102
- });
103
- }
104
- else {
105
- if (!this._LoadScriptPromise) {
106
- this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);
107
- }
108
- return this._LoadScriptPromise.then(function () {
109
- return validateAsync(data, rootUrl, fileName, getExternalResource);
110
- });
111
- }
112
- };
113
- /**
114
- * The configuration. Defaults to `{ url: "https://preview.babylonjs.com/gltf_validator.js" }`.
115
- */
116
- GLTFValidation.Configuration = {
117
- url: "https://preview.babylonjs.com/gltf_validator.js"
118
- };
119
- return GLTFValidation;
120
- }());
121
- 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 };
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,CAAC;IAEF,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAA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,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":"","sources":["../../../../../lts/loaders/generated/glTF/glTFValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AASxC,SAAS,aAAa,CAClB,IAA0B,E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,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";
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":["../../../sourceES6/loaders/src/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,EACH,KAAK,EACL,KAAK,EACR,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 {\r\n GLTF1,\r\n GLTF2\r\n};\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";
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":["../../sourceES6/loaders/src/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\";"]}
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";
2
- export * from "../glTF/glTFValidation";
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";
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":["../../../sourceES6/loaders/src/legacy/legacy-glTF.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAChE,KAAK,IAAI,GAAG,IAAI,UAAU,EAAE;QAClB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;IACD,KAAK,IAAI,GAAG,IAAI,UAAU,EAAE;QAClB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;CACJ;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["import * as FileLoader from \"../glTF/glTFFileLoader\";\r\nimport * as Validation from \"../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\nvar 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 (var key in FileLoader) {\r\n (<any>globalObject).BABYLON[key] = (<any>FileLoader)[key];\r\n }\r\n for (var key in Validation) {\r\n (<any>globalObject).BABYLON[key] = (<any>Validation)[key];\r\n }\r\n}\r\n\r\nexport * from \"../glTF/glTFFileLoader\";\r\nexport * from \"../glTF/glTFValidation\";"]}
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";
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";
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":["../../../sourceES6/loaders/src/legacy/legacy-glTF1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,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,IAAI,GAAG,IAAI,KAAK,EAAE;QACb,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 \"../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\nvar 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 (var key in GLTF1) {\r\n (<any>globalObject).BABYLON.GLTF1[key] = (<any>GLTF1)[key];\r\n }\r\n}\r\n\r\nexport { GLTF1 };"]}
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,3 +1,4 @@
1
- export * from "./legacy-glTF.js";
2
- export * from "./legacy-glTF1.js";
1
+ // eslint-disable-next-line import/export
2
+ export * from "./legacy-glTF";
3
+ export * from "./legacy-glTF1";
3
4
  //# sourceMappingURL=legacy-glTF1FileLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-glTF1FileLoader.js","sourceRoot":"","sources":["../../../sourceES6/loaders/src/legacy/legacy-glTF1FileLoader.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./legacy-glTF\";\r\nexport * from \"./legacy-glTF1\";"]}
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";
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 = globalObject.BABYLON;
12
- BABYLON.GLTF2 = BABYLON.GLTF2 || {};
13
- BABYLON.GLTF2.Loader = BABYLON.GLTF2.Loader || {};
14
- BABYLON.GLTF2.Loader.Extensions = BABYLON.GLTF2.Loader.Extensions || {};
15
- var keys = [];
16
- for (var key in Extensions) {
17
- BABYLON.GLTF2.Loader.Extensions[key] = Extensions[key];
18
- keys.push(key);
19
- }
20
- for (var key in Interfaces) {
21
- BABYLON.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.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";
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":["../../../sourceES6/loaders/src/legacy/legacy-glTF2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC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,KAAK,CAAC,GAAG,CAAC,GAAS,KAAM,CAAC,GAAG,CAAC,CAAC;KAC1C;CACJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import * as Extensions from \"../glTF/2.0/Extensions/index\";\r\nimport * as Interfaces from \"../glTF/2.0/glTFLoaderInterfaces\";\r\nimport * as GLTF2 from \"../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\nvar 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 var 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 (var key in Extensions) {\r\n BABYLON.GLTF2.Loader.Extensions[key] = (<any>Extensions)[key];\r\n keys.push(key);\r\n }\r\n for (var key in Interfaces) {\r\n BABYLON.GLTF2.Loader[key] = (<any>Interfaces)[key];\r\n keys.push(key);\r\n }\r\n\r\n for (var 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 };"]}
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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C;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,3 +1,4 @@
1
- export * from "./legacy-glTF.js";
2
- export * from "./legacy-glTF2.js";
1
+ // eslint-disable-next-line import/export
2
+ export * from "./legacy-glTF";
3
+ export * from "./legacy-glTF2";
3
4
  //# sourceMappingURL=legacy-glTF2FileLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"legacy-glTF2FileLoader.js","sourceRoot":"","sources":["../../../sourceES6/loaders/src/legacy/legacy-glTF2FileLoader.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./legacy-glTF\";\r\nexport * from \"./legacy-glTF2\";"]}
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";