@babylonjs/serializers 8.2.0 → 8.2.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 (38) hide show
  1. package/OBJ/index.d.ts +1 -1
  2. package/USDZ/index.d.ts +1 -1
  3. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +3 -3
  4. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +3 -3
  5. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +2 -2
  6. package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +2 -2
  7. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +2 -2
  8. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +2 -2
  9. package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +1 -1
  10. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +1 -1
  11. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +1 -1
  12. package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +2 -2
  13. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +2 -2
  14. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +2 -2
  15. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +2 -2
  16. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +1 -1
  17. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +2 -2
  18. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +1 -1
  19. package/glTF/2.0/Extensions/index.d.ts +16 -16
  20. package/glTF/2.0/glTFAnimation.d.ts +1 -1
  21. package/glTF/2.0/glTFExporter.d.ts +5 -5
  22. package/glTF/2.0/glTFExporter.js +8 -8
  23. package/glTF/2.0/glTFExporter.js.map +1 -1
  24. package/glTF/2.0/glTFExporterExtension.d.ts +2 -2
  25. package/glTF/2.0/glTFMaterialExporter.d.ts +2 -2
  26. package/glTF/2.0/glTFMorphTargetsUtilities.d.ts +3 -3
  27. package/glTF/2.0/glTFMorphTargetsUtilities.js +10 -5
  28. package/glTF/2.0/glTFMorphTargetsUtilities.js.map +1 -1
  29. package/glTF/2.0/glTFSerializer.d.ts +1 -1
  30. package/glTF/2.0/glTFUtilities.d.ts +2 -2
  31. package/glTF/2.0/glTFUtilities.js +2 -3
  32. package/glTF/2.0/glTFUtilities.js.map +1 -1
  33. package/glTF/2.0/index.d.ts +4 -4
  34. package/glTF/index.d.ts +2 -2
  35. package/index.d.ts +4 -4
  36. package/legacy/legacy.d.ts +4 -4
  37. package/package.json +3 -3
  38. package/stl/index.d.ts +1 -1
package/OBJ/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./objSerializer";
1
+ export * from "./objSerializer.js";
package/USDZ/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./usdzExporter";
1
+ export * from "./usdzExporter.js";
@@ -1,7 +1,7 @@
1
1
  import type { INode } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import type { BufferManager } from "../bufferManager";
4
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import type { BufferManager } from "../bufferManager.js";
4
+ import { GLTFExporter } from "../glTFExporter.js";
5
5
  import type { Nullable } from "@babylonjs/core/types.js";
6
6
  import type { Node } from "@babylonjs/core/node.js";
7
7
  import "@babylonjs/core/Meshes/thinInstanceMesh.js";
@@ -1,7 +1,7 @@
1
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
2
- import { GLTFExporter } from "../glTFExporter";
1
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
2
+ import { GLTFExporter } from "../glTFExporter.js";
3
3
  import type { IAccessor, IMeshPrimitive } from "babylonjs-gltf2interface";
4
- import type { BufferManager } from "../bufferManager";
4
+ import type { BufferManager } from "../bufferManager.js";
5
5
  /**
6
6
  * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md)
7
7
  */
@@ -1,8 +1,8 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
2
  import type { Node } from "@babylonjs/core/node.js";
3
3
  import type { INode } from "babylonjs-gltf2interface";
4
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
5
- import { GLTFExporter } from "../glTFExporter";
4
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
5
+ import { GLTFExporter } from "../glTFExporter.js";
6
6
  /**
7
7
  * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md)
8
8
  */
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
3
  import type { Material } from "@babylonjs/core/Materials/material.js";
