@babylonjs/serializers 5.0.0-rc.7 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/OBJ/index.d.ts +1 -1
  2. package/OBJ/index.js +1 -1
  3. package/OBJ/objSerializer.d.ts +21 -21
  4. package/OBJ/objSerializer.js +174 -174
  5. package/OBJ/objSerializer.js.map +1 -1
  6. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +41 -41
  7. package/glTF/2.0/Extensions/KHR_lights_punctual.js +189 -189
  8. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  9. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +24 -24
  10. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +90 -90
  11. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  12. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +24 -24
  13. package/glTF/2.0/Extensions/KHR_materials_sheen.js +73 -73
  14. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  15. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +20 -20
  16. package/glTF/2.0/Extensions/KHR_materials_unlit.js +51 -51
  17. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  18. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +30 -30
  19. package/glTF/2.0/Extensions/KHR_texture_transform.js +137 -137
  20. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  21. package/glTF/2.0/Extensions/index.d.ts +5 -5
  22. package/glTF/2.0/Extensions/index.js +5 -5
  23. package/glTF/2.0/glTFAnimation.d.ts +206 -205
  24. package/glTF/2.0/glTFAnimation.js +852 -852
  25. package/glTF/2.0/glTFAnimation.js.map +1 -1
  26. package/glTF/2.0/glTFData.d.ts +19 -19
  27. package/glTF/2.0/glTFData.js +52 -52
  28. package/glTF/2.0/glTFExporter.d.ts +456 -455
  29. package/glTF/2.0/glTFExporter.js +1975 -1972
  30. package/glTF/2.0/glTFExporter.js.map +1 -1
  31. package/glTF/2.0/glTFExporterExtension.d.ts +74 -74
  32. package/glTF/2.0/glTFExporterExtension.js +3 -3
  33. package/glTF/2.0/glTFExporterExtension.js.map +1 -1
  34. package/glTF/2.0/glTFMaterialExporter.d.ts +208 -207
  35. package/glTF/2.0/glTFMaterialExporter.js +1114 -1114
  36. package/glTF/2.0/glTFMaterialExporter.js.map +1 -1
  37. package/glTF/2.0/glTFSerializer.d.ts +60 -60
  38. package/glTF/2.0/glTFSerializer.js +62 -62
  39. package/glTF/2.0/glTFSerializer.js.map +1 -1
  40. package/glTF/2.0/glTFUtilities.d.ts +99 -97
  41. package/glTF/2.0/glTFUtilities.js +196 -196
  42. package/glTF/2.0/glTFUtilities.js.map +1 -1
  43. package/glTF/2.0/index.d.ts +8 -8
  44. package/glTF/2.0/index.js +9 -8
  45. package/glTF/2.0/index.js.map +1 -1
  46. package/glTF/2.0/shaders/textureTransform.fragment.d.ts +5 -5
  47. package/glTF/2.0/shaders/textureTransform.fragment.js +8 -8
  48. package/glTF/glTFFileExporter.d.ts +20 -20
  49. package/glTF/glTFFileExporter.js +3 -3
  50. package/glTF/index.d.ts +2 -2
  51. package/glTF/index.js +3 -2
  52. package/glTF/index.js.map +1 -1
  53. package/index.d.ts +3 -3
  54. package/index.js +4 -3
  55. package/index.js.map +1 -1
  56. package/legacy/legacy-glTF2Serializer.d.ts +2 -2
  57. package/legacy/legacy-glTF2Serializer.js +44 -43
  58. package/legacy/legacy-glTF2Serializer.js.map +1 -1
  59. package/legacy/legacy-objSerializer.d.ts +1 -1
  60. package/legacy/legacy-objSerializer.js +13 -12
  61. package/legacy/legacy-objSerializer.js.map +1 -1
  62. package/legacy/legacy-stlSerializer.d.ts +1 -1
  63. package/legacy/legacy-stlSerializer.js +13 -12
  64. package/legacy/legacy-stlSerializer.js.map +1 -1
  65. package/legacy/legacy.d.ts +4 -4
  66. package/legacy/legacy.js +6 -5
  67. package/legacy/legacy.js.map +1 -1
  68. package/license.md +71 -0
  69. package/package.json +25 -6
  70. package/stl/index.d.ts +1 -1
  71. package/stl/index.js +1 -1
  72. package/stl/stlSerializer.d.ts +17 -17
  73. package/stl/stlSerializer.js +107 -107
  74. package/stl/stlSerializer.js.map +1 -1
