babylonjs-serializers 8.28.0 → 8.28.2

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.
@@ -281,6 +281,7 @@ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
281
281
  import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
282
282
  import { StandardMaterial } from "babylonjs/Materials/standardMaterial";
283
283
  import { PBRBaseMaterial } from "babylonjs/Materials/PBR/pbrBaseMaterial";
284
+ import { OpenPBRMaterial } from "babylonjs/Materials/PBR/openPbrMaterial";
284
285
  /**
285
286
  * Computes the metallic factor from specular glossiness values.
286
287
  * @param diffuse diffused value
@@ -347,6 +348,12 @@ export class GLTFMaterialExporter {
347
348
  private _getMaxComponent;
348
349
  /**
349
350
  * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors
351
+ * @param baseColor Base color of the material
352
+ * @param metallic Metallic factor of the material
353
+ * @param roughness Roughness factor of the material
354
+ * @param albedoTexture Albedo texture of the material
355
+ * @param metallicTexture Metallic texture of the material
356
+ * @param roughnessTexture Roughness texture of the material
350
357
  * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
351
358
  * @param glTFPbrMetallicRoughness glTF PBR Metallic Roughness interface
352
359
  * @param hasUVs specifies if texture coordinates are present on the submesh to determine if textures should be applied
@@ -365,6 +372,7 @@ export class GLTFMaterialExporter {
365
372
  private _convertSpecGlossFactorsToMetallicRoughnessAsync;
366
373
  exportPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, hasUVs: boolean): Promise<number>;
367
374
  private _setMetallicRoughnessPbrMaterialAsync;
375
+ exportOpenPBRMaterialAsync(babylonOpenPBRMaterial: OpenPBRMaterial, hasUVs: boolean): Promise<number>;
368
376
  exportTextureAsync(babylonTexture: BaseTexture): Promise<Nullable<ITextureInfo>>;
369
377
  private _exportTextureImageAsync;
370
378
  private _exportImage;
@@ -427,7 +435,7 @@ export interface IGLTFExporterExtensionV2 extends IGLTFExporterExtension, IDispo
427
435
  * @param babylonMaterial BabylonJS material
428
436
  * @returns List of textures
429
437
  */