4
4
  /**
5
5
  * [Specification](https://github.com/KhronosGroup/glTF/blob/87bd64a7f5e23c84b6aef2e6082069583ed0ddb4/extensions/2.0/Khronos/KHR_materials_dispersion/README.md)
@@ -1,4 +1,4 @@
1
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
1
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
2
2
  import type { Material } from "@babylonjs/core/Materials/material.js";
3
3
  import type { IMaterial } from "babylonjs-gltf2interface";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
3
  import type { Material } from "@babylonjs/core/Materials/material.js";
4
4
  /**
5
5
  * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_ior/README.md)
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
3
  import type { Material } from "@babylonjs/core/Materials/material.js";
4
4
  /**
5
5
  * @internal
@@ -1,6 +1,6 @@
1
1
  import type { IMaterial } from "babylonjs-gltf2interface";
2
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
- import { GLTFExporter } from "../glTFExporter";
2
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
3
+ import { GLTFExporter } from "../glTFExporter.js";
4
4
  import type { Material } from "@babylonjs/core/Materials/material.js";
5
5
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ITextureInfo } from "babylonjs-gltf2interface";
2
2
  import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
3
- import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
3
+ import type { IGLTFExporterExtensionV2 } from "../glTFExporterExtension.js";
4
4
  /**
5
5
  * @internal
6
6
  */
@@ -1,16 +1,16 @@
1
- export * from "./EXT_mesh_gpu_instancing";
2
- export * from "./KHR_draco_mesh_compression";
3
- export * from "./KHR_lights_punctual";
4
- export * from "./KHR_materials_anisotropy";
5
- export * from "./KHR_materials_clearcoat";
6
- export * from "./KHR_materials_diffuse_transmission";
7
- export * from "./KHR_materials_dispersion";
8
- export * from "./KHR_materials_emissive_strength";
9
- export * from "./KHR_materials_ior";
10
- export * from "./KHR_materials_iridescence";
11
- export * from "./KHR_materials_sheen";
12
- export * from "./KHR_materials_specular";
13
- export * from "./KHR_materials_transmission";
14
- export * from "./KHR_materials_unlit";
15
- export * from "./KHR_materials_volume";
16
- export * from "./KHR_texture_transform";
1
+ export * from "./EXT_mesh_gpu_instancing.js";
2
+ export * from "./KHR_draco_mesh_compression.js";
3
+ export * from "./KHR_lights_punctual.js";
4
+ export * from "./KHR_materials_anisotropy.js";
5
+ export * from "./KHR_materials_clearcoat.js";
6
+ export * from "./KHR_materials_diffuse_transmission.js";
7
+ export * from "./KHR_materials_dispersion.js";
8
+ export * from "./KHR_materials_emissive_strength.js";
9
+ export * from "./KHR_materials_ior.js";
10
+ export * from "./KHR_materials_iridescence.js";
11
+ export * from "./KHR_materials_sheen.js";
12
+ export * from "./KHR_materials_specular.js";
13
+ export * from "./KHR_materials_transmission.js";
14
+ export * from "./KHR_materials_unlit.js";
15
+ export * from "./KHR_materials_volume.js";
16
+ export * from "./KHR_texture_transform.js";
@@ -4,7 +4,7 @@ import type { Node } from "@babylonjs/core/node.js";
4
4
  import type { Nullable } from "@babylonjs/core/types.js";
5
5
  import { Animation } from "@babylonjs/core/Animations/animation.js";
6
6
  import type { Scene } from "@babylonjs/core/scene.js";
7
- import type { BufferManager } from "./bufferManager";
7
+ import type { BufferManager } from "./bufferManager.js";
8
8
  /**
9
9
  * @internal
10
10
  * Interface to store animation data.
@@ -6,11 +6,11 @@ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture
6
6
  import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
7
7
  import { Material } from "@babylonjs/core/Materials/material.js";
8
8
  import type { Scene } from "@babylonjs/core/scene.js";
9
- import type { IGLTFExporterExtensionV2 } from "./glTFExporterExtension";
10
- import { GLTFMaterialExporter } from "./glTFMaterialExporter";
11
- import type { IExportOptions } from "./glTFSerializer";
12
- import { GLTFData } from "./glTFData";
13
- import { BufferManager } from "./bufferManager";
9
+ import type { IGLTFExporterExtensionV2 } from "./glTFExporterExtension.js";
10
+ import { GLTFMaterialExporter } from "./glTFMaterialExporter.js";
11
+ import type { IExportOptions } from "./glTFSerializer.js";
12
+ import { GLTFData } from "./glTFData.js";
13
+ import { BufferManager } from "./bufferManager.js";
14
14
  /** @internal */
