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.
@@ -297,6 +297,12 @@ declare module BABYLON {
297
297
  private _getMaxComponent;
298
298
  /**
299
299
  * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors
300
+ * @param baseColor Base color of the material
301
+ * @param metallic Metallic factor of the material
302
+ * @param roughness Roughness factor of the material
303
+ * @param albedoTexture Albedo texture of the material
304
+ * @param metallicTexture Metallic texture of the material
305
+ * @param roughnessTexture Roughness texture of the material
300
306
  * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
301
307
  * @param glTFPbrMetallicRoughness glTF PBR Metallic Roughness interface
302
308
  * @param hasUVs specifies if texture coordinates are present on the submesh to determine if textures should be applied
@@ -315,6 +321,7 @@ declare module BABYLON {
315
321
  private _convertSpecGlossFactorsToMetallicRoughnessAsync;
316
322
  exportPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, hasUVs: boolean): Promise<number>;
317
323
  private _setMetallicRoughnessPbrMaterialAsync;
324
+ exportOpenPBRMaterialAsync(babylonOpenPBRMaterial: OpenPBRMaterial, hasUVs: boolean): Promise<number>;
318
325
  exportTextureAsync(babylonTexture: BaseTexture): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
319
326
  private _exportTextureImageAsync;
320
327
  private _exportImage;
@@ -368,7 +375,7 @@ declare module BABYLON {
368
375
  * @param babylonMaterial BabylonJS material
369
376
  * @returns List of textures
370
377
  */
371
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
378
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
372
379
  /**
373
380
  * Define this method to modify the glTF buffer data before it is finalized and written
374
381
  * @param bufferManager Buffer manager
@@ -430,7 +437,14 @@ declare module BABYLON {
430
437
  private _ApplyExtensions;
431
438
  _extensionsPostExportNodeAsync(context: string, node: BABYLON.GLTF2.INode, babylonNode: Node, nodeMap: Map<Node, number>, convertToRightHanded: boolean): Promise<Nullable<BABYLON.GLTF2.INode>>;
432
439
  _extensionsPostExportMaterialAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<Nullable<BABYLON.GLTF2.IMaterial>>;
433
- _extensionsPostExportMaterialAdditionalTextures(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
440
+ /**
441
+ * Get additional textures for a material
442
+ * @param context The context when loading the asset
443
+ * @param material The glTF material
444
+ * @param babylonMaterial The Babylon.js material
445
+ * @returns List of additional textures
446
+ */
447
+ _extensionsPostExportMaterialAdditionalTexturesAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
434
448
  _extensionsPostExportTextures(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
435
449
  _extensionsPostExportMeshPrimitive(primitive: BABYLON.GLTF2.IMeshPrimitive): void;
436
450
  _extensionsPreGenerateBinaryAsync(): Promise<void>;
@@ -839,7 +853,7 @@ declare module BABYLON {
839
853
  * @param babylonMaterial corresponding babylon material
840
854
  * @returns array of additional textures to export
841
855
  */
842
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
856
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
843
857
  private _isExtensionEnabled;
844
858
  private _hasTexturesExtension;
845
859
  /**
@@ -896,7 +910,7 @@ declare module BABYLON {
896
910
  * @param babylonMaterial corresponding babylon material
897
911
  * @returns array of additional textures to export
898
912
  */
899
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
913
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
900
914
  private _isExtensionEnabled;
901
915
  private _hasTexturesExtension;
902
916
  /**
@@ -934,7 +948,7 @@ declare module BABYLON {
934
948
  * @param babylonMaterial corresponding babylon material
935
949
  * @returns array of additional textures to export
936
950
  */
937
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
951
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
938
952
  private _isExtensionEnabled;
939
953
  private _hasTexturesExtension;
940
954
  /**
@@ -964,7 +978,7 @@ declare module BABYLON {
964
978
  dispose(): void;
965
979
  /** @internal */
966
980
  get wasUsed(): boolean;
967
- postExportMaterialAdditionalTextures(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
981
+ postExportMaterialAdditionalTexturesAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
968
982
  postExportMaterialAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
969
983
  }
970
984
 
@@ -985,7 +999,7 @@ declare module BABYLON {
985
999
  dispose(): void;
986
1000
  /** @internal */
987
1001
  get wasUsed(): boolean;
988
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1002
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
989
1003
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
990
1004
  }
991
1005
 
@@ -1098,7 +1112,7 @@ declare module BABYLON {
1098
1112
  * @param babylonMaterial corresponding babylon material
1099
1113
  * @returns array of additional textures to export
1100
1114
  */
1101
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1115
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1102
1116
  private _isExtensionEnabled;
1103
1117
  /**
1104
1118
  * After exporting a material
@@ -1111,6 +1125,98 @@ declare module BABYLON {
1111
1125
  }
1112
1126
 
1113
1127
 
1128
+ /**
1129
+ * @internal
1130
+ */
1131
+ export class KHR_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
1132
+ /** Name of this extension */
1133
+ readonly name = "KHR_materials_diffuse_roughness";
1134
+ /** Defines whether this extension is enabled */
1135
+ enabled: boolean;
1136
+ /** Defines whether this extension is required */
1137
+ required: boolean;
1138
+ private _exporter;
1139
+ private _wasUsed;
1140
+ constructor(exporter: GLTFExporter);
1141
+ dispose(): void;
1142
+ /** @internal */
1143
+ get wasUsed(): boolean;
1144
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1145
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1146
+ }
1147
+
1148
+
1149
+ /**
1150
+ * @internal
1151
+ */
1152
+ export class KHR_materials_clearcoat_darkening implements IGLTFExporterExtensionV2 {
1153
+ /** Name of this extension */
1154
+ readonly name = "KHR_materials_clearcoat_darkening";
1155
+ /** Defines whether this extension is enabled */
1156
+ enabled: boolean;
1157
+ /** Defines whether this extension is required */
1158
+ required: boolean;
1159
+ private _exporter;
1160
+ private _wasUsed;
1161
+ constructor(exporter: GLTFExporter);
1162
+ dispose(): void;
1163
+ /** @internal */
1164
+ get wasUsed(): boolean;
1165
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1166
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1167
+ }
1168
+
1169
+
1170
+ /**
1171
+ * @internal
1172
+ */
1173
+ export class KHR_materials_clearcoat_color implements IGLTFExporterExtensionV2 {
1174
+ /** Name of this extension */
1175
+ readonly name = "KHR_materials_clearcoat_color";
1176
+ /** Defines whether this extension is enabled */
1177
+ enabled: boolean;
1178
+ /** Defines whether this extension is required */
1179
+ required: boolean;
1180
+ private _exporter;
1181
+ private _wasUsed;
1182
+ constructor(exporter: GLTFExporter);
1183
+ dispose(): void;
1184
+ /** @internal */
1185
+ get wasUsed(): boolean;
1186
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1187
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1188
+ }
1189
+
1190
+
1191
+ /**
1192
+ * @internal
1193
+ */
1194
+ export class KHR_materials_clearcoat_anisotropy implements IGLTFExporterExtensionV2 {
1195
+ /** Name of this extension */
1196
+ readonly name = "KHR_materials_clearcoat_anisotropy";
1197
+ /** Defines whether this extension is enabled */
1198
+ enabled: boolean;
1199
+ /** Defines whether this extension is required */
1200
+ required: boolean;
1201
+ private _exporter;
1202
+ private _wasUsed;
1203
+ private _anisoTexturesMap;
1204
+ constructor(exporter: GLTFExporter);
1205
+ dispose(): void;
1206
+ /** @internal */
1207
+ get wasUsed(): boolean;
1208
+ /**
1209
+ * After exporting a material, deal with the additional textures
1210
+ * @param context GLTF context of the material
1211
+ * @param node exported GLTF node
1212
+ * @param babylonMaterial corresponding babylon material
1213
+ * @returns array of additional textures to export
1214
+ */
1215
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1216
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1217
+ }
1218
+
1219
+
1114
1220
  /**
1115
1221
  * @internal
1116
1222
  */
@@ -1127,7 +1233,7 @@ declare module BABYLON {
1127
1233
  dispose(): void;
1128
1234
  /** @internal */
1129
1235
  get wasUsed(): boolean;
1130
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1236
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1131
1237
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1132
1238
  }
1133
1239
 
@@ -1144,11 +1250,19 @@ declare module BABYLON {
1144
1250
  required: boolean;
1145
1251
  private _exporter;
1146
1252
  private _wasUsed;
1253
+ private _anisoTexturesMap;
1147
1254
  constructor(exporter: GLTFExporter);
1148
1255
  dispose(): void;
1149
1256
  /** @internal */
1150
1257
  get wasUsed(): boolean;
1151
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1258
+ /**
1259
+ * After exporting a material, deal with the additional textures
1260
+ * @param context GLTF context of the material
1261
+ * @param node exported GLTF node
1262
+ * @param babylonMaterial corresponding babylon material
1263
+ * @returns array of additional textures to export
1264
+ */
1265
+ postExportMaterialAdditionalTexturesAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BaseTexture[]>;
1152
1266
  postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1153
1267
  }
1154
1268
 
@@ -1283,27 +1397,6 @@ declare module BABYLON {
1283
1397
  }
1284
1398
 
1285
1399
 
1286
- /**
1287
- * @internal
1288
- */
1289
- export class EXT_materials_diffuse_roughness implements IGLTFExporterExtensionV2 {
1290
- /** Name of this extension */
1291
- readonly name = "EXT_materials_diffuse_roughness";
1292
- /** Defines whether this extension is enabled */
1293
- enabled: boolean;
1294
- /** Defines whether this extension is required */
1295
- required: boolean;
1296
- private _exporter;
1297
- private _wasUsed;
1298
- constructor(exporter: GLTFExporter);
1299
- dispose(): void;
1300
- /** @internal */
1301
- get wasUsed(): boolean;
1302
- postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1303
- postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1304
- }
1305
-
1306
-
1307
1400
  /**
1308
1401
  * Options for the USDZ export
1309
1402
  */