@@ -1,63 +1,63 @@
1
- import { _Exporter } from "./glTFExporter.js";
2
- /**
3
- * Class for generating glTF data from a Babylon scene.
4
- */
5
- var GLTF2Export = /** @class */ (function () {
6
- function GLTF2Export() {
7
- }
8
- /**
9
- * Exports the geometry of the scene to .gltf file format asynchronously
10
- * @param scene Babylon scene with scene hierarchy information
11
- * @param filePrefix File prefix to use when generating the glTF file
12
- * @param options Exporter options
13
- * @returns Returns an object with a .gltf file and associates texture names
14
- * as keys and their data and paths as values
15
- */
16
- GLTF2Export.GLTFAsync = function (scene, filePrefix, options) {
17
- return scene.whenReadyAsync().then(function () {
18
- var glTFPrefix = filePrefix.replace(/\.[^/.]+$/, "");
19
- var gltfGenerator = new _Exporter(scene, options);
20
- return gltfGenerator._generateGLTFAsync(glTFPrefix);
21
- });
22
- };
23
- GLTF2Export._PreExportAsync = function (scene, options) {
24
- return Promise.resolve().then(function () {
25
- if (options && options.exportWithoutWaitingForScene) {
26
- return Promise.resolve();
27
- }
28
- else {
29
- return scene.whenReadyAsync();
30
- }
31
- });
32
- };
33
- GLTF2Export._PostExportAsync = function (scene, glTFData, options) {
34
- return Promise.resolve().then(function () {
35
- if (options && options.exportWithoutWaitingForScene) {
36
- return glTFData;
37
- }
38
- else {
39
- return glTFData;
40
- }
41
- });
42
- };
43
- /**
44
- * Exports the geometry of the scene to .glb file format asychronously
45
- * @param scene Babylon scene with scene hierarchy information
46
- * @param filePrefix File prefix to use when generating glb file
47
- * @param options Exporter options
48
- * @returns Returns an object with a .glb filename as key and data as value
49
- */
50
- GLTF2Export.GLBAsync = function (scene, filePrefix, options) {
51
- var _this = this;
52
- return this._PreExportAsync(scene, options).then(function () {
53
- var glTFPrefix = filePrefix.replace(/\.[^/.]+$/, "");
54
- var gltfGenerator = new _Exporter(scene, options);
55
- return gltfGenerator._generateGLBAsync(glTFPrefix).then(function (glTFData) {
56
- return _this._PostExportAsync(scene, glTFData, options);
57
- });
58
- });
59
- };
60
- return GLTF2Export;
61
- }());
62
- export { GLTF2Export };
1
+ import { _Exporter } from "./glTFExporter.js";
2
+ /**
3
+ * Class for generating glTF data from a Babylon scene.
4
+ */
5
+ var GLTF2Export = /** @class */ (function () {
6
+ function GLTF2Export() {
7
+ }
8
+ /**
9
+ * Exports the geometry of the scene to .gltf file format asynchronously
10
+ * @param scene Babylon scene with scene hierarchy information
11
+ * @param filePrefix File prefix to use when generating the glTF file
12
+ * @param options Exporter options
13
+ * @returns Returns an object with a .gltf file and associates texture names
14
+ * as keys and their data and paths as values
15
+ */
16
+ GLTF2Export.GLTFAsync = function (scene, filePrefix, options) {
17
+ return scene.whenReadyAsync().then(function () {
18
+ var glTFPrefix = filePrefix.replace(/\.[^/.]+$/, "");
19
+ var gltfGenerator = new _Exporter(scene, options);
20
+ return gltfGenerator._generateGLTFAsync(glTFPrefix);
21
+ });
22
+ };
23
+ GLTF2Export._PreExportAsync = function (scene, options) {
24
+ return Promise.resolve().then(function () {
25
+ if (options && options.exportWithoutWaitingForScene) {
26
+ return Promise.resolve();
27
+ }
28
+ else {
29
+ return scene.whenReadyAsync();
30
+ }
31
+ });
32
+ };
33
+ GLTF2Export._PostExportAsync = function (scene, glTFData, options) {
34
+ return Promise.resolve().then(function () {
35
+ if (options && options.exportWithoutWaitingForScene) {
36
+ return glTFData;
37
+ }
38
+ else {
39
+ return glTFData;
40
+ }
41
+ });
42
+ };
43
+ /**
44
+ * Exports the geometry of the scene to .glb file format asychronously
45
+ * @param scene Babylon scene with scene hierarchy information
46
+ * @param filePrefix File prefix to use when generating glb file
47
+ * @param options Exporter options
48
+ * @returns Returns an object with a .glb filename as key and data as value
49
+ */
50
+ GLTF2Export.GLBAsync = function (scene, filePrefix, options) {
51
+ var _this = this;
52
+ return this._PreExportAsync(scene, options).then(function () {
53
+ var glTFPrefix = filePrefix.replace(/\.[^/.]+$/, "");
54
+ var gltfGenerator = new _Exporter(scene, options);
55
+ return gltfGenerator._generateGLBAsync(glTFPrefix).then(function (glTFData) {
56
+ return _this._PostExportAsync(scene, glTFData, options);
57
+ });
58
+ });
59
+ };
60
+ return GLTF2Export;
61
+ }());
62
+ export { GLTF2Export };
63
63
  //# sourceMappingURL=glTFSerializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glTFSerializer.js","sourceRoot":"","sources":["../../../../../../lts/serializers/generated/glTF/2.0/glTFSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyC3C;;GAEG;AACH;IAAA;IAqDA,CAAC;IApDG;;;;;;;OAOG;IACW,qBAAS,GAAvB,UAAwB,KAAY,EAAE,UAAkB,EAAE,OAAwB;QAC9E,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC;YAC/B,IAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACvD,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACpD,OAAO,aAAa,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC;IAEc,2BAAe,GAA9B,UAA+B,KAAY,EAAE,OAAwB;QACjE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;YAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,4BAA4B,EAAE;gBACjD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAC5B;iBAAM;gBACH,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC;aACjC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEc,4BAAgB,GAA/B,UAAgC,KAAY,EAAE,QAAkB,EAAE,OAAwB;QACtF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;YAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,4BAA4B,EAAE;gBACjD,OAAO,QAAQ,CAAC;aACnB;iBAAM;gBACH,OAAO,QAAQ,CAAC;aACnB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACW,oBAAQ,GAAtB,UAAuB,KAAY,EAAE,UAAkB,EAAE,OAAwB;QAAjF,iBAQC;QAPG,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;YAC7C,IAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACvD,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACpD,OAAO,aAAa,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAC,QAAQ;gBAC7D,OAAO,KAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,kBAAC;AAAD,CAAC,AArDD,IAqDC","sourcesContent":["import { Node } from \"core/node\";\r\nimport { Scene } from \"core/scene\";\r\nimport { GLTFData } from \"./glTFData\";\r\nimport { _Exporter } from \"./glTFExporter\";\r\n\r\n/**\r\n * Holds a collection of exporter options and parameters\r\n */\r\nexport interface IExportOptions {\r\n /**\r\n * Function which indicates whether a babylon node should be exported or not\r\n * @param node source Babylon node. It is used to check whether it should be exported to glTF or not\r\n * @returns boolean, which indicates whether the node should be exported (true) or not (false)\r\n */\r\n shouldExportNode?(node: Node): boolean;\r\n\r\n /**\r\n * Function used to extract the part of node's metadata that will be exported into glTF node extras\r\n * @param metadata source metadata to read from\r\n * @returns the data to store to glTF node extras\r\n */\r\n metadataSelector?(metadata: any): any;\r\n\r\n /**\r\n * The sample rate to bake animation curves\r\n */\r\n animationSampleRate?: number;\r\n\r\n /**\r\n * Begin serialization without waiting for the scene to be ready\r\n */\r\n exportWithoutWaitingForScene?: boolean;\r\n\r\n /**\r\n * Indicates if unused vertex uv attributes should be included in export\r\n */\r\n exportUnusedUVs?: boolean;\r\n\r\n /**\r\n * Indicates if coordinate system swapping root nodes should be included in export\r\n */\r\n includeCoordinateSystemConversionNodes?: boolean;\r\n}\r\n\r\n/**\r\n * Class for generating glTF data from a Babylon scene.\r\n */\r\nexport class GLTF2Export {\r\n /**\r\n * Exports the geometry of the scene to .gltf file format asynchronously\r\n * @param scene Babylon scene with scene hierarchy information\r\n * @param filePrefix File prefix to use when generating the glTF file\r\n * @param options Exporter options\r\n * @returns Returns an object with a .gltf file and associates texture names\r\n * as keys and their data and paths as values\r\n */\r\n public static GLTFAsync(scene: Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData> {\r\n return scene.whenReadyAsync().then(() => {\r\n const glTFPrefix = filePrefix.replace(/\\.[^/.]+$/, \"\");\r\n const gltfGenerator = new _Exporter(scene, options);\r\n return gltfGenerator._generateGLTFAsync(glTFPrefix);\r\n });\r\n }\r\n\r\n private static _PreExportAsync(scene: Scene, options?: IExportOptions): Promise<void> {\r\n return Promise.resolve().then(() => {\r\n if (options && options.exportWithoutWaitingForScene) {\r\n return Promise.resolve();\r\n } else {\r\n return scene.whenReadyAsync();\r\n }\r\n });\r\n }\r\n\r\n private static _PostExportAsync(scene: Scene, glTFData: GLTFData, options?: IExportOptions): Promise<GLTFData> {\r\n return Promise.resolve().then(() => {\r\n if (options && options.exportWithoutWaitingForScene) {\r\n return glTFData;\r\n } else {\r\n return glTFData;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports the geometry of the scene to .glb file format asychronously\r\n * @param scene Babylon scene with scene hierarchy information\r\n * @param filePrefix File prefix to use when generating glb file\r\n * @param options Exporter options\r\n * @returns Returns an object with a .glb filename as key and data as value\r\n */\r\n public static GLBAsync(scene: Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData> {\r\n return this._PreExportAsync(scene, options).then(() => {\r\n const glTFPrefix = filePrefix.replace(/\\.[^/.]+$/, \"\");\r\n const gltfGenerator = new _Exporter(scene, options);\r\n return gltfGenerator._generateGLBAsync(glTFPrefix).then((glTFData) => {\r\n return this._PostExportAsync(scene, glTFData, options);\r\n });\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"glTFSerializer.js","sourceRoot":"","sources":["../../../../../../lts/serializers/generated/glTF/2.0/glTFSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyC3C;;GAEG;AACH;IAAA;IAqDA,CAAC;IApDG;;;;;;;OAOG;IACW,qBAAS,GAAvB,UAAwB,KAAY,EAAE,UAAkB,EAAE,OAAwB;QAC9E,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC;YAC/B,IAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACvD,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACpD,OAAO,aAAa,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC;IAEc,2BAAe,GAA9B,UAA+B,KAAY,EAAE,OAAwB;QACjE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;YAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,4BAA4B,EAAE;gBACjD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAC5B;iBAAM;gBACH,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC;aACjC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEc,4BAAgB,GAA/B,UAAgC,KAAY,EAAE,QAAkB,EAAE,OAAwB;QACtF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;YAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,4BAA4B,EAAE;gBACjD,OAAO,QAAQ,CAAC;aACnB;iBAAM;gBACH,OAAO,QAAQ,CAAC;aACnB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACW,oBAAQ,GAAtB,UAAuB,KAAY,EAAE,UAAkB,EAAE,OAAwB;QAAjF,iBAQC;QAPG,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;YAC7C,IAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACvD,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACpD,OAAO,aAAa,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAC,QAAQ;gBAC7D,OAAO,KAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,kBAAC;AAAD,CAAC,AArDD,IAqDC","sourcesContent":["import type { Node } from \"core/node\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { GLTFData } from \"./glTFData\";\r\nimport { _Exporter } from \"./glTFExporter\";\r\n\r\n/**\r\n * Holds a collection of exporter options and parameters\r\n */\r\nexport interface IExportOptions {\r\n /**\r\n * Function which indicates whether a babylon node should be exported or not\r\n * @param node source Babylon node. It is used to check whether it should be exported to glTF or not\r\n * @returns boolean, which indicates whether the node should be exported (true) or not (false)\r\n */\r\n shouldExportNode?(node: Node): boolean;\r\n\r\n /**\r\n * Function used to extract the part of node's metadata that will be exported into glTF node extras\r\n * @param metadata source metadata to read from\r\n * @returns the data to store to glTF node extras\r\n */\r\n metadataSelector?(metadata: any): any;\r\n\r\n /**\r\n * The sample rate to bake animation curves\r\n */\r\n animationSampleRate?: number;\r\n\r\n /**\r\n * Begin serialization without waiting for the scene to be ready\r\n */\r\n exportWithoutWaitingForScene?: boolean;\r\n\r\n /**\r\n * Indicates if unused vertex uv attributes should be included in export\r\n */\r\n exportUnusedUVs?: boolean;\r\n\r\n /**\r\n * Indicates if coordinate system swapping root nodes should be included in export\r\n */\r\n includeCoordinateSystemConversionNodes?: boolean;\r\n}\r\n\r\n/**\r\n * Class for generating glTF data from a Babylon scene.\r\n */\r\nexport class GLTF2Export {\r\n /**\r\n * Exports the geometry of the scene to .gltf file format asynchronously\r\n * @param scene Babylon scene with scene hierarchy information\r\n * @param filePrefix File prefix to use when generating the glTF file\r\n * @param options Exporter options\r\n * @returns Returns an object with a .gltf file and associates texture names\r\n * as keys and their data and paths as values\r\n */\r\n public static GLTFAsync(scene: Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData> {\r\n return scene.whenReadyAsync().then(() => {\r\n const glTFPrefix = filePrefix.replace(/\\.[^/.]+$/, \"\");\r\n const gltfGenerator = new _Exporter(scene, options);\r\n return gltfGenerator._generateGLTFAsync(glTFPrefix);\r\n });\r\n }\r\n\r\n private static _PreExportAsync(scene: Scene, options?: IExportOptions): Promise<void> {\r\n return Promise.resolve().then(() => {\r\n if (options && options.exportWithoutWaitingForScene) {\r\n return Promise.resolve();\r\n } else {\r\n return scene.whenReadyAsync();\r\n }\r\n });\r\n }\r\n\r\n private static _PostExportAsync(scene: Scene, glTFData: GLTFData, options?: IExportOptions): Promise<GLTFData> {\r\n return Promise.resolve().then(() => {\r\n if (options && options.exportWithoutWaitingForScene) {\r\n return glTFData;\r\n } else {\r\n return glTFData;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Exports the geometry of the scene to .glb file format asychronously\r\n * @param scene Babylon scene with scene hierarchy information\r\n * @param filePrefix File prefix to use when generating glb file\r\n * @param options Exporter options\r\n * @returns Returns an object with a .glb filename as key and data as value\r\n */\r\n public static GLBAsync(scene: Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData> {\r\n return this._PreExportAsync(scene, options).then(() => {\r\n const glTFPrefix = filePrefix.replace(/\\.[^/.]+$/, \"\");\r\n const gltfGenerator = new _Exporter(scene, options);\r\n return gltfGenerator._generateGLBAsync(glTFPrefix).then((glTFData) => {\r\n return this._PostExportAsync(scene, glTFData, options);\r\n });\r\n });\r\n }\r\n}\r\n"]}