430
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
438
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
431
439
  /**
432
440
  * Define this method to modify the glTF buffer data before it is finalized and written
433
441
  * @param bufferManager Buffer manager
@@ -501,7 +509,14 @@ export class GLTFExporter {
501
509
  private _ApplyExtensions;
502
510
  _extensionsPostExportNodeAsync(context: string, node: INode, babylonNode: Node, nodeMap: Map<Node, number>, convertToRightHanded: boolean): Promise<Nullable<INode>>;
503
511
  _extensionsPostExportMaterialAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<Nullable<IMaterial>>;
504
- _extensionsPostExportMaterialAdditionalTextures(context: string, material: IMaterial, babylonMaterial: Material): BaseTexture[];
512
+ /**
513
+ * Get additional textures for a material
514
+ * @param context The context when loading the asset
515
+ * @param material The glTF material
516
+ * @param babylonMaterial The Babylon.js material
517
+ * @returns List of additional textures
518
+ */
519
+ _extensionsPostExportMaterialAdditionalTexturesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
505
520
  _extensionsPostExportTextures(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void;
506
521
  _extensionsPostExportMeshPrimitive(primitive: IMeshPrimitive): void;
507
522
  _extensionsPreGenerateBinaryAsync(): Promise<void>;
@@ -870,6 +885,9 @@ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_draco_mesh_compress
870
885
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_lights_punctual";
871
886
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_anisotropy";
872
887
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat";
888
+ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening";
889
+ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_color";
890
+ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy";
873
891
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_diffuse_transmission";
874
892
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_dispersion";
875
893
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_emissive_strength";
@@ -880,7 +898,7 @@ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_specular"
880
898
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_transmission";
881
899
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_unlit";
882
900
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_volume";
883
- export * from "babylonjs-serializers/glTF/2.0/Extensions/EXT_materials_diffuse_roughness";
901
+ export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_diffuse_roughness";
884
902
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_texture_transform";
885
903
  export * from "babylonjs-serializers/glTF/2.0/Extensions/KHR_texture_basisu";
886
904
  export * from "babylonjs-serializers/glTF/2.0/Extensions/EXT_texture_webp";
@@ -959,7 +977,7 @@ export class KHR_materials_volume implements IGLTFExporterExtensionV2 {
959
977
  * @param babylonMaterial corresponding babylon material
960
978
  * @returns array of additional textures to export
961
979
  */
962
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
980
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
963
981
  private _isExtensionEnabled;
964
982
  private _hasTexturesExtension;
965
983
  /**
@@ -1026,7 +1044,7 @@ export class KHR_materials_transmission implements IGLTFExporterExtensionV2 {
1026
1044
  * @param babylonMaterial corresponding babylon material
1027
1045
  * @returns array of additional textures to export
1028
1046
  */
1029
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1047
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1030
1048
  private _isExtensionEnabled;
1031
1049
  private _hasTexturesExtension;
1032
1050
  /**
@@ -1070,7 +1088,7 @@ export class KHR_materials_specular implements IGLTFExporterExtensionV2 {
1070
1088
  * @param babylonMaterial corresponding babylon material
1071
1089
  * @returns array of additional textures to export
1072
1090
  */
1073
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1091
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1074
1092
  private _isExtensionEnabled;
1075
1093
  private _hasTexturesExtension;
1076
1094
  /**
@@ -1106,7 +1124,7 @@ export class KHR_materials_sheen implements IGLTFExporterExtensionV2 {
1106
1124
  dispose(): void;
1107
1125
  /** @internal */
1108
1126
  get wasUsed(): boolean;
1109
- postExportMaterialAdditionalTextures(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1127
+ postExportMaterialAdditionalTexturesAsync(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1110
1128
  postExportMaterialAsync(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1111
1129
  }
1112
1130
 
@@ -1133,7 +1151,7 @@ export class KHR_materials_iridescence implements IGLTFExporterExtensionV2 {
1133
1151
  dispose(): void;
1134
1152
  /** @internal */
1135
1153
  get wasUsed(): boolean;
1136
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1154
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1137
1155
  postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1138
1156
  }
1139
1157
 
@@ -1264,7 +1282,7 @@ export class KHR_materials_diffuse_transmission implements IGLTFExporterExtensio
1264
1282
  * @param babylonMaterial corresponding babylon material
1265
1283
  * @returns array of additional textures to export
1266
1284
  */
1267
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1285
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1268
1286
  private _isExtensionEnabled;
1269
1287
  /**
1270
1288
  * After exporting a material
@@ -1276,6 +1294,122 @@ export class KHR_materials_diffuse_transmission implements IGLTFExporterExtensio
1276
1294
  postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1277
1295
  }
1278
1296
 
1297
+ }
1298
+ declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_diffuse_roughness" {
1299
+ import { IMaterial } from "babylonjs-gltf2interface";
1300
+ import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1301
+ import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1302
+ import { Material } from "babylonjs/Materials/material";
1303
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1304
+ /**
1305
+ * @internal
1306
+ */
1307
+ export class KHR_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
1308
+ /** Name of this extension */
1309
+ readonly name: string;
1310
+ /** Defines whether this extension is enabled */
1311
+ enabled: boolean;
1312
+ /** Defines whether this extension is required */
1313
+ required: boolean;
1314
+ private _exporter;
1315
+ private _wasUsed;
1316
+ constructor(exporter: GLTFExporter);
1317
+ dispose(): void;
1318
+ /** @internal */
1319
+ get wasUsed(): boolean;
1320
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1321
+ postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1322
+ }
1323
+
1324
+ }
1325
+ declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_darkening" {
1326
+ import { IMaterial } from "babylonjs-gltf2interface";
1327
+ import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1328
+ import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1329
+ import { Material } from "babylonjs/Materials/material";
1330
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1331
+ /**
1332
+ * @internal
1333
+ */
1334
+ export class KHR_materials_clearcoat_darkening implements IGLTFExporterExtensionV2 {
1335
+ /** Name of this extension */
1336
+ readonly name: string;
1337
+ /** Defines whether this extension is enabled */
1338
+ enabled: boolean;
1339
+ /** Defines whether this extension is required */
1340
+ required: boolean;
1341
+ private _exporter;
1342
+ private _wasUsed;
1343
+ constructor(exporter: GLTFExporter);
1344
+ dispose(): void;
1345
+ /** @internal */
1346
+ get wasUsed(): boolean;
1347
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1348
+ postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1349
+ }
1350
+
1351
+ }
1352
+ declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_color" {
1353
+ import { IMaterial } from "babylonjs-gltf2interface";
1354
+ import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1355
+ import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1356
+ import { Material } from "babylonjs/Materials/material";
1357
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1358
+ /**
1359
+ * @internal
1360
+ */
1361
+ export class KHR_materials_clearcoat_color implements IGLTFExporterExtensionV2 {
1362
+ /** Name of this extension */
1363
+ readonly name: string;
1364
+ /** Defines whether this extension is enabled */
1365
+ enabled: boolean;
1366
+ /** Defines whether this extension is required */
1367
+ required: boolean;
1368
+ private _exporter;
1369
+ private _wasUsed;
1370
+ constructor(exporter: GLTFExporter);
1371
+ dispose(): void;
1372
+ /** @internal */
1373
+ get wasUsed(): boolean;
1374
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1375
+ postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1376
+ }
1377
+
1378
+ }
1379
+ declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat_anisotropy" {
1380
+ import { IMaterial } from "babylonjs-gltf2interface";
1381
+ import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1382
+ import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1383
+ import { Material } from "babylonjs/Materials/material";
1384
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1385
+ /**
1386
+ * @internal
1387
+ */
1388
+ export class KHR_materials_clearcoat_anisotropy implements IGLTFExporterExtensionV2 {
1389
+ /** Name of this extension */
1390
+ readonly name: string;
1391
+ /** Defines whether this extension is enabled */
1392
+ enabled: boolean;
1393
+ /** Defines whether this extension is required */
1394
+ required: boolean;
1395
+ private _exporter;
1396
+ private _wasUsed;
1397
+ private _anisoTexturesMap;
1398
+ constructor(exporter: GLTFExporter);
1399
+ dispose(): void;
1400
+ /** @internal */
1401
+ get wasUsed(): boolean;
1402
+ /**
1403
+ * After exporting a material, deal with the additional textures
1404
+ * @param context GLTF context of the material
1405
+ * @param node exported GLTF node
1406
+ * @param babylonMaterial corresponding babylon material
1407
+ * @returns array of additional textures to export
1408
+ */
1409
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1410
+ postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1411
+ }
1412
+
1279
1413
  }
