babylonjs-serializers 5.0.0 → 5.0.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.
@@ -32,11 +32,11 @@ declare module BABYLON {
32
32
  * @param node glTF node
33
33
  * @param babylonNode BabylonJS node
34
34
  * @param nodeMap Node mapping of unique id to glTF node index
35
- * @returns nullable INode promise
35
+ * @returns nullable BABYLON.GLTF2.INode promise
36
36
  */
37
- postExportNodeAsync(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
37
+ postExportNodeAsync(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
38
38
  [key: number]: number;
39
- }): Promise<Nullable<INode>>;
39
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
40
40
  }
41
41
 
42
42
 
@@ -56,8 +56,8 @@ declare module BABYLON {
56
56
  dispose(): void;
57
57
  /** @hidden */
58
58
  get wasUsed(): boolean;
59
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
60
- postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
59
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
60
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
61
61
  }
62
62
 
63
63
 
@@ -77,8 +77,8 @@ declare module BABYLON {
77
77
  dispose(): void;
78
78
  /** @hidden */
79
79
  get wasUsed(): boolean;
80
- postExportMaterialAdditionalTextures(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
81
- postExportMaterialAsync(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
80
+ postExportMaterialAdditionalTextures(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
81
+ postExportMaterialAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
82
82
  }
83
83
 
84
84
 
@@ -97,7 +97,7 @@ declare module BABYLON {
97
97
  /** @hidden */
98
98
  get wasUsed(): boolean;
99
99
  dispose(): void;
100
- postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
100
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
101
101
  }
102
102
 
103
103
 
@@ -118,7 +118,7 @@ declare module BABYLON {
118
118
  dispose(): void;
119
119
  /** @hidden */
120
120
  get wasUsed(): boolean;
121
- postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: Texture): void;
121
+ postExportTexture?(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: Texture): void;
122
122
  preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Texture>;
123
123
  /**
124
124
  * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
@@ -143,9 +143,9 @@ declare module BABYLON {
143
143
  */
144
144
  outputs: number[][];
145
145
  /**
146
- * BABYLON.Animation interpolation data.
146
+ * Animation interpolation data.
147
147
  */
148
- samplerInterpolation: AnimationSamplerInterpolation;
148
+ samplerInterpolation: BABYLON.GLTF2.AnimationSamplerInterpolation;
149
149
  /**
150
150
  * Minimum keyframe value.
151
151
  */
@@ -162,11 +162,11 @@ declare module BABYLON {
162
162
  /**
163
163
  * The target channel for the animation
164
164
  */
165
- animationChannelTargetPath: AnimationChannelTargetPath;
165
+ animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath;
166
166
  /**
167
167
  * The glTF accessor type for the data.
168
168
  */
169
- dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
169
+ dataAccessorType: BABYLON.GLTF2.AccessorType.VEC3 | BABYLON.GLTF2.AccessorType.VEC4 | BABYLON.GLTF2.AccessorType.SCALAR;
170
170
  /**
171
171
  * Specifies if quaternions should be used.
172
172
  */
@@ -188,7 +188,7 @@ declare module BABYLON {
188
188
  * @param useQuaternion - Specifies if quaternions are used.
189
189
  * @returns nullable IAnimationData
190
190
  */
191
- static _CreateNodeAnimation(babylonTransformNode: BABYLON.TransformNode, animation: BABYLON.Animation, animationChannelTargetPath: AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
191
+ static _CreateNodeAnimation(babylonTransformNode: TransformNode, animation: Animation, animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
192
192
  private static _DeduceAnimationInfo;
193
193
  /**
194
194
  * @ignore
@@ -204,9 +204,9 @@ declare module BABYLON {
204
204
  * @param convertToRightHandedSystem
205
205
  * @param animationSampleRate
206
206
  */
207
- static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
207
+ static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: BABYLON.GLTF2.IAnimation, idleGLTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
208
208
  [key: number]: number;
209
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
209
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
210
210
  /**
211
211
  * @ignore
212
212
  * Create individual morph animations from the mesh's morph target animation tracks
@@ -221,9 +221,9 @@ declare module BABYLON {
221
221
  * @param convertToRightHandedSystem
222
222
  * @param animationSampleRate
223
223
  */
224
- static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
224
+ static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: BABYLON.GLTF2.IAnimation, idleGLTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
225
225
  [key: number]: number;
226
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
226
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
227
227
  /**
228
228
  * @ignore
229
229
  * Create node and morph animations from the animation groups
@@ -237,9 +237,9 @@ declare module BABYLON {
237
237
  * @param convertToRightHandedSystemMap
238
238
  * @param animationSampleRate
239
239
  */
240
- static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: {
240
+ static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
241
241
  [key: number]: number;
242
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystemMap: {
242
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystemMap: {
243
243
  [nodeId: number]: boolean;
244
244
  }, animationSampleRate: number): void;
245
245
  private static _AddAnimation;
@@ -358,19 +358,19 @@ declare module BABYLON {
358
358
  /**
359
359
  * Stores the glTF to export
360
360
  */
361
- _glTF: IGLTF;
361
+ _glTF: BABYLON.GLTF2.IGLTF;
362
362
  /**
363
363
  * Stores all generated buffer views, which represents views into the main glTF buffer data
364
364
  */
365
- _bufferViews: IBufferView[];
365
+ _bufferViews: BABYLON.GLTF2.IBufferView[];
366
366
  /**
367
367
  * Stores all the generated accessors, which is used for accessing the data within the buffer views in glTF
368
368
  */
369
- _accessors: IAccessor[];
369
+ _accessors: BABYLON.GLTF2.IAccessor[];
370
370
  /**
371
371
  * Stores all the generated nodes, which contains transform and/or mesh information per node
372
372
  */
373
- _nodes: INode[];
373
+ _nodes: BABYLON.GLTF2.INode[];
374
374
  /**
375
375
  * Stores all the generated glTF scenes, which stores multiple node hierarchies
376
376
  */
@@ -386,26 +386,26 @@ declare module BABYLON {
386
386
  /**
387
387
  * Stores all the generated material information, which represents the appearance of each primitive
388
388
  */
389
- _materials: IMaterial[];
389
+ _materials: BABYLON.GLTF2.IMaterial[];
390
390
  _materialMap: {
391
391
  [materialID: number]: number;
392
392
  };
393
393
  /**
394
394
  * Stores all the generated texture information, which is referenced by glTF materials
395
395
  */
396
- _textures: ITexture[];
396
+ _textures: BABYLON.GLTF2.ITexture[];
397
397
  /**
398
398
  * Stores all the generated image information, which is referenced by glTF textures
399
399
  */
400
- _images: IImage[];
400
+ _images: BABYLON.GLTF2.IImage[];
401
401
  /**
402
402
  * Stores all the texture samplers
403
403
  */
404
- _samplers: ISampler[];
404
+ _samplers: BABYLON.GLTF2.ISampler[];
405
405
  /**
406
406
  * Stores all the generated glTF skins
407
407
  */
408
- _skins: ISkin[];
408
+ _skins: BABYLON.GLTF2.ISkin[];
409
409
  /**
410
410
  * Stores all the generated animation samplers, which is referenced by glTF animations
411
411
  */
@@ -428,12 +428,12 @@ declare module BABYLON {
428
428
  _imageData: {
429
429
  [fileName: string]: {
430
430
  data: Uint8Array;
431
- mimeType: ImageMimeType;
431
+ mimeType: BABYLON.GLTF2.ImageMimeType;
432
432
  };
433
433
  };
434
434
  protected _orderedImageData: Array<{
435
435
  data: Uint8Array;
436
- mimeType: ImageMimeType;
436
+ mimeType: BABYLON.GLTF2.ImageMimeType;
437
437
  }>;
438
438
  /**
439
439
  * Stores a map of the unique id of a node to its index in the node array
@@ -464,14 +464,14 @@ declare module BABYLON {
464
464
  private static _ExtensionFactories;
465
465
  private _applyExtension;
466
466
  private _applyExtensions;
467
- _extensionsPreExportTextureAsync(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Nullable<BaseTexture>>;
468
- _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<Nullable<IMeshPrimitive>>;
469
- _extensionsPostExportNodeAsync(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
467
+ _extensionsPreExportTextureAsync(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BaseTexture>>;
468
+ _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: BABYLON.GLTF2.IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.IMeshPrimitive>>;
469
+ _extensionsPostExportNodeAsync(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
470
470
  [key: number]: number;
471
- }): Promise<Nullable<INode>>;
472
- _extensionsPostExportMaterialAsync(context: string, material: Nullable<IMaterial>, babylonMaterial: BABYLON.Material): Promise<Nullable<IMaterial>>;
473
- _extensionsPostExportMaterialAdditionalTextures(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BaseTexture[];
474
- _extensionsPostExportTextures(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void;
471
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
472
+ _extensionsPostExportMaterialAsync(context: string, material: Nullable<BABYLON.GLTF2.IMaterial>, babylonMaterial: Material): Promise<Nullable<BABYLON.GLTF2.IMaterial>>;
473
+ _extensionsPostExportMaterialAdditionalTextures(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
474
+ _extensionsPostExportTextures(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
475
475
  private _forEachExtensions;
476
476
  private _extensionsOnExporting;
477
477
  /**
@@ -571,7 +571,7 @@ declare module BABYLON {
571
571
  * @param convertToRightHandedSystem Converts the values to right-handed
572
572
  * @param babylonTransformNode
573
573
  */
574
- _writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: BABYLON.TransformNode): void;
574
+ _writeAttributeData(vertexBufferKind: string, attributeComponentKind: BABYLON.GLTF2.AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
575
575
  /**
576
576
  * Writes mesh attribute data to a data buffer
577
577
  * Returns the bytelength of the data
@@ -586,7 +586,7 @@ declare module BABYLON {
586
586
  * @param convertToRightHandedSystem Converts the values to right-handed
587
587
  * @param minMax
588
588
  */
589
- writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
589
+ writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: BABYLON.GLTF2.AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
590
590
  /**
591
591
  * Generates glTF json data
592
592
  * @param shouldUseGlb Indicates whether the json should be written for a glb file
@@ -773,10 +773,10 @@ declare module BABYLON {
773
773
  * @param byteOffset If defined, specifies where to set the value as an offset.
774
774
  */
775
775
  getUInt32(byteOffset: number): number;
776
- getVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
777
- setVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
778
- getVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
779
- setVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
776
+ getVector3Float32FromRef(vector3: Vector3, byteOffset: number): void;
777
+ setVector3Float32FromRef(vector3: Vector3, byteOffset: number): void;
778
+ getVector4Float32FromRef(vector4: Vector4, byteOffset: number): void;
779
+ setVector4Float32FromRef(vector4: Vector4, byteOffset: number): void;
780
780
  /**
781
781
  * Stores a Float32 in the array buffer
782
782
  * @param entry
@@ -806,47 +806,47 @@ declare module BABYLON {
806
806
  * @param mimeType The mime-type of the generated image
807
807
  * @returns A promise that resolves with the exported texture
808
808
  */
809
- preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Texture>;
809
+ preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Texture>;
810
810
  /**
811
811
  * Define this method to get notified when a texture info is created
812
812
  * @param context The context when loading the asset
813
813
  * @param textureInfo The glTF texture info
814
814
  * @param babylonTexture The Babylon.js texture
815
815
  */
816
- postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void;
816
+ postExportTexture?(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
817
817
  /**
818
818
  * Define this method to modify the default behavior when exporting texture info
819
819
  * @param context The context when loading the asset
820
820
  * @param meshPrimitive glTF mesh primitive
821
821
  * @param babylonSubMesh Babylon submesh
822
822
  * @param binaryWriter glTF serializer binary writer instance
823
- * @returns nullable IMeshPrimitive promise
823
+ * @returns nullable BABYLON.GLTF2.IMeshPrimitive promise
824
824
  */
825
- postExportMeshPrimitiveAsync?(context: string, meshPrimitive: Nullable<IMeshPrimitive>, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<IMeshPrimitive>;
825
+ postExportMeshPrimitiveAsync?(context: string, meshPrimitive: Nullable<BABYLON.GLTF2.IMeshPrimitive>, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<BABYLON.GLTF2.IMeshPrimitive>;
826
826
  /**
827
827
  * Define this method to modify the default behavior when exporting a node
828
828
  * @param context The context when exporting the node
829
829
  * @param node glTF node
830
830
  * @param babylonNode BabylonJS node
831
- * @returns nullable INode promise
831
+ * @returns nullable BABYLON.GLTF2.INode promise
832
832
  */
833
- postExportNodeAsync?(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
833
+ postExportNodeAsync?(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
834
834
  [key: number]: number;
835
- }): Promise<Nullable<INode>>;
835
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
836
836
  /**
837
837
  * Define this method to modify the default behavior when exporting a material
838
838
  * @param material glTF material
839
839
  * @param babylonMaterial BabylonJS material
840
- * @returns nullable IMaterial promise
840
+ * @returns nullable BABYLON.GLTF2.IMaterial promise
841
841
  */
842
- postExportMaterialAsync?(context: string, node: Nullable<IMaterial>, babylonMaterial: Material): Promise<IMaterial>;
842
+ postExportMaterialAsync?(context: string, node: Nullable<BABYLON.GLTF2.IMaterial>, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
843
843
  /**
844
844
  * Define this method to return additional textures to export from a material
845
845
  * @param material glTF material
846
846
  * @param babylonMaterial BabylonJS material
847
847
  * @returns List of textures
848
848
  */
849
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
849
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
850
850
  /** Gets a boolean indicating that this extension was used */
851
851
  wasUsed: boolean;
852
852
  /** Gets a boolean indicating that this extension is required for the file to work */
@@ -897,26 +897,26 @@ declare module BABYLON {
897
897
  * @param mimeType texture mime type
898
898
  * @param hasTextureCoords specifies if texture coordinates are present on the material
899
899
  */
900
- _convertMaterialsToGLTFAsync(exportMaterials: Set<Material>, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<void>;
900
+ _convertMaterialsToGLTFAsync(exportMaterials: Set<Material>, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
901
901
  /**
902
902
  * Makes a copy of the glTF material without the texture parameters
903
903
  * @param originalMaterial original glTF material
904
904
  * @returns glTF material without texture parameters
905
905
  */
906
- _stripTexturesFromMaterial(originalMaterial: IMaterial): IMaterial;
906
+ _stripTexturesFromMaterial(originalMaterial: BABYLON.GLTF2.IMaterial): BABYLON.GLTF2.IMaterial;
907
907
  /**
908
908
  * Specifies if the material has any texture parameters present
909
909
  * @param material glTF Material
910
910
  * @returns boolean specifying if texture parameters are present
911
911
  */
912
- _hasTexturesPresent(material: IMaterial): boolean;
913
- _getTextureInfo(babylonTexture: Nullable<BaseTexture>): Nullable<ITextureInfo>;
912
+ _hasTexturesPresent(material: BABYLON.GLTF2.IMaterial): boolean;
913
+ _getTextureInfo(babylonTexture: Nullable<BaseTexture>): Nullable<BABYLON.GLTF2.ITextureInfo>;
914
914
  /**
915
915
  * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material
916
916
  * @param babylonStandardMaterial
917
917
  * @returns glTF Metallic Roughness Material representation
918
918
  */
919
- _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness;
919
+ _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): BABYLON.GLTF2.IMaterialPbrMetallicRoughness;
920
920
  /**
921
921
  * Computes the metallic factor
922
922
  * @param diffuse diffused value
@@ -937,7 +937,7 @@ declare module BABYLON {
937
937
  * @param mimeType mime type to use for the textures
938
938
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
939
939
  */
940
- _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
940
+ _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
941
941
  private _finishMaterial;
942
942
  /**
943
943
  * Converts a Babylon PBR Metallic Roughness Material to a glTF Material
@@ -945,7 +945,7 @@ declare module BABYLON {
945
945
  * @param mimeType mime type to use for the textures
946
946
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
947
947
  */
948
- _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
948
+ _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
949
949
  /**
950
950
  * Converts an image typed array buffer to a base64 image
951
951
  * @param buffer typed array buffer
@@ -1034,7 +1034,7 @@ declare module BABYLON {
1034
1034
  * @param mimeType mime type to use for the textures
1035
1035
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
1036
1036
  */
1037
- _convertPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
1037
+ _convertPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
1038
1038
  private _setMetallicRoughnessPbrMaterial;
1039
1039
  private _getPixelsFromTexture;
1040
1040
  /**
@@ -1043,8 +1043,8 @@ declare module BABYLON {
1043
1043
  * @param mimeType Mime Type of the babylonTexture
1044
1044
  * @return glTF texture info, or null if the texture format is not supported
1045
1045
  */
1046
- _exportTextureAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
1047
- _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
1046
+ _exportTextureAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
1047
+ _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
1048
1048
  /**
1049
1049
  * Builds a texture from base64 string
1050
1050
  * @param base64Texture base64 texture string
@@ -1130,7 +1130,7 @@ declare module BABYLON {
1130
1130
  * @param name name of the buffer view
1131
1131
  * @returns bufferView for glTF
1132
1132
  */
1133
- static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): IBufferView;
1133
+ static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): BABYLON.GLTF2.IBufferView;
1134
1134
  /**
1135
1135
  * Creates an accessor based on the supplied arguments
1136
1136
  * @param bufferviewIndex The index of the bufferview referenced by this accessor
@@ -1143,7 +1143,7 @@ declare module BABYLON {
1143
1143
  * @param max Maximum value of each component in this attribute
1144
1144
  * @returns accessor for glTF
1145
1145
  */
1146
- static _CreateAccessor(bufferviewIndex: number, name: string, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): IAccessor;
1146
+ static _CreateAccessor(bufferviewIndex: number, name: string, type: BABYLON.GLTF2.AccessorType, componentType: BABYLON.GLTF2.AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): BABYLON.GLTF2.IAccessor;
1147
1147
  /**
1148
1148
  * Calculates the minimum and maximum values of an array of position floats
1149
1149
  * @param positions Positions array of a mesh
@@ -1157,32 +1157,32 @@ declare module BABYLON {
1157
1157
  max: number[];
1158
1158
  };
1159
1159
  /**
1160
- * Converts a new right-handed BABYLON.Vector3
1160
+ * Converts a new right-handed Vector3
1161
1161
  * @param vector vector3 array
1162
- * @returns right-handed BABYLON.Vector3
1162
+ * @returns right-handed Vector3
1163
1163
  */
1164
- static _GetRightHandedPositionVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
1164
+ static _GetRightHandedPositionVector3(vector: Vector3): Vector3;
1165
1165
  /**
1166
- * Converts a BABYLON.Vector3 to right-handed
1167
- * @param vector BABYLON.Vector3 to convert to right-handed
1166
+ * Converts a Vector3 to right-handed
1167
+ * @param vector Vector3 to convert to right-handed
1168
1168
  */
1169
- static _GetRightHandedPositionVector3FromRef(vector: BABYLON.Vector3): void;
1169
+ static _GetRightHandedPositionVector3FromRef(vector: Vector3): void;
1170
1170
  /**
1171
1171
  * Converts a three element number array to right-handed
1172
1172
  * @param vector number array to convert to right-handed
1173
1173
  */
1174
1174
  static _GetRightHandedPositionArray3FromRef(vector: number[]): void;
1175
1175
  /**
1176
- * Converts a new right-handed BABYLON.Vector3
1176
+ * Converts a new right-handed Vector3
1177
1177
  * @param vector vector3 array
1178
- * @returns right-handed BABYLON.Vector3
1178
+ * @returns right-handed Vector3
1179
1179
  */
1180
- static _GetRightHandedNormalVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
1180
+ static _GetRightHandedNormalVector3(vector: Vector3): Vector3;
1181
1181
  /**
1182
- * Converts a BABYLON.Vector3 to right-handed
1183
- * @param vector BABYLON.Vector3 to convert to right-handed
1182
+ * Converts a Vector3 to right-handed
1183
+ * @param vector Vector3 to convert to right-handed
1184
1184
  */
1185
- static _GetRightHandedNormalVector3FromRef(vector: BABYLON.Vector3): void;
1185
+ static _GetRightHandedNormalVector3FromRef(vector: Vector3): void;
1186
1186
  /**
1187
1187
  * Converts a three element number array to right-handed
1188
1188
  * @param vector number array to convert to right-handed
@@ -1209,7 +1209,7 @@ declare module BABYLON {
1209
1209
  */
1210
1210
  static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
1211
1211
  static _NormalizeTangentFromRef(tangent: Vector4): void;
1212
- static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
1212
+ static _GetDataAccessorElementCount(accessorType: BABYLON.GLTF2.AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
1213
1213
  }
1214
1214
 
1215
1215
 
@@ -1468,11 +1468,11 @@ declare module BABYLON {
1468
1468
  * @param node glTF node
1469
1469
  * @param babylonNode BabylonJS node
1470
1470
  * @param nodeMap Node mapping of unique id to glTF node index
1471
- * @returns nullable INode promise
1471
+ * @returns nullable BABYLON.GLTF2.INode promise
1472
1472
  */
1473
- postExportNodeAsync(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
1473
+ postExportNodeAsync(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
1474
1474
  [key: number]: number;
1475
- }): Promise<Nullable<INode>>;
1475
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
1476
1476
  }
1477
1477
 
1478
1478
 
@@ -1492,8 +1492,8 @@ declare module BABYLON {
1492
1492
  dispose(): void;
1493
1493
  /** @hidden */
1494
1494
  get wasUsed(): boolean;
1495
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1496
- postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1495
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1496
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1497
1497
  }
1498
1498
 
1499
1499
 
@@ -1513,8 +1513,8 @@ declare module BABYLON {
1513
1513
  dispose(): void;
1514
1514
  /** @hidden */
1515
1515
  get wasUsed(): boolean;
1516
- postExportMaterialAdditionalTextures(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
1517
- postExportMaterialAsync(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1516
+ postExportMaterialAdditionalTextures(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1517
+ postExportMaterialAsync(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1518
1518
  }
1519
1519
 
1520
1520
 
@@ -1533,7 +1533,7 @@ declare module BABYLON {
1533
1533
  /** @hidden */
1534
1534
  get wasUsed(): boolean;
1535
1535
  dispose(): void;
1536
- postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise<IMaterial>;
1536
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
1537
1537
  }
1538
1538
 
1539
1539
 
@@ -1554,7 +1554,7 @@ declare module BABYLON {
1554
1554
  dispose(): void;
1555
1555
  /** @hidden */
1556
1556
  get wasUsed(): boolean;
1557
- postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: Texture): void;
1557
+ postExportTexture?(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: Texture): void;
1558
1558
  preExportTextureAsync(context: string, babylonTexture: Texture): Promise<Texture>;
1559
1559
  /**
1560
1560
  * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
@@ -1579,9 +1579,9 @@ declare module BABYLON {
1579
1579
  */
1580
1580
  outputs: number[][];
1581
1581
  /**
1582
- * BABYLON.Animation interpolation data.
1582
+ * Animation interpolation data.
1583
1583
  */
1584
- samplerInterpolation: AnimationSamplerInterpolation;
1584
+ samplerInterpolation: BABYLON.GLTF2.AnimationSamplerInterpolation;
1585
1585
  /**
1586
1586
  * Minimum keyframe value.
1587
1587
  */
@@ -1598,11 +1598,11 @@ declare module BABYLON {
1598
1598
  /**
1599
1599
  * The target channel for the animation
1600
1600
  */
1601
- animationChannelTargetPath: AnimationChannelTargetPath;
1601
+ animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath;
1602
1602
  /**
1603
1603
  * The glTF accessor type for the data.
1604
1604
  */
1605
- dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
1605
+ dataAccessorType: BABYLON.GLTF2.AccessorType.VEC3 | BABYLON.GLTF2.AccessorType.VEC4 | BABYLON.GLTF2.AccessorType.SCALAR;
1606
1606
  /**
1607
1607
  * Specifies if quaternions should be used.
1608
1608
  */
@@ -1624,7 +1624,7 @@ declare module BABYLON {
1624
1624
  * @param useQuaternion - Specifies if quaternions are used.
1625
1625
  * @returns nullable IAnimationData
1626
1626
  */
1627
- static _CreateNodeAnimation(babylonTransformNode: BABYLON.TransformNode, animation: BABYLON.Animation, animationChannelTargetPath: AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
1627
+ static _CreateNodeAnimation(babylonTransformNode: TransformNode, animation: Animation, animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
1628
1628
  private static _DeduceAnimationInfo;
1629
1629
  /**
1630
1630
  * @ignore
@@ -1640,9 +1640,9 @@ declare module BABYLON {
1640
1640
  * @param convertToRightHandedSystem
1641
1641
  * @param animationSampleRate
1642
1642
  */
1643
- static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
1643
+ static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: BABYLON.GLTF2.IAnimation, idleGLTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
1644
1644
  [key: number]: number;
1645
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
1645
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
1646
1646
  /**
1647
1647
  * @ignore
1648
1648
  * Create individual morph animations from the mesh's morph target animation tracks
@@ -1657,9 +1657,9 @@ declare module BABYLON {
1657
1657
  * @param convertToRightHandedSystem
1658
1658
  * @param animationSampleRate
1659
1659
  */
1660
- static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
1660
+ static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: BABYLON.GLTF2.IAnimation, idleGLTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
1661
1661
  [key: number]: number;
1662
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
1662
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
1663
1663
  /**
1664
1664
  * @ignore
1665
1665
  * Create node and morph animations from the animation groups
@@ -1673,9 +1673,9 @@ declare module BABYLON {
1673
1673
  * @param convertToRightHandedSystemMap
1674
1674
  * @param animationSampleRate
1675
1675
  */
1676
- static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: {
1676
+ static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
1677
1677
  [key: number]: number;
1678
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystemMap: {
1678
+ }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystemMap: {
1679
1679
  [nodeId: number]: boolean;
1680
1680
  }, animationSampleRate: number): void;
1681
1681
  private static _AddAnimation;
@@ -1794,19 +1794,19 @@ declare module BABYLON {
1794
1794
  /**
1795
1795
  * Stores the glTF to export
1796
1796
  */
1797
- _glTF: IGLTF;
1797
+ _glTF: BABYLON.GLTF2.IGLTF;
1798
1798
  /**
1799
1799
  * Stores all generated buffer views, which represents views into the main glTF buffer data
1800
1800
  */
1801
- _bufferViews: IBufferView[];
1801
+ _bufferViews: BABYLON.GLTF2.IBufferView[];
1802
1802
  /**
1803
1803
  * Stores all the generated accessors, which is used for accessing the data within the buffer views in glTF
1804
1804
  */
1805
- _accessors: IAccessor[];
1805
+ _accessors: BABYLON.GLTF2.IAccessor[];
1806
1806
  /**
1807
1807
  * Stores all the generated nodes, which contains transform and/or mesh information per node
1808
1808
  */
1809
- _nodes: INode[];
1809
+ _nodes: BABYLON.GLTF2.INode[];
1810
1810
  /**
1811
1811
  * Stores all the generated glTF scenes, which stores multiple node hierarchies
1812
1812
  */
@@ -1822,26 +1822,26 @@ declare module BABYLON {
1822
1822
  /**
1823
1823
  * Stores all the generated material information, which represents the appearance of each primitive
1824
1824
  */
1825
- _materials: IMaterial[];
1825
+ _materials: BABYLON.GLTF2.IMaterial[];
1826
1826
  _materialMap: {
1827
1827
  [materialID: number]: number;
1828
1828
  };
1829
1829
  /**
1830
1830
  * Stores all the generated texture information, which is referenced by glTF materials
1831
1831
  */
1832
- _textures: ITexture[];
1832
+ _textures: BABYLON.GLTF2.ITexture[];
1833
1833
  /**
1834
1834
  * Stores all the generated image information, which is referenced by glTF textures
1835
1835
  */
1836
- _images: IImage[];
1836
+ _images: BABYLON.GLTF2.IImage[];
1837
1837
  /**
1838
1838
  * Stores all the texture samplers
1839
1839
  */
1840
- _samplers: ISampler[];
1840
+ _samplers: BABYLON.GLTF2.ISampler[];
1841
1841
  /**
1842
1842
  * Stores all the generated glTF skins
1843
1843
  */
1844
- _skins: ISkin[];
1844
+ _skins: BABYLON.GLTF2.ISkin[];
1845
1845
  /**
1846
1846
  * Stores all the generated animation samplers, which is referenced by glTF animations
1847
1847
  */
@@ -1864,12 +1864,12 @@ declare module BABYLON {
1864
1864
  _imageData: {
1865
1865
  [fileName: string]: {
1866
1866
  data: Uint8Array;
1867
- mimeType: ImageMimeType;
1867
+ mimeType: BABYLON.GLTF2.ImageMimeType;
1868
1868
  };
1869
1869
  };
1870
1870
  protected _orderedImageData: Array<{
1871
1871
  data: Uint8Array;
1872
- mimeType: ImageMimeType;
1872
+ mimeType: BABYLON.GLTF2.ImageMimeType;
1873
1873
  }>;
1874
1874
  /**
1875
1875
  * Stores a map of the unique id of a node to its index in the node array
@@ -1900,14 +1900,14 @@ declare module BABYLON {
1900
1900
  private static _ExtensionFactories;
1901
1901
  private _applyExtension;
1902
1902
  private _applyExtensions;
1903
- _extensionsPreExportTextureAsync(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Nullable<BaseTexture>>;
1904
- _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<Nullable<IMeshPrimitive>>;
1905
- _extensionsPostExportNodeAsync(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
1903
+ _extensionsPreExportTextureAsync(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BaseTexture>>;
1904
+ _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: BABYLON.GLTF2.IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<Nullable<BABYLON.GLTF2.IMeshPrimitive>>;
1905
+ _extensionsPostExportNodeAsync(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
1906
1906
  [key: number]: number;
1907
- }): Promise<Nullable<INode>>;
1908
- _extensionsPostExportMaterialAsync(context: string, material: Nullable<IMaterial>, babylonMaterial: BABYLON.Material): Promise<Nullable<IMaterial>>;
1909
- _extensionsPostExportMaterialAdditionalTextures(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BaseTexture[];
1910
- _extensionsPostExportTextures(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void;
1907
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
1908
+ _extensionsPostExportMaterialAsync(context: string, material: Nullable<BABYLON.GLTF2.IMaterial>, babylonMaterial: Material): Promise<Nullable<BABYLON.GLTF2.IMaterial>>;
1909
+ _extensionsPostExportMaterialAdditionalTextures(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
1910
+ _extensionsPostExportTextures(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
1911
1911
  private _forEachExtensions;
1912
1912
  private _extensionsOnExporting;
1913
1913
  /**
@@ -2007,7 +2007,7 @@ declare module BABYLON {
2007
2007
  * @param convertToRightHandedSystem Converts the values to right-handed
2008
2008
  * @param babylonTransformNode
2009
2009
  */
2010
- _writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: BABYLON.TransformNode): void;
2010
+ _writeAttributeData(vertexBufferKind: string, attributeComponentKind: BABYLON.GLTF2.AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
2011
2011
  /**
2012
2012
  * Writes mesh attribute data to a data buffer
2013
2013
  * Returns the bytelength of the data
@@ -2022,7 +2022,7 @@ declare module BABYLON {
2022
2022
  * @param convertToRightHandedSystem Converts the values to right-handed
2023
2023
  * @param minMax
2024
2024
  */
2025
- writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
2025
+ writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: BABYLON.GLTF2.AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
2026
2026
  /**
2027
2027
  * Generates glTF json data
2028
2028
  * @param shouldUseGlb Indicates whether the json should be written for a glb file
@@ -2209,10 +2209,10 @@ declare module BABYLON {
2209
2209
  * @param byteOffset If defined, specifies where to set the value as an offset.
2210
2210
  */
2211
2211
  getUInt32(byteOffset: number): number;
2212
- getVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
2213
- setVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
2214
- getVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
2215
- setVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
2212
+ getVector3Float32FromRef(vector3: Vector3, byteOffset: number): void;
2213
+ setVector3Float32FromRef(vector3: Vector3, byteOffset: number): void;
2214
+ getVector4Float32FromRef(vector4: Vector4, byteOffset: number): void;
2215
+ setVector4Float32FromRef(vector4: Vector4, byteOffset: number): void;
2216
2216
  /**
2217
2217
  * Stores a Float32 in the array buffer
2218
2218
  * @param entry
@@ -2242,47 +2242,47 @@ declare module BABYLON {
2242
2242
  * @param mimeType The mime-type of the generated image
2243
2243
  * @returns A promise that resolves with the exported texture
2244
2244
  */
2245
- preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: ImageMimeType): Promise<Texture>;
2245
+ preExportTextureAsync?(context: string, babylonTexture: Nullable<Texture>, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Texture>;
2246
2246
  /**
2247
2247
  * Define this method to get notified when a texture info is created
2248
2248
  * @param context The context when loading the asset
2249
2249
  * @param textureInfo The glTF texture info
2250
2250
  * @param babylonTexture The Babylon.js texture
2251
2251
  */
2252
- postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void;
2252
+ postExportTexture?(context: string, textureInfo: BABYLON.GLTF2.ITextureInfo, babylonTexture: BaseTexture): void;
2253
2253
  /**
2254
2254
  * Define this method to modify the default behavior when exporting texture info
2255
2255
  * @param context The context when loading the asset
2256
2256
  * @param meshPrimitive glTF mesh primitive
2257
2257
  * @param babylonSubMesh Babylon submesh
2258
2258
  * @param binaryWriter glTF serializer binary writer instance
2259
- * @returns nullable IMeshPrimitive promise
2259
+ * @returns nullable BABYLON.GLTF2.IMeshPrimitive promise
2260
2260
  */
2261
- postExportMeshPrimitiveAsync?(context: string, meshPrimitive: Nullable<IMeshPrimitive>, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<IMeshPrimitive>;
2261
+ postExportMeshPrimitiveAsync?(context: string, meshPrimitive: Nullable<BABYLON.GLTF2.IMeshPrimitive>, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Promise<BABYLON.GLTF2.IMeshPrimitive>;
2262
2262
  /**
2263
2263
  * Define this method to modify the default behavior when exporting a node
2264
2264
  * @param context The context when exporting the node
2265
2265
  * @param node glTF node
2266
2266
  * @param babylonNode BabylonJS node
2267
- * @returns nullable INode promise
2267
+ * @returns nullable BABYLON.GLTF2.INode promise
2268
2268
  */
2269
- postExportNodeAsync?(context: string, node: Nullable<INode>, babylonNode: Node, nodeMap?: {
2269
+ postExportNodeAsync?(context: string, node: Nullable<BABYLON.GLTF2.INode>, babylonNode: Node, nodeMap?: {
2270
2270
  [key: number]: number;
2271
- }): Promise<Nullable<INode>>;
2271
+ }): Promise<Nullable<BABYLON.GLTF2.INode>>;
2272
2272
  /**
2273
2273
  * Define this method to modify the default behavior when exporting a material
2274
2274
  * @param material glTF material
2275
2275
  * @param babylonMaterial BabylonJS material
2276
- * @returns nullable IMaterial promise
2276
+ * @returns nullable BABYLON.GLTF2.IMaterial promise
2277
2277
  */
2278
- postExportMaterialAsync?(context: string, node: Nullable<IMaterial>, babylonMaterial: Material): Promise<IMaterial>;
2278
+ postExportMaterialAsync?(context: string, node: Nullable<BABYLON.GLTF2.IMaterial>, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
2279
2279
  /**
2280
2280
  * Define this method to return additional textures to export from a material
2281
2281
  * @param material glTF material
2282
2282
  * @param babylonMaterial BabylonJS material
2283
2283
  * @returns List of textures
2284
2284
  */
2285
- postExportMaterialAdditionalTextures?(context: string, node: IMaterial, babylonMaterial: Material): BaseTexture[];
2285
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
2286
2286
  /** Gets a boolean indicating that this extension was used */
2287
2287
  wasUsed: boolean;
2288
2288
  /** Gets a boolean indicating that this extension is required for the file to work */
@@ -2333,26 +2333,26 @@ declare module BABYLON {
2333
2333
  * @param mimeType texture mime type
2334
2334
  * @param hasTextureCoords specifies if texture coordinates are present on the material
2335
2335
  */
2336
- _convertMaterialsToGLTFAsync(exportMaterials: Set<Material>, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<void>;
2336
+ _convertMaterialsToGLTFAsync(exportMaterials: Set<Material>, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
2337
2337
  /**
2338
2338
  * Makes a copy of the glTF material without the texture parameters
2339
2339
  * @param originalMaterial original glTF material
2340
2340
  * @returns glTF material without texture parameters
2341
2341
  */
2342
- _stripTexturesFromMaterial(originalMaterial: IMaterial): IMaterial;
2342
+ _stripTexturesFromMaterial(originalMaterial: BABYLON.GLTF2.IMaterial): BABYLON.GLTF2.IMaterial;
2343
2343
  /**
2344
2344
  * Specifies if the material has any texture parameters present
2345
2345
  * @param material glTF Material
2346
2346
  * @returns boolean specifying if texture parameters are present
2347
2347
  */
2348
- _hasTexturesPresent(material: IMaterial): boolean;
2349
- _getTextureInfo(babylonTexture: Nullable<BaseTexture>): Nullable<ITextureInfo>;
2348
+ _hasTexturesPresent(material: BABYLON.GLTF2.IMaterial): boolean;
2349
+ _getTextureInfo(babylonTexture: Nullable<BaseTexture>): Nullable<BABYLON.GLTF2.ITextureInfo>;
2350
2350
  /**
2351
2351
  * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material
2352
2352
  * @param babylonStandardMaterial
2353
2353
  * @returns glTF Metallic Roughness Material representation
2354
2354
  */
2355
- _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness;
2355
+ _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): BABYLON.GLTF2.IMaterialPbrMetallicRoughness;
2356
2356
  /**
2357
2357
  * Computes the metallic factor
2358
2358
  * @param diffuse diffused value
@@ -2373,7 +2373,7 @@ declare module BABYLON {
2373
2373
  * @param mimeType mime type to use for the textures
2374
2374
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
2375
2375
  */
2376
- _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
2376
+ _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
2377
2377
  private _finishMaterial;
2378
2378
  /**
2379
2379
  * Converts a Babylon PBR Metallic Roughness Material to a glTF Material
@@ -2381,7 +2381,7 @@ declare module BABYLON {
2381
2381
  * @param mimeType mime type to use for the textures
2382
2382
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
2383
2383
  */
2384
- _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
2384
+ _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
2385
2385
  /**
2386
2386
  * Converts an image typed array buffer to a base64 image
2387
2387
  * @param buffer typed array buffer
@@ -2470,7 +2470,7 @@ declare module BABYLON {
2470
2470
  * @param mimeType mime type to use for the textures
2471
2471
  * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
2472
2472
  */
2473
- _convertPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
2473
+ _convertPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
2474
2474
  private _setMetallicRoughnessPbrMaterial;
2475
2475
  private _getPixelsFromTexture;
2476
2476
  /**
@@ -2479,8 +2479,8 @@ declare module BABYLON {
2479
2479
  * @param mimeType Mime Type of the babylonTexture
2480
2480
  * @return glTF texture info, or null if the texture format is not supported
2481
2481
  */
2482
- _exportTextureAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
2483
- _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
2482
+ _exportTextureAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2483
+ _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<Nullable<BABYLON.GLTF2.ITextureInfo>>;
2484
2484
  /**
2485
2485
  * Builds a texture from base64 string
2486
2486
  * @param base64Texture base64 texture string
@@ -2566,7 +2566,7 @@ declare module BABYLON {
2566
2566
  * @param name name of the buffer view
2567
2567
  * @returns bufferView for glTF
2568
2568
  */
2569
- static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): IBufferView;
2569
+ static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): BABYLON.GLTF2.IBufferView;
2570
2570
  /**
2571
2571
  * Creates an accessor based on the supplied arguments
2572
2572
  * @param bufferviewIndex The index of the bufferview referenced by this accessor
@@ -2579,7 +2579,7 @@ declare module BABYLON {
2579
2579
  * @param max Maximum value of each component in this attribute
2580
2580
  * @returns accessor for glTF
2581
2581
  */
2582
- static _CreateAccessor(bufferviewIndex: number, name: string, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): IAccessor;
2582
+ static _CreateAccessor(bufferviewIndex: number, name: string, type: BABYLON.GLTF2.AccessorType, componentType: BABYLON.GLTF2.AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): BABYLON.GLTF2.IAccessor;
2583
2583
  /**
2584
2584
  * Calculates the minimum and maximum values of an array of position floats
2585
2585
  * @param positions Positions array of a mesh
@@ -2593,32 +2593,32 @@ declare module BABYLON {
2593
2593
  max: number[];
2594
2594
  };
2595
2595
  /**
2596
- * Converts a new right-handed BABYLON.Vector3
2596
+ * Converts a new right-handed Vector3
2597
2597
  * @param vector vector3 array
2598
- * @returns right-handed BABYLON.Vector3
2598
+ * @returns right-handed Vector3
2599
2599
  */
2600
- static _GetRightHandedPositionVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
2600
+ static _GetRightHandedPositionVector3(vector: Vector3): Vector3;
2601
2601
  /**
2602
- * Converts a BABYLON.Vector3 to right-handed
2603
- * @param vector BABYLON.Vector3 to convert to right-handed
2602
+ * Converts a Vector3 to right-handed
2603
+ * @param vector Vector3 to convert to right-handed
2604
2604
  */
2605
- static _GetRightHandedPositionVector3FromRef(vector: BABYLON.Vector3): void;
2605
+ static _GetRightHandedPositionVector3FromRef(vector: Vector3): void;
2606
2606
  /**
2607
2607
  * Converts a three element number array to right-handed
2608
2608
  * @param vector number array to convert to right-handed
2609
2609
  */
2610
2610
  static _GetRightHandedPositionArray3FromRef(vector: number[]): void;
2611
2611
  /**
2612
- * Converts a new right-handed BABYLON.Vector3
2612
+ * Converts a new right-handed Vector3
2613
2613
  * @param vector vector3 array
2614
- * @returns right-handed BABYLON.Vector3
2614
+ * @returns right-handed Vector3
2615
2615
  */
2616
- static _GetRightHandedNormalVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
2616
+ static _GetRightHandedNormalVector3(vector: Vector3): Vector3;
2617
2617
  /**
2618
- * Converts a BABYLON.Vector3 to right-handed
2619
- * @param vector BABYLON.Vector3 to convert to right-handed
2618
+ * Converts a Vector3 to right-handed
2619
+ * @param vector Vector3 to convert to right-handed
2620
2620
  */
2621
- static _GetRightHandedNormalVector3FromRef(vector: BABYLON.Vector3): void;
2621
+ static _GetRightHandedNormalVector3FromRef(vector: Vector3): void;
2622
2622
  /**
2623
2623
  * Converts a three element number array to right-handed
2624
2624
  * @param vector number array to convert to right-handed
@@ -2645,7 +2645,7 @@ declare module BABYLON {
2645
2645
  */
2646
2646
  static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
2647
2647
  static _NormalizeTangentFromRef(tangent: Vector4): void;
2648
- static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
2648
+ static _GetDataAccessorElementCount(accessorType: BABYLON.GLTF2.AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
2649
2649
  }
2650
2650
 
2651
2651
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-serializers",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "main": "babylonjs.serializers.js",
5
5
  "types": "babylonjs.serializers.module.d.ts",
6
6
  "files": [
@@ -14,8 +14,8 @@
14
14
  "clean": "rimraf dist && rimraf babylon*.*"
15
15
  },
16
16
  "dependencies": {
17
- "babylonjs": "^5.0.0",
18
- "babylonjs-gltf2interface": "^5.0.0"
17
+ "babylonjs": "^5.0.1",
18
+ "babylonjs-gltf2interface": "^5.0.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@dev/build-tools": "1.0.0",