babylonjs-serializers 8.33.4 → 8.34.0

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.
@@ -95,6 +95,7 @@ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
95
95
  import { Node } from "babylonjs/node";
96
96
  import { TargetCamera } from "babylonjs/Cameras/targetCamera";
97
97
  import { ShadowLight } from "babylonjs/Lights/shadowLight";
98
+ import { AreaLight } from "babylonjs/Lights/areaLight";
98
99
  export const DefaultTranslation: import("babylonjs/types").DeepImmutableObject<Vector3>;
99
100
  export const DefaultRotation: DeepImmutable<Quaternion>;
100
101
  export const DefaultScale: import("babylonjs/types").DeepImmutableObject<Vector3>;
@@ -151,7 +152,7 @@ export function CollapseChildIntoParent(node: INode, parentNode: INode): void;
151
152
  * @param parentBabylonNode Target Babylon parent node.
152
153
  * @returns True if the two nodes can be merged, false otherwise.
153
154
  */
154
- export function IsChildCollapsible(babylonNode: ShadowLight | TargetCamera, parentBabylonNode: Node): boolean;
155
+ export function IsChildCollapsible(babylonNode: ShadowLight | TargetCamera | AreaLight, parentBabylonNode: Node): boolean;
155
156
  /**
156
157
  * Converts an IndicesArray into either a Uint32Array or Uint16Array.
157
158
  * If the `start` and `count` parameters specify a subset of the array, a new view is created.
@@ -376,7 +377,7 @@ export class GLTFMaterialExporter {
376
377
  exportPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, hasUVs: boolean): Promise<number>;
377
378
  private _setMetallicRoughnessPbrMaterialAsync;
378
379
  exportOpenPBRMaterialAsync(babylonOpenPBRMaterial: OpenPBRMaterial, hasUVs: boolean): Promise<number>;
379
- exportTextureAsync(babylonTexture: BaseTexture): Promise<Nullable<ITextureInfo>>;
380
+ exportTextureAsync(babylonTexture: BaseTexture, overrideId?: Nullable<number>): Promise<Nullable<ITextureInfo>>;
380
381
  private _exportTextureImageAsync;
381
382
  private _exportImage;
382
383
  private _exportTextureInfo;
@@ -887,6 +888,7 @@ declare module "babylonjs-serializers/glTF/2.0/Extensions/index" {
887
888
  export * from "babylonjs-serializers/glTF/2.0/Extensions/EXT_mesh_gpu_instancing";
888
889
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_draco_mesh_compression";
889
890
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_lights_punctual";
891
+ export * from "babylonjs-serializers/glTF/2.0/Extensions/EXT_lights_area";
890
892
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_anisotropy";
891
893
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat";
892
894
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening";
@@ -1665,6 +1667,48 @@ export class EXT_mesh_gpu_instancing implements IGLTFExporterExtensionV2 {
1665
1667
  private _buildAccessor;
1666
1668
  }
1667
1669
 
1670
+ }
1671
+ declare module "babylonjs-serializers/glTF/2.0/Extensions/EXT_lights_area" {
1672
+ import { Nullable } from "babylonjs/types";
1673
+ import { Node } from "babylonjs/node";
1674
+ import { INode } from "babylonjs-gltf2interface";
1675
+ import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1676
+ import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1677
+ /**
1678
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/EXT_lights_area/README.md)
1679
+ */
1680
+ export class EXT_lights_area implements IGLTFExporterExtensionV2 {
1681
+ /** The name of this extension. */
1682
+ readonly name: string;
1683
+ /** Defines whether this extension is enabled. */
1684
+ enabled: boolean;
1685
+ /** Defines whether this extension is required */
1686
+ required: boolean;
1687
+ /** Reference to the glTF exporter */
1688
+ private _exporter;
1689
+ private _lights;
1690
+ /**
1691
+ * @internal
1692
+ */
1693
+ constructor(exporter: GLTFExporter);
1694
+ /** @internal */
1695
+ dispose(): void;
1696
+ /** @internal */
1697
+ get wasUsed(): boolean;
1698
+ /** @internal */
1699
+ onExporting(): void;
1700
+ /**
1701
+ * Define this method to modify the default behavior when exporting a node
1702
+ * @param context The context when exporting the node
1703
+ * @param node glTF node
1704
+ * @param babylonNode BabylonJS node
1705
+ * @param nodeMap Node mapping of babylon node to glTF node index
1706
+ * @param convertToRightHanded Flag to convert the values to right-handed
1707
+ * @returns nullable INode promise
1708
+ */
1709
+ postExportNodeAsync(context: string, node: INode, babylonNode: Node, nodeMap: Map<Node, number>, convertToRightHanded: boolean): Promise<Nullable<INode>>;
1710
+ }
1711
+
1668
1712
  }