1280
1414
  declare module "babylonjs-serializers/glTF/2.0/Extensions/KHR_materials_clearcoat" {
1281
1415
  import { IMaterial } from "babylonjs-gltf2interface";
@@ -1299,7 +1433,7 @@ export class KHR_materials_clearcoat implements IGLTFExporterExtensionV2 {
1299
1433
  dispose(): void;
1300
1434
  /** @internal */
1301
1435
  get wasUsed(): boolean;
1302
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1436
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1303
1437
  postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1304
1438
  }
1305
1439
 
@@ -1322,11 +1456,19 @@ export class KHR_materials_anisotropy implements IGLTFExporterExtensionV2 {
1322
1456
  required: boolean;
1323
1457
  private _exporter;
1324
1458
  private _wasUsed;
1459
+ private _anisoTexturesMap;
1325
1460
  constructor(exporter: GLTFExporter);
1326
1461
  dispose(): void;
1327
1462
  /** @internal */
1328
1463
  get wasUsed(): boolean;
1329
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1464
+ /**
1465
+ * After exporting a material, deal with the additional textures
1466
+ * @param context GLTF context of the material
1467
+ * @param node exported GLTF node
1468
+ * @param babylonMaterial corresponding babylon material
1469
+ * @returns array of additional textures to export
1470
+ */
1471
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1330
1472
  postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1331
1473
  }
1332
1474
 
@@ -1485,33 +1627,6 @@ export class EXT_mesh_gpu_instancing implements IGLTFExporterExtensionV2 {
1485
1627
  private _buildAccessor;
1486
1628
  }
1487
1629
 
1488
- }
1489
- declare module "babylonjs-serializers/glTF/2.0/Extensions/EXT_materials_diffuse_roughness" {
1490
- import { IMaterial } from "babylonjs-gltf2interface";
1491
- import { IGLTFExporterExtensionV2 } from "babylonjs-serializers/glTF/2.0/glTFExporterExtension";
1492
- import { GLTFExporter } from "babylonjs-serializers/glTF/2.0/glTFExporter";
1493
- import { Material } from "babylonjs/Materials/material";
1494
- import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1495
- /**
1496
- * @internal
1497
- */
1498
- export class EXT_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
1499
- /** Name of this extension */
1500
- readonly name: string;
1501
- /** Defines whether this extension is enabled */
1502
- enabled: boolean;
1503
- /** Defines whether this extension is required */
1504
- required: boolean;
1505
- private _exporter;
1506
- private _wasUsed;
1507
- constructor(exporter: GLTFExporter);
1508
- dispose(): void;
1509
- /** @internal */
1510
- get wasUsed(): boolean;
1511
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1512
- postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1513
- }
1514
-
1515
1630
  }
