babylonjs-serializers 9.0.0 → 9.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.
@@ -49,6 +49,41 @@ export class STLExport {
49
49
  declare module "babylonjs-serializers/stl/index" {
50
50
  export * from "babylonjs-serializers/stl/stlSerializer";
51
51
 
52
+ }
53
+ declare module "babylonjs-serializers/legacy/legacy" {
54
+ import "babylonjs-serializers/index";
55
+ export * from "babylonjs-serializers/legacy/legacy-bvhSerializer";
56
+ export * from "babylonjs-serializers/legacy/legacy-glTF2Serializer";
57
+ export * from "babylonjs-serializers/legacy/legacy-objSerializer";
58
+ export * from "babylonjs-serializers/legacy/legacy-stlSerializer";
59
+ export * from "babylonjs-serializers/legacy/legacy-usdzSerializer";
60
+ export * from "babylonjs-serializers/legacy/legacy-3mfSerializer";
61
+
62
+ }
63
+ declare module "babylonjs-serializers/legacy/legacy-usdzSerializer" {
64
+ export * from "babylonjs-serializers/USDZ/index";
65
+
66
+ }
67
+ declare module "babylonjs-serializers/legacy/legacy-stlSerializer" {
68
+ export * from "babylonjs-serializers/stl/index";
69
+
70
+ }
71
+ declare module "babylonjs-serializers/legacy/legacy-objSerializer" {
72
+ export * from "babylonjs-serializers/OBJ/index";
73
+
74
+ }
75
+ declare module "babylonjs-serializers/legacy/legacy-glTF2Serializer" {
76
+ export * from "babylonjs-serializers/glTF/glTFFileExporter";
77
+ export * from "babylonjs-serializers/glTF/2.0/index";
78
+
79
+ }
80
+ declare module "babylonjs-serializers/legacy/legacy-bvhSerializer" {
81
+ export * from "babylonjs-serializers/BVH/index";
82
+
83
+ }
84
+ declare module "babylonjs-serializers/legacy/legacy-3mfSerializer" {
85
+ export * from "babylonjs-serializers/3MF/index";
86
+
52
87
  }
53
88
  declare module "babylonjs-serializers/glTF/index" {
54
89
  export * from "babylonjs-serializers/glTF/glTFFileExporter";
@@ -86,11 +121,9 @@ export * from "babylonjs-serializers/glTF/2.0/Extensions/index";
86
121
 
87
122
  }
88
123
  declare module "babylonjs-serializers/glTF/2.0/glTFUtilities" {
89
- import { INode } from "babylonjs-gltf2interface";
90
- import { AccessorType, MeshPrimitiveMode } from "babylonjs-gltf2interface";
124
+ import { INode, AccessorType, MeshPrimitiveMode } from "babylonjs-gltf2interface";
91
125
  import { FloatArray, DataArray, IndicesArray, DeepImmutable } from "babylonjs/types";
92
- import { Vector4 } from "babylonjs/Maths/math.vector";
93
- import { Quaternion, Matrix, Vector3 } from "babylonjs/Maths/math.vector";
126
+ import { Vector4, Quaternion, Matrix, Vector3 } from "babylonjs/Maths/math.vector";
94
127
  import { VertexBuffer } from "babylonjs/Buffers/buffer";
95
128
  import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
96
129
  import { Node } from "babylonjs/node";
@@ -595,8 +628,7 @@ export class GLTFData {
595
628
 
596
629
  }
597
630
  declare module "babylonjs-serializers/glTF/2.0/glTFAnimation" {
598
- import { IAnimation, INode, IBufferView, IAccessor } from "babylonjs-gltf2interface";
599
- import { AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType } from "babylonjs-gltf2interface";
631
+ import { IAnimation, INode, IBufferView, IAccessor, AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType } from "babylonjs-gltf2interface";
600
632
  import { Node } from "babylonjs/node";
601
633
  import { Nullable } from "babylonjs/types";
602
634
  import { Animation } from "babylonjs/Animations/animation";
@@ -1854,9 +1886,9 @@ export * from "babylonjs-serializers/3MF/3mfSerializer.configuration";
1854
1886
  declare module "babylonjs-serializers/3MF/3mfSerializer" {
1855
1887
  import { Mesh } from "babylonjs/Meshes/mesh";
1856
1888
  import { InstancedMesh } from "babylonjs/Meshes/instancedMesh";
1857
- import { type ThreeMfModelBuilder } from "babylonjs-serializers/3MF/core/model/3mf.builder";
1858
- import { type I3mfModel } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
1859
- import { AbstractThreeMfSerializer, type IThreeMfSerializerBaseOptions } from "babylonjs-serializers/3MF/core/model/3mf.serializer";
1889
+ import { ThreeMfModelBuilder } from "babylonjs-serializers/3MF/core/model/3mf.builder";
1890
+ import { I3mfModel } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
1891
+ import { AbstractThreeMfSerializer, IThreeMfSerializerBaseOptions } from "babylonjs-serializers/3MF/core/model/3mf.serializer";
1860
1892
  /**
1861
1893
  * Options controlling how meshes are exported into the 3MF model.
1862
1894
  *
@@ -2099,8 +2131,8 @@ export class NumberFormatter implements IFormatter<number> {
2099
2131
 
2100
2132
  }
2101
2133
  declare module "babylonjs-serializers/3MF/core/xml/xml.serializer" {
2102
- import { type IXmlBuilder, type XmlName } from "babylonjs-serializers/3MF/core/xml/xml.interfaces";
2103
- import { type IXmlSerializerFormatOptions } from "babylonjs-serializers/3MF/core/xml/xml.serializer.format";
2134
+ import { IXmlBuilder, XmlName } from "babylonjs-serializers/3MF/core/xml/xml.interfaces";
2135
+ import { IXmlSerializerFormatOptions } from "babylonjs-serializers/3MF/core/xml/xml.serializer.format";
2104
2136
  /**
2105
2137
  */
2106
2138
  export class XmlSerializer {
@@ -2459,9 +2491,8 @@ export interface I3mfRGBAColor {
2459
2491
  }
2460
2492
  declare module "babylonjs-serializers/3MF/core/model/3mf.serializer" {
2461
2493
  import { ThreeMfModelBuilder } from "babylonjs-serializers/3MF/core/model/3mf.builder";
2462
- import { type I3mfDocument } from "babylonjs-serializers/3MF/core/model/3mf.opc.interfaces";
2463
- import { I3mfModel } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
2464
- import { ST_Unit } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
2494
+ import { I3mfDocument } from "babylonjs-serializers/3MF/core/model/3mf.opc.interfaces";
2495
+ import { I3mfModel, ST_Unit } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
2465
2496
  /**
2466
2497
  * Options controlling how meshes are exported into the 3MF model.
2467
2498
  *
@@ -3101,10 +3132,9 @@ export interface I3mfModel {
3101
3132
 
3102
3133
  }
3103
3134
  declare module "babylonjs-serializers/3MF/core/model/3mf" {
3104
- import { type IFormatter } from "babylonjs-serializers/3MF/core/xml/xml.interfaces";
3105
- import { type IXmlSerializerFormatOptions, NumberFormatter } from "babylonjs-serializers/3MF/core/xml/xml.serializer.format";
3106
- import { I3mfBase, I3mfBaseMaterials, I3mfBuild, I3mfComponent, I3mfComponents, I3mfItem, I3mfMesh, I3mfMetadata, I3mfMetadataGroup, I3mfModel, I3mfObject, I3mfResources, I3mfTriangle, I3mfTriangles, I3mfVertex, I3mfVertices, ST_ColorValue, ST_Number, ST_ResourceID, ST_ResourceIndex, ST_UriReference, IMatrix3d, ST_Matrix3D } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3107
- import { ST_Unit, ST_ObjectType } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3135
+ import { IFormatter } from "babylonjs-serializers/3MF/core/xml/xml.interfaces";
3136
+ import { IXmlSerializerFormatOptions, NumberFormatter } from "babylonjs-serializers/3MF/core/xml/xml.serializer.format";
3137
+ import { I3mfBase, I3mfBaseMaterials, I3mfBuild, I3mfComponent, I3mfComponents, I3mfItem, I3mfMesh, I3mfMetadata, I3mfMetadataGroup, I3mfModel, I3mfObject, I3mfResources, I3mfTriangle, I3mfTriangles, I3mfVertex, I3mfVertices, ST_ColorValue, ST_Number, ST_ResourceID, ST_ResourceIndex, ST_UriReference, IMatrix3d, ST_Matrix3D, ST_Unit, ST_ObjectType } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3108
3138
  /**
3109
3139
  *
3110
3140
  */
@@ -3433,12 +3463,9 @@ export class ThreeMfItem implements I3mfItem {
3433
3463
 
3434
3464
  }
3435
3465
  declare module "babylonjs-serializers/3MF/core/model/3mf.builder" {
3436
- import { Matrix3d } from "babylonjs-serializers/3MF/core/model/3mf";
3437
- import { ThreeMfModel, ThreeMfObject } from "babylonjs-serializers/3MF/core/model/3mf";
3438
- import { I3mfBaseMaterials, I3mfModel, I3mfObject, I3mfTriangle, I3mfVertex, ST_ResourceID, ST_ResourceIndex, ST_Unit } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3439
- import { ST_ObjectType } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3440
- import { I3mfDocument } from "babylonjs-serializers/3MF/core/model/3mf.opc.interfaces";
3441
- import { type I3mfContentType, type I3mfRelationship } from "babylonjs-serializers/3MF/core/model/3mf.opc.interfaces";
3466
+ import { Matrix3d, ThreeMfModel, ThreeMfObject } from "babylonjs-serializers/3MF/core/model/3mf";
3467
+ import { I3mfBaseMaterials, I3mfModel, I3mfObject, I3mfTriangle, I3mfVertex, ST_ResourceID, ST_ResourceIndex, ST_Unit, ST_ObjectType } from "babylonjs-serializers/3MF/core/model/3mf.interfaces";
3468
+ import { I3mfDocument, I3mfContentType, I3mfRelationship } from "babylonjs-serializers/3MF/core/model/3mf.opc.interfaces";
3442
3469
  import { I3mfRGBAColor, I3mfVertexData } from "babylonjs-serializers/3MF/core/model/3mf.types";
3443
3470
  export type VertexHandler = (vertex: I3mfVertex) => I3mfVertex;
3444
3471
  export type TriangleHandler = (triangle: I3mfTriangle) => I3mfTriangle;
@@ -3665,41 +3692,6 @@ export class ThreeMfDocumentBuilder {
3665
3692
  build(): I3mfDocument;
3666
3693
  }
3667
3694
 
3668
- }
3669
- declare module "babylonjs-serializers/legacy/legacy" {
3670
- import "babylonjs-serializers/index";
3671
- export * from "babylonjs-serializers/legacy/legacy-bvhSerializer";
3672
- export * from "babylonjs-serializers/legacy/legacy-glTF2Serializer";
3673
- export * from "babylonjs-serializers/legacy/legacy-objSerializer";
3674
- export * from "babylonjs-serializers/legacy/legacy-stlSerializer";
3675
- export * from "babylonjs-serializers/legacy/legacy-usdzSerializer";
3676
- export * from "babylonjs-serializers/legacy/legacy-3mfSerializer";
3677
-
3678
- }
3679
- declare module "babylonjs-serializers/legacy/legacy-usdzSerializer" {
3680
- export * from "babylonjs-serializers/USDZ/index";
3681
-
3682
- }
3683
- declare module "babylonjs-serializers/legacy/legacy-stlSerializer" {
3684
- export * from "babylonjs-serializers/stl/index";
3685
-
3686
- }
3687
- declare module "babylonjs-serializers/legacy/legacy-objSerializer" {
3688
- export * from "babylonjs-serializers/OBJ/index";
3689
-
3690
- }
3691
- declare module "babylonjs-serializers/legacy/legacy-glTF2Serializer" {
3692
- export * from "babylonjs-serializers/glTF/glTFFileExporter";
3693
- export * from "babylonjs-serializers/glTF/2.0/index";
3694
-
3695
- }
3696
- declare module "babylonjs-serializers/legacy/legacy-bvhSerializer" {
3697
- export * from "babylonjs-serializers/BVH/index";
3698
-
3699
- }
3700
- declare module "babylonjs-serializers/legacy/legacy-3mfSerializer" {
3701
- export * from "babylonjs-serializers/3MF/index";
3702
-
3703
3695
  }
3704
3696
 
3705
3697
  declare module "babylonjs-serializers" {
@@ -3707,7 +3699,7 @@ declare module "babylonjs-serializers" {
3707
3699
  }
3708
3700
 
3709
3701
 
3710
- declare module BABYLON {
3702
+ declare namespace BABYLON {
3711
3703
 
3712
3704
 
3713
3705
  /**
@@ -3746,6 +3738,18 @@ declare module BABYLON {
3746
3738
 
3747
3739
 
3748
3740
 
3741
+
3742
+
3743
+
3744
+
3745
+
3746
+
3747
+
3748
+
3749
+
3750
+
3751
+
3752
+
3749
3753
  /** @internal */
3750
3754
  export var __IGLTFExporterExtension: number;
3751
3755
  /**
@@ -7049,18 +7053,6 @@ declare module BABYLON {
7049
7053
 
7050
7054
 
7051
7055
 
7052
-
7053
-
7054
-
7055
-
7056
-
7057
-
7058
-
7059
-
7060
-
7061
-
7062
-
7063
-
7064
7056
  }
7065
7057
 
7066
7058
 
package/config.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "declarationLibs": ["@dev/serializers", "@lts/serializers"],
2
+ "declarationLibs": ["@dev/serializers"],
3
3
  "devPackageName": "serializers",
4
4
  "filename": "babylonjs.serializers.module.d.ts",
5
5
  "outputDirectory": "./",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-serializers",
3
- "version": "9.0.0",
3
+ "version": "9.2.1",
4
4
  "main": "babylonjs.serializers.min.js",
5
5
  "types": "babylonjs.serializers.module.d.ts",
6
6
  "files": [
@@ -15,13 +15,13 @@
15
15
  "test:escheck": "es-check es6 ./babylonjs.serializers.js"
16
16
  },
17
17
  "dependencies": {
18
- "babylonjs": "9.0.0",
19
- "babylonjs-gltf2interface": "9.0.0"
18
+ "babylonjs": "9.2.1",
19
+ "babylonjs-gltf2interface": "9.2.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",
23
23
  "@dev/core": "1.0.0",
24
- "@lts/serializers": "1.0.0",
24
+ "@dev/serializers": "^1.0.0",
25
25
  "source-map-loader": "^4.0.0",
26
26
  "ts-loader": "^9.2.6",
27
27
  "webpack": "^5.103.0",
package/readme.md CHANGED
@@ -1,42 +1,42 @@
1
- Babylon.js Serializers
2
- =====================
1
+ # Babylon.js Serializers
3
2
 
4
- # Installation instructions
3
+ > We recommend using the [ES6 package `@babylonjs/serializers`](https://www.npmjs.com/package/@babylonjs/serializers) for new projects.
5
4
 
6
- ## CDN
5
+ ## Installation
6
+
7
+ ### CDN
8
+
9
+ > ⚠️ WARNING: The CDN should not be used in production environments. The purpose of our CDN is to serve Babylon packages to users learning how to use the platform or running small experiments. Once you've built an application and are ready to share it with the world at large, you should serve all packages from your own CDN.
7
10
 
8
11
  Compiled js files (minified and source) are offered on our public CDN here:
9
12
 
10
- * https://preview.babylonjs.com/serializers/babylonjs.serializers.js
11
- * https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.serializers.min.js
13
+ - https://preview.babylonjs.com/serializers/babylonjs.serializers.js
14
+ - https://preview.babylonjs.com/serializers/babylonjs.serializers.min.js
12
15
 
13
- ## NPM
16
+ ### NPM
14
17
 
15
- To install using npm :
18
+ To install using npm:
16
19
 
17
- ```
18
- npm install --save babylonjs babylonjs-serializers
20
+ ```bash
21
+ npm install babylonjs babylonjs-serializers
19
22
  ```
20
23
 
21
24
  If using TypeScript, the typing needs to be added to tsconfig.json:
22
25
 
23
- ```
24
- ....
26
+ ```json
25
27
  "types": [
26
28
  "babylonjs",
27
- "babylonjs-serializers",
28
- "oneMoreDependencyThatIReallyNeed"
29
- ],
30
- ....
29
+ "babylonjs-serializers"
30
+ ]
31
31
  ```
32
32
 
33
33
  Afterwards it can be imported to the project using:
34
34
 
35
- ```
36
- import * as BABYLON from 'babylonjs';
37
- import from 'babylonjs-serializers';
35
+ ```javascript
36
+ import * as BABYLON from "babylonjs";
37
+ import "babylonjs-serializers";
38
38
  ```
39
39
 
40
- This will extend Babylon's namespace with the serializers currently available.
40
+ This will extend Babylon's namespace with the serializers available.
41
41
 
42
- Using webpack to package your project will use the minified js file.
42
+ For more information, see the [glTF exporter documentation](https://doc.babylonjs.com/features/featuresDeepDive/Exporters/glTFExporter/).
package/src/3mf.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy-3mfSerializer";
1
+ import * as serializers from "serializers/legacy/legacy-3mfSerializer";
2
2
  export { serializers };
3
3
  export default serializers;
package/src/USDZ.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy-usdzSerializer";
1
+ import * as serializers from "serializers/legacy/legacy-usdzSerializer";
2
2
  export { serializers };
3
3
  export default serializers;
package/src/glTF2.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy-glTF2Serializer";
1
+ import * as serializers from "serializers/legacy/legacy-glTF2Serializer";
2
2
  export { serializers };
3
3
  export default serializers;
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy";
1
+ import * as serializers from "serializers/legacy/legacy";
2
2
  export { serializers };
3
3
  export default serializers;
package/src/obj.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy-objSerializer";
1
+ import * as serializers from "serializers/legacy/legacy-objSerializer";
2
2
  export { serializers };
3
3
  export default serializers;
package/src/stl.ts CHANGED
@@ -1,3 +1,3 @@
1
- import * as serializers from "@lts/serializers/legacy/legacy-stlSerializer";
1
+ import * as serializers from "serializers/legacy/legacy-stlSerializer";
2
2
  export { serializers };
3
3
  export default serializers;
@@ -5,12 +5,13 @@
5
5
  "outDir": "./dist",
6
6
  "rootDir": "../../../",
7
7
  "target": "ES5",
8
+ "ignoreDeprecations": "6.0",
8
9
  "declaration": false,
9
10
  "importHelpers": true,
10
11
  "paths": {
11
- "core/*": ["dev/core/dist/*"],
12
- "serializers/*": ["dev/serializers/src/*"],
13
- "@lts/serializers/*": ["lts/serializers/src/*"],
12
+ "core/*": ["../../../dev/core/dist/*"],
13
+ "serializers/*": ["../../../dev/serializers/src/*"],
14
+ "@lts/serializers/*": ["../../../lts/serializers/src/*"]
14
15
  }
15
16
  },
16
17
  "include": ["./src/**/*", "../../../dev/serializers/src/**/*", "../../../lts/serializers/src/**/*"]
package/tsconfig.json CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  "compilerOptions": {
5
5
  "paths": {
6
- "serializers/*": ["dev/serializers/src/*"],
7
- "@lts/serializers/*": ["lts/serializers/src/*"],
6
+ "serializers/*": ["../../../dev/serializers/src/*"],
7
+ "@lts/serializers/*": ["../../../lts/serializers/src/*"],
8
8
  }
9
9
  },
10
10
  }
package/webpack.config.js CHANGED
@@ -1,26 +1,25 @@
1
- const commonConfigGenerator = require("@dev/build-tools").webpackTools.commonUMDWebpackConfiguration;
2
- const path = require("path");
3
- module.exports = (env) => {
4
- const commonConfig = commonConfigGenerator({
5
- mode: env.production ? "production" : "development",
6
- devPackageName: "serializers",
7
- outputPath: path.resolve(__dirname),
8
- entryPoints: {
9
- serializers: "./src/index.ts",
10
- glTF2: "./src/glTF2.ts",
11
- obj: "./src/obj.ts",
12
- stl: "./src/stl.ts",
13
- usdz: "./src/USDZ.ts",
14
- threemf: "./src/3mf.ts",
15
- },
16
- alias: {
17
- serializers: path.resolve(__dirname, "../../../dev/serializers/src"),
18
- "@lts/serializers": path.resolve(__dirname, "../../../lts/serializers/src"),
19
- },
20
- overrideFilename: (pathData) => {
21
- return pathData.chunk.name === "serializers" ? `babylonjs.[name]${env.production ? ".min" : ""}.js` : `babylon.[name]Serializer${env.production ? ".min" : ""}.js`;
22
- },
23
- minToMax: true,
24
- });
25
- return commonConfig;
26
- };
1
+ const commonConfigGenerator = require("@dev/build-tools").webpackTools.commonUMDWebpackConfiguration;
2
+ const path = require("path");
3
+ module.exports = (env) => {
4
+ const commonConfig = commonConfigGenerator({
5
+ mode: env.production ? "production" : "development",
6
+ devPackageName: "serializers",
7
+ outputPath: path.resolve(__dirname),
8
+ entryPoints: {
9
+ serializers: "./src/index.ts",
10
+ glTF2: "./src/glTF2.ts",
11
+ obj: "./src/obj.ts",
12
+ stl: "./src/stl.ts",
13
+ usdz: "./src/USDZ.ts",
14
+ threemf: "./src/3mf.ts",
15
+ },
16
+ alias: {
17
+ serializers: path.resolve(__dirname, "../../../dev/serializers/src"),
18
+ },
19
+ overrideFilename: (pathData) => {
20
+ return pathData.chunk.name === "serializers" ? `babylonjs.[name]${env.production ? ".min" : ""}.js` : `babylon.[name]Serializer${env.production ? ".min" : ""}.js`;
21
+ },
22
+ minToMax: true,
23
+ });
24
+ return commonConfig;
25
+ };