@@ -1,97 +1,99 @@
1
- import { IBufferView, AccessorType, AccessorComponentType, IAccessor } from "babylonjs-gltf2interface";
2
- import { FloatArray, Nullable } from "@babylonjs/core/types.js";
3
- import { Vector3, Vector4, Quaternion } from "@babylonjs/core/Maths/math.vector.js";
4
- /**
5
- * @hidden
6
- */
7
- export declare class _GLTFUtilities {
8
- /**
9
- * Creates a buffer view based on the supplied arguments
10
- * @param bufferIndex index value of the specified buffer
11
- * @param byteOffset byte offset value
12
- * @param byteLength byte length of the bufferView
13
- * @param byteStride byte distance between conequential elements
14
- * @param name name of the buffer view
15
- * @returns bufferView for glTF
16
- */
17
- static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): IBufferView;
18
- /**
19
- * Creates an accessor based on the supplied arguments
20
- * @param bufferviewIndex The index of the bufferview referenced by this accessor
21
- * @param name The name of the accessor
22
- * @param type The type of the accessor
23
- * @param componentType The datatype of components in the attribute
24
- * @param count The number of attributes referenced by this accessor
25
- * @param byteOffset The offset relative to the start of the bufferView in bytes
26
- * @param min Minimum value of each component in this attribute
27
- * @param max Maximum value of each component in this attribute
28
- * @returns accessor for glTF
29
- */
30
- static _CreateAccessor(bufferviewIndex: number, name: string, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): IAccessor;
31
- /**
32
- * Calculates the minimum and maximum values of an array of position floats
33
- * @param positions Positions array of a mesh
34
- * @param vertexStart Starting vertex offset to calculate min and max values
35
- * @param vertexCount Number of vertices to check for min and max values
36
- * @param convertToRightHandedSystem
37
- * @returns min number array and max number array
38
- */
39
- static _CalculateMinMaxPositions(positions: FloatArray, vertexStart: number, vertexCount: number, convertToRightHandedSystem: boolean): {
40
- min: number[];
41
- max: number[];
42
- };
43
- /**
44
- * Converts a new right-handed Vector3
45
- * @param vector vector3 array
46
- * @returns right-handed Vector3
47
- */
48
- static _GetRightHandedPositionVector3(vector: Vector3): Vector3;
49
- /**
50
- * Converts a Vector3 to right-handed
51
- * @param vector Vector3 to convert to right-handed
52
- */
53
- static _GetRightHandedPositionVector3FromRef(vector: Vector3): void;
54
- /**
55
- * Converts a three element number array to right-handed
56
- * @param vector number array to convert to right-handed
57
- */
58
- static _GetRightHandedPositionArray3FromRef(vector: number[]): void;
59
- /**
60
- * Converts a new right-handed Vector3
61
- * @param vector vector3 array
62
- * @returns right-handed Vector3
63
- */
64
- static _GetRightHandedNormalVector3(vector: Vector3): Vector3;
65
- /**
66
- * Converts a Vector3 to right-handed
67
- * @param vector Vector3 to convert to right-handed
68
- */
69
- static _GetRightHandedNormalVector3FromRef(vector: Vector3): void;
70
- /**
71
- * Converts a three element number array to right-handed
72
- * @param vector number array to convert to right-handed
73
- */
74
- static _GetRightHandedNormalArray3FromRef(vector: number[]): void;
75
- /**
76
- * Converts a Vector4 to right-handed
77
- * @param vector Vector4 to convert to right-handed
78
- */
79
- static _GetRightHandedVector4FromRef(vector: Vector4): void;
80
- /**
81
- * Converts a Vector4 to right-handed
82
- * @param vector Vector4 to convert to right-handed
83
- */
84
- static _GetRightHandedArray4FromRef(vector: number[]): void;
85
- /**
86
- * Converts a Quaternion to right-handed
87
- * @param quaternion Source quaternion to convert to right-handed
88
- */
89
- static _GetRightHandedQuaternionFromRef(quaternion: Quaternion): void;
90
- /**
91
- * Converts a Quaternion to right-handed
92
- * @param quaternion Source quaternion to convert to right-handed
93
- */
94
- static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
95
- static _NormalizeTangentFromRef(tangent: Vector4): void;
96
- static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
97
- }
1
+ import type { IBufferView, AccessorComponentType, IAccessor } from "babylonjs-gltf2interface/.js";
2
+ import { AccessorType } from "babylonjs-gltf2interface/.js";
3
+ import type { FloatArray, Nullable } from "@babylonjs/core/types.js";
4
+ import type { Vector4, Quaternion } from "@babylonjs/core/Maths/math.vector.js";
5
+ import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
6
+ /**
7
+ * @hidden
8
+ */
9
+ export declare class _GLTFUtilities {
10
+ /**
11
+ * Creates a buffer view based on the supplied arguments
12
+ * @param bufferIndex index value of the specified buffer
13
+ * @param byteOffset byte offset value
14
+ * @param byteLength byte length of the bufferView
15
+ * @param byteStride byte distance between conequential elements
16
+ * @param name name of the buffer view
17
+ * @returns bufferView for glTF
18
+ */
19
+ static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): IBufferView;
20
+ /**
21
+ * Creates an accessor based on the supplied arguments
22
+ * @param bufferviewIndex The index of the bufferview referenced by this accessor
23
+ * @param name The name of the accessor
24
+ * @param type The type of the accessor
25
+ * @param componentType The datatype of components in the attribute
26
+ * @param count The number of attributes referenced by this accessor
27
+ * @param byteOffset The offset relative to the start of the bufferView in bytes
28
+ * @param min Minimum value of each component in this attribute
29
+ * @param max Maximum value of each component in this attribute
30
+ * @returns accessor for glTF
31
+ */
32
+ static _CreateAccessor(bufferviewIndex: number, name: string, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): IAccessor;
33
+ /**
34
+ * Calculates the minimum and maximum values of an array of position floats
35
+ * @param positions Positions array of a mesh
36
+ * @param vertexStart Starting vertex offset to calculate min and max values
37
+ * @param vertexCount Number of vertices to check for min and max values
38
+ * @param convertToRightHandedSystem
39
+ * @returns min number array and max number array
40
+ */
41
+ static _CalculateMinMaxPositions(positions: FloatArray, vertexStart: number, vertexCount: number, convertToRightHandedSystem: boolean): {
42
+ min: number[];
43
+ max: number[];
44
+ };
45
+ /**
46
+ * Converts a new right-handed Vector3
47
+ * @param vector vector3 array
48
+ * @returns right-handed Vector3
49
+ */
50
+ static _GetRightHandedPositionVector3(vector: Vector3): Vector3;
51
+ /**
52
+ * Converts a Vector3 to right-handed
53
+ * @param vector Vector3 to convert to right-handed
54
+ */
55
+ static _GetRightHandedPositionVector3FromRef(vector: Vector3): void;
56
+ /**
57
+ * Converts a three element number array to right-handed
58
+ * @param vector number array to convert to right-handed
59
+ */
60
+ static _GetRightHandedPositionArray3FromRef(vector: number[]): void;
61
+ /**
62
+ * Converts a new right-handed Vector3
63
+ * @param vector vector3 array
64
+ * @returns right-handed Vector3
65
+ */
66
+ static _GetRightHandedNormalVector3(vector: Vector3): Vector3;
67
+ /**
68
+ * Converts a Vector3 to right-handed
69
+ * @param vector Vector3 to convert to right-handed
70
+ */
71
+ static _GetRightHandedNormalVector3FromRef(vector: Vector3): void;
72
+ /**
73
+ * Converts a three element number array to right-handed
74
+ * @param vector number array to convert to right-handed
75
+ */
76
+ static _GetRightHandedNormalArray3FromRef(vector: number[]): void;
77
+ /**
78
+ * Converts a Vector4 to right-handed
79
+ * @param vector Vector4 to convert to right-handed
80
+ */
81
+ static _GetRightHandedVector4FromRef(vector: Vector4): void;
82
+ /**
83
+ * Converts a Vector4 to right-handed
84
+ * @param vector Vector4 to convert to right-handed
85
+ */
86
+ static _GetRightHandedArray4FromRef(vector: number[]): void;
87
+ /**
88
+ * Converts a Quaternion to right-handed
89
+ * @param quaternion Source quaternion to convert to right-handed
90
+ */
91
+ static _GetRightHandedQuaternionFromRef(quaternion: Quaternion): void;
92
+ /**
93
+ * Converts a Quaternion to right-handed
94
+ * @param quaternion Source quaternion to convert to right-handed
95
+ */
96
+ static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
97
+ static _NormalizeTangentFromRef(tangent: Vector4): void;
98
+ static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
99
+ }