15
15
  export declare class GLTFExporter {
16
16
  readonly _glTF: IGLTF;
@@ -2,7 +2,7 @@ import { TmpVectors, Quaternion, Matrix } from "@babylonjs/core/Maths/math.vecto
2
2
  import { Tools } from "@babylonjs/core/Misc/tools.js";
3
3
  import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
4
4
  import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
5
- import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
5
+ import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
6
6
  import { InstancedMesh } from "@babylonjs/core/Meshes/instancedMesh.js";
7
7
  import { Material } from "@babylonjs/core/Materials/material.js";
8
8
  import { Engine } from "@babylonjs/core/Engines/engine.js";
@@ -671,7 +671,7 @@ export class GLTFExporter {
671
671
  return nodes;
672
672
  }
673
673
  _collectBuffers(babylonNode, bufferToVertexBuffersMap, vertexBufferToMeshesMap, morphTargetsToMeshesMap, state) {
674
- if (this._shouldExportNode(babylonNode) && babylonNode instanceof Mesh && babylonNode.geometry) {
674
+ if (this._shouldExportNode(babylonNode) && babylonNode instanceof AbstractMesh && babylonNode.geometry) {
675
675
  const vertexBuffers = babylonNode.geometry.getVertexBuffers();
676
676
  if (vertexBuffers) {
677
677
  for (const kind in vertexBuffers) {
@@ -712,9 +712,9 @@ export class GLTFExporter {
712
712
  _exportBuffers(babylonRootNodes, state) {
713
713
  const bufferToVertexBuffersMap = new Map();
714
714
  const vertexBufferToMeshesMap = new Map();
715
- const morphTagetsMeshesMap = new Map();
715
+ const morphTargetsMeshesMap = new Map();
716
716
  for (const babylonNode of babylonRootNodes) {
717
- this._collectBuffers(babylonNode, bufferToVertexBuffersMap, vertexBufferToMeshesMap, morphTagetsMeshesMap, state);
717
+ this._collectBuffers(babylonNode, bufferToVertexBuffersMap, vertexBufferToMeshesMap, morphTargetsMeshesMap, state);
718
718
  }
719
719
  const buffers = Array.from(bufferToVertexBuffersMap.keys());
720
720
  for (const buffer of buffers) {
@@ -840,9 +840,9 @@ export class GLTFExporter {
840
840
  }
841
841
  }
842
842
  // Build morph targets buffers
843
- const morphTargets = Array.from(morphTagetsMeshesMap.keys());
843
+ const morphTargets = Array.from(morphTargetsMeshesMap.keys());
844
844
  for (const morphTarget of morphTargets) {
845
- const meshes = morphTagetsMeshesMap.get(morphTarget);
845
+ const meshes = morphTargetsMeshesMap.get(morphTarget);
846
846
  if (!meshes) {
847
847
  continue;
848
848
  }
@@ -924,8 +924,8 @@ export class GLTFExporter {
924
924
  }
925
925
  if (babylonNode instanceof TransformNode) {
926
926
  this._setNodeTransformation(node, babylonNode, state.convertToRightHanded);
927
- if (babylonNode instanceof Mesh || babylonNode instanceof InstancedMesh) {
928
- const babylonMesh = babylonNode instanceof Mesh ? babylonNode : babylonNode.sourceMesh;
927
+ if (babylonNode instanceof AbstractMesh) {
928
+ const babylonMesh = babylonNode instanceof InstancedMesh ? babylonNode.sourceMesh : babylonNode;
929
929
  if (babylonMesh.subMeshes && babylonMesh.subMeshes.length > 0) {
930
930
  node.mesh = await this._exportMeshAsync(babylonMesh, state);
931
931
  }