1669
1713
  declare module "babylonjs-serializers/USDZ/usdzExporter" {
1670
1714
  import { Mesh } from "babylonjs/Meshes/mesh";
@@ -1926,7 +1970,7 @@ declare module BABYLON {
1926
1970
  * @param parentBabylonNode Target Babylon parent node.
1927
1971
  * @returns True if the two nodes can be merged, false otherwise.
1928
1972
  */
1929
- export function IsChildCollapsible(babylonNode: ShadowLight | TargetCamera, parentBabylonNode: Node): boolean;
1973
+ export function IsChildCollapsible(babylonNode: ShadowLight | TargetCamera | AreaLight, parentBabylonNode: Node): boolean;
1930
1974
  /**
1931
1975
  * Converts an IndicesArray into either a Uint32Array or Uint16Array.
1932
1976
  * If the `start` and `count` parameters specify a subset of the array, a new view is created.
@@ -2133,7 +2177,7 @@ declare module BABYLON {
2133
2177
  exportPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, hasUVs: boolean): Promise<number>;
2134
2178
  private _setMetallicRoughnessPbrMaterialAsync;
2135
2179
  exportOpenPBRMaterialAsync(babylonOpenPBRMaterial: OpenPBRMaterial, hasUVs: boolean): Promise<number>;
2136
- exportTextureAsync(babylonTexture: BaseTexture): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2180
+ exportTextureAsync(babylonTexture: BaseTexture, overrideId?: Nullable<number>): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2137
2181
  private _exportTextureImageAsync;
2138
2182
  private _exportImage;
2139
2183
  private _exportTextureInfo;
@@ -3237,6 +3281,42 @@ declare module BABYLON {
3237
3281
  }
3238
3282
 
3239
3283
 
3284
+ /**
3285
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/EXT_lights_area/README.md)
3286
+ */
3287
+ export class EXT_lights_area implements IGLTFExporterExtensionV2 {
3288
+ /** The name of this extension. */
3289
+ readonly name = "EXT_lights_area";
3290
+ /** Defines whether this extension is enabled. */
3291
+ enabled: boolean;
3292
+ /** Defines whether this extension is required */
3293
+ required: boolean;
3294
+ /** Reference to the glTF exporter */
3295
+ private _exporter;
3296
+ private _lights;
3297
+ /**
3298
+ * @internal
3299
+ */
3300
+ constructor(exporter: GLTFExporter);
3301
+ /** @internal */
3302
+ dispose(): void;
3303
+ /** @internal */
3304
+ get wasUsed(): boolean;
3305
+ /** @internal */
3306
+ onExporting(): void;
3307
+ /**
3308
+ * Define this method to modify the default behavior when exporting a node
3309
+ * @param context The context when exporting the node
3310
+ * @param node glTF node
3311
+ * @param babylonNode BabylonJS node
3312
+ * @param nodeMap Node mapping of babylon node to glTF node index
3313
+ * @param convertToRightHanded Flag to convert the values to right-handed
3314
+ * @returns nullable BABYLON.GLTF2.INode promise
3315
+ */
3316
+ postExportNodeAsync(context: string, node: BABYLON.GLTF2.INode, babylonNode: Node, nodeMap: Map<Node, number>, convertToRightHanded: boolean): Promise<Nullable<BABYLON.GLTF2.INode>>;
3317
+ }
3318
+
3319
+
3240
3320
  /**
3241
3321
  * Options for the USDZ export
3242
3322
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-serializers",
3
- "version": "8.33.4",
3
+ "version": "8.34.0",
4
4
  "main": "babylonjs.serializers.min.js",
5
5
  "types": "babylonjs.serializers.module.d.ts",
6
6
  "files": [
@@ -15,8 +15,8 @@
15
15
  "test:escheck": "es-check es6 ./babylonjs.serializers.js"
16
16
  },
17
17
  "dependencies": {
18
- "babylonjs": "^8.33.4",
19
- "babylonjs-gltf2interface": "^8.33.4"
18
+ "babylonjs": "^8.34.0",
19
+ "babylonjs-gltf2interface": "^8.34.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",