1516
1631
  declare module "babylonjs-serializers/USDZ/usdzExporter" {
1517
1632
  import { Mesh } from "babylonjs/Meshes/mesh";
@@ -1952,6 +2067,12 @@ declare module BABYLON {
1952
2067
  private _getMaxComponent;
1953
2068
  /**
1954
2069
  * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors
2070
+ * @param baseColor Base color of the material
2071
+ * @param metallic Metallic factor of the material
2072
+ * @param roughness Roughness factor of the material
2073
+ * @param albedoTexture Albedo texture of the material
2074
+ * @param metallicTexture Metallic texture of the material
2075
+ * @param roughnessTexture Roughness texture of the material
1955
2076
  * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
1956
2077
  * @param glTFPbrMetallicRoughness glTF PBR Metallic Roughness interface
1957
2078
  * @param hasUVs specifies if texture coordinates are present on the submesh to determine if textures should be applied
@@ -1970,6 +2091,7 @@ declare module BABYLON {
1970
2091
  private _convertSpecGlossFactorsToMetallicRoughnessAsync;
1971
2092
  exportPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, hasUVs: boolean): Promise<number>;
1972
2093
  private _setMetallicRoughnessPbrMaterialAsync;
2094
+ exportOpenPBRMaterialAsync(babylonOpenPBRMaterial: OpenPBRMaterial, hasUVs: boolean): Promise<number>;
1973
2095
  exportTextureAsync(babylonTexture: BaseTexture): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
1974
2096
  private _exportTextureImageAsync;
1975
2097
  private _exportImage;
@@ -2023,7 +2145,7 @@ declare module BABYLON {
2023
2145
  * @param babylonMaterial BabylonJS material
2024
2146
  * @returns List of textures
2025
2147
  */
2026
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2148
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2027
2149
  /**
2028
2150
  * Define this method to modify the glTF buffer data before it is finalized and written
2029
2151
  * @param bufferManager Buffer manager
@@ -2085,7 +2207,14 @@ declare module BABYLON {
2085
2207
  private _ApplyExtensions;
2086
2208
  _extensionsPostExportNodeAsync(context: string, node: BABYLON.GLTF2.INode, babylonNode: Node, nodeMap: Map<Node, number>, convertToRightHanded: boolean): Promise<Nullable<BABYLON.GLTF2.INode>>;
2087
2209
  _extensionsPostExportMaterialAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<Nullable<BABYLON.GLTF2.IMaterial>>;
2088
- _extensionsPostExportMaterialAdditionalTextures(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2210
+ /**
2211
+ * Get additional textures for a material
2212
+ * @param context The context when loading the asset
2213
+ * @param material The glTF material
2214
+ * @param babylonMaterial The Babylon.js material
2215
+ * @returns List of additional textures
2216
+ */
2217
+ _extensionsPostExportMaterialAdditionalTexturesAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2089
2218
  _extensionsPostExportTextures(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
2090
2219
  _extensionsPostExportMeshPrimitive(primitive: BABYLON.GLTF2.IMeshPrimitive): void;
2091
2220
  _extensionsPreGenerateBinaryAsync(): Promise<void>;
@@ -2494,7 +2623,7 @@ declare module BABYLON {
2494
2623
  * @param babylonMaterial corresponding babylon material
2495
2624
  * @returns array of additional textures to export
2496
2625
  */
2497
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2626
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2498
2627
  private _isExtensionEnabled;
2499
2628
  private _hasTexturesExtension;
2500
2629
  /**
@@ -2551,7 +2680,7 @@ declare module BABYLON {
2551
2680
  * @param babylonMaterial corresponding babylon material
2552
2681
  * @returns array of additional textures to export
2553
2682
  */
2554
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2683
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2555
2684
  private _isExtensionEnabled;
2556
2685
  private _hasTexturesExtension;
2557
2686
  /**
@@ -2589,7 +2718,7 @@ declare module BABYLON {
2589
2718
  * @param babylonMaterial corresponding babylon material
2590
2719
  * @returns array of additional textures to export
2591
2720
  */
2592
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2721
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2593
2722
  private _isExtensionEnabled;
2594
2723
  private _hasTexturesExtension;
2595
2724
  /**
@@ -2619,7 +2748,7 @@ declare module BABYLON {
2619
2748
  dispose(): void;
2620
2749
  /** @internal */
2621
2750
  get wasUsed(): boolean;
2622
- postExportMaterialAdditionalTextures(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2751
+ postExportMaterialAdditionalTexturesAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2623
2752
  postExportMaterialAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2624
2753
  }
2625
2754
 
@@ -2640,7 +2769,7 @@ declare module BABYLON {
2640
2769
  dispose(): void;
2641
2770
  /** @internal */
2642
2771
  get wasUsed(): boolean;
2643
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2772
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2644
2773
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2645
2774
  }
2646
2775
 
@@ -2753,7 +2882,7 @@ declare module BABYLON {
2753
2882
  * @param babylonMaterial corresponding babylon material
2754
2883
  * @returns array of additional textures to export
2755
2884
  */
2756
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2885
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2757
2886
  private _isExtensionEnabled;
2758
2887
  /**
2759
2888
  * After exporting a material
@@ -2766,6 +2895,98 @@ declare module BABYLON {
2766
2895
  }
2767
2896
 
2768
2897
 
2898
+ /**
2899
+ * @internal
2900
+ */
2901
+ export class KHR_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
2902
+ /** Name of this extension */
2903
+ readonly name = "KHR_materials_diffuse_roughness";
2904
+ /** Defines whether this extension is enabled */
2905
+ enabled: boolean;
2906
+ /** Defines whether this extension is required */
2907
+ required: boolean;
2908
+ private _exporter;
2909
+ private _wasUsed;
2910
+ constructor(exporter: GLTFExporter);
2911
+ dispose(): void;
2912
+ /** @internal */
2913
+ get wasUsed(): boolean;
2914
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2915
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2916
+ }
2917
+
2918
+
2919
+ /**
2920
+ * @internal
2921
+ */
2922
+ export class KHR_materials_clearcoat_darkening implements IGLTFExporterExtensionV2 {
2923
+ /** Name of this extension */
2924
+ readonly name = "KHR_materials_clearcoat_darkening";
2925
+ /** Defines whether this extension is enabled */
2926
+ enabled: boolean;
2927
+ /** Defines whether this extension is required */
2928
+ required: boolean;
2929
+ private _exporter;
2930
+ private _wasUsed;
2931
+ constructor(exporter: GLTFExporter);
2932
+ dispose(): void;
2933
+ /** @internal */
2934
+ get wasUsed(): boolean;
2935
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2936
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2937
+ }
2938
+
2939
+
2940
+ /**
2941
+ * @internal
2942
+ */
2943
+ export class KHR_materials_clearcoat_color implements IGLTFExporterExtensionV2 {
2944
+ /** Name of this extension */
2945
+ readonly name = "KHR_materials_clearcoat_color";
2946
+ /** Defines whether this extension is enabled */
2947
+ enabled: boolean;
2948
+ /** Defines whether this extension is required */
2949
+ required: boolean;
2950
+ private _exporter;
2951
+ private _wasUsed;
2952
+ constructor(exporter: GLTFExporter);
2953
+ dispose(): void;
2954
+ /** @internal */
2955
+ get wasUsed(): boolean;
2956
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2957
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2958
+ }
2959
+
2960
+
2961
+ /**
2962
+ * @internal
2963
+ */
2964
+ export class KHR_materials_clearcoat_anisotropy implements IGLTFExporterExtensionV2 {
2965
+ /** Name of this extension */
2966
+ readonly name = "KHR_materials_clearcoat_anisotropy";
2967
+ /** Defines whether this extension is enabled */
2968
+ enabled: boolean;
2969
+ /** Defines whether this extension is required */
2970
+ required: boolean;
2971
+ private _exporter;
2972
+ private _wasUsed;
2973
+ private _anisoTexturesMap;
2974
+ constructor(exporter: GLTFExporter);
2975
+ dispose(): void;
2976
+ /** @internal */
2977
+ get wasUsed(): boolean;
2978
+ /**
2979
+ * After exporting a material, deal with the additional textures
2980
+ * @param context GLTF context of the material
2981
+ * @param node exported GLTF node
2982
+ * @param babylonMaterial corresponding babylon material
2983
+ * @returns array of additional textures to export
2984
+ */
2985
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2986
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2987
+ }
2988
+
2989
+
2769
2990
  /**
2770
2991
  * @internal
2771
2992
  */
@@ -2782,7 +3003,7 @@ declare module BABYLON {
2782
3003
  dispose(): void;
2783
3004
  /** @internal */
2784
3005
  get wasUsed(): boolean;
2785
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
3006
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2786
3007
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2787
3008
  }
2788
3009
 
@@ -2799,11 +3020,19 @@ declare module BABYLON {
2799
3020
  required: boolean;
2800
3021
  private _exporter;
2801
3022
  private _wasUsed;
3023
+ private _anisoTexturesMap;
2802
3024
  constructor(exporter: GLTFExporter);
2803
3025
  dispose(): void;
2804
3026
  /** @internal */
2805
3027
  get wasUsed(): boolean;
2806
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
3028
+ /**
3029
+ * After exporting a material, deal with the additional textures
3030
+ * @param context GLTF context of the material
3031
+ * @param node exported GLTF node
3032
+ * @param babylonMaterial corresponding babylon material
3033
+ * @returns array of additional textures to export
3034
+ */
3035
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
2807
3036
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2808
3037
  }
2809
3038
 
@@ -2938,27 +3167,6 @@ declare module BABYLON {
2938
3167
  }
2939
3168
 
2940
3169
 
2941
- /**
2942
- * @internal
2943
- */
2944
- export class EXT_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
2945
- /** Name of this extension */
2946
- readonly name = "EXT_materials_diffuse_roughness";
2947
- /** Defines whether this extension is enabled */
2948
- enabled: boolean;
2949
- /** Defines whether this extension is required */
2950
- required: boolean;
2951
- private _exporter;
2952
- private _wasUsed;
2953
- constructor(exporter: GLTFExporter);
2954
- dispose(): void;
2955
- /** @internal */
2956
- get wasUsed(): boolean;
2957
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2958
- postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2959
- }
2960
-
2961
-
2962
3170
  /**
2963
3171
  * Options for the USDZ export
2964
3172
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-serializers",
3
- "version": "8.28.0",
3
+ "version": "8.28.2",
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.28.0",
19
- "babylonjs-gltf2interface": "^8.28.0"
18
+ "babylonjs": "^8.28.2",
19
+ "babylonjs-gltf2interface": "^8.28.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",