Browse Source

loader interfaces

sebastien 6 years ago
parent
commit
bafb73cf0e

File diff suppressed because it is too large
+ 8182 - 8182
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 8094 - 8094
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js.map


+ 86 - 86
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1081,14 +1081,14 @@ declare module BABYLON {
                 * Assign an `index` field to each item of the given array.
                 * @param array The array of items
                 */
-            static Assign(array?: IArrayItemV2[]): void;
+            static Assign(array?: IArrayItem[]): void;
     }
     /**
         * The glTF 2.0 loader
         */
     export class GLTF2Loader implements IGLTFLoader {
             /** The glTF object parsed from the JSON. */
-            gltf: IGLTFV2;
+            gltf: IGLTF;
             /** The Babylon scene when loading the asset. */
             babylonScene: BABYLON.Scene;
             /** @hidden */
@@ -1128,7 +1128,7 @@ declare module BABYLON {
                 * @param scene The glTF scene property
                 * @returns A promise that resolves when the load is complete
                 */
-            loadSceneAsync(context: string, scene: ISceneV2): Promise<void>;
+            loadSceneAsync(context: string, scene: IScene): Promise<void>;
             /**
                 * Loads a glTF node.
                 * @param context The context when loading the asset
@@ -1136,7 +1136,7 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
                 */
-            loadNodeAsync(context: string, node: INodeV2, assign?: (babylonMesh: BABYLON.Mesh) => void): Promise<BABYLON.Mesh>;
+            loadNodeAsync(context: string, node: INode, assign?: (babylonMesh: BABYLON.Mesh) => void): Promise<BABYLON.Mesh>;
             /**
                 * Loads a glTF camera.
                 * @param context The context when loading the asset
@@ -1144,23 +1144,23 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon camera when the load is complete
                 */
-            loadCameraAsync(context: string, camera: ICameraV2, assign?: (babylonCamera: BABYLON.Camera) => void): Promise<BABYLON.Camera>;
+            loadCameraAsync(context: string, camera: ICamera, assign?: (babylonCamera: BABYLON.Camera) => void): Promise<BABYLON.Camera>;
             /**
                 * Loads a glTF animation.
                 * @param context The context when loading the asset
                 * @param animation The glTF animation property
                 * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
                 */
-            loadAnimationAsync(context: string, animation: IAnimationV2): Promise<BABYLON.AnimationGroup>;
+            loadAnimationAsync(context: string, animation: IAnimation): Promise<BABYLON.AnimationGroup>;
             /**
                 * Loads a glTF buffer view.
                 * @param context The context when loading the asset
                 * @param bufferView The glTF buffer view property
                 * @returns A promise that resolves with the loaded data when the load is complete
                 */
-            loadBufferViewAsync(context: string, bufferView: IBufferViewV2): Promise<ArrayBufferView>;
+            loadBufferViewAsync(context: string, bufferView: IBufferView): Promise<ArrayBufferView>;
             /** @hidden */
-            _loadMaterialAsync(context: string, material: IMaterialV2, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign?: (babylonMaterial: BABYLON.Material) => void): Promise<BABYLON.Material>;
+            _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign?: (babylonMaterial: BABYLON.Material) => void): Promise<BABYLON.Material>;
             /**
                 * Creates a Babylon material from a glTF material.
                 * @param context The context when loading the asset
@@ -1168,7 +1168,7 @@ declare module BABYLON {
                 * @param babylonDrawMode The draw mode for the Babylon material
                 * @returns The Babylon material
                 */
-            createMaterial(context: string, material: IMaterialV2, babylonDrawMode: number): BABYLON.Material;
+            createMaterial(context: string, material: IMaterial, babylonDrawMode: number): BABYLON.Material;
             /**
                 * Loads properties from a glTF material into a Babylon material.
                 * @param context The context when loading the asset
@@ -1176,7 +1176,7 @@ declare module BABYLON {
                 * @param babylonMaterial The Babylon material
                 * @returns A promise that resolves when the load is complete
                 */
-            loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): Promise<void>;
+            loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): Promise<void>;
             /**
                 * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
                 * @param context The context when loading the asset
@@ -1184,7 +1184,7 @@ declare module BABYLON {
                 * @param babylonMaterial The Babylon material
                 * @returns A promise that resolves when the load is complete
                 */
-            loadMaterialBasePropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): Promise<void>;
+            loadMaterialBasePropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): Promise<void>;
             /**
                 * Loads the alpha properties from a glTF material into a Babylon material.
                 * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
@@ -1192,7 +1192,7 @@ declare module BABYLON {
                 * @param material The glTF material property
                 * @param babylonMaterial The Babylon material
                 */
-            loadMaterialAlphaProperties(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): void;
+            loadMaterialAlphaProperties(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): void;
             /**
                 * Loads a glTF texture info.
                 * @param context The context when loading the asset
@@ -1200,14 +1200,14 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon texture when the load is complete
                 */
-            loadTextureInfoAsync(context: string, textureInfo: ITextureInfoV2, assign?: (babylonTexture: BABYLON.BaseTexture) => void): Promise<BABYLON.BaseTexture>;
+            loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BABYLON.BaseTexture) => void): Promise<BABYLON.BaseTexture>;
             /**
                 * Loads a glTF image.
                 * @param context The context when loading the asset
                 * @param image The glTF image property
                 * @returns A promise that resolves with the loaded data when the load is complete
                 */
-            loadImageAsync(context: string, image: IImageV2): Promise<ArrayBufferView>;
+            loadImageAsync(context: string, image: IImage): Promise<ArrayBufferView>;
             /**
                 * Loads a glTF uri.
                 * @param context The context when loading the asset
@@ -1280,7 +1280,7 @@ declare module BABYLON {
                 * @param scene The glTF scene property
                 * @returns A promise that resolves when the load is complete or null if not handled
                 */
-            loadSceneAsync?(context: string, scene: ISceneV2): BABYLON.Nullable<Promise<void>>;
+            loadSceneAsync?(context: string, scene: IScene): BABYLON.Nullable<Promise<void>>;
             /**
                 * Define this method to modify the default behavior when loading nodes.
                 * @param context The context when loading the asset
@@ -1288,7 +1288,7 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
                 */
-            loadNodeAsync?(context: string, node: INodeV2, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
+            loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
             /**
                 * Define this method to modify the default behavior when loading cameras.
                 * @param context The context when loading the asset
@@ -1296,14 +1296,14 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
                 */
-            loadCameraAsync?(context: string, camera: ICameraV2, assign: (babylonCamera: BABYLON.Camera) => void): BABYLON.Nullable<Promise<BABYLON.Camera>>;
+            loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: BABYLON.Camera) => void): BABYLON.Nullable<Promise<BABYLON.Camera>>;
             /**
                 * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
                 * @param context The context when loading the asset
                 * @param primitive The glTF mesh primitive property
                 * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
                 */
-            _loadVertexDataAsync?(context: string, primitive: IMeshPrimitiveV2, babylonMesh: BABYLON.Mesh): BABYLON.Nullable<Promise<BABYLON.Geometry>>;
+            _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: BABYLON.Mesh): BABYLON.Nullable<Promise<BABYLON.Geometry>>;
             /**
                 * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
                 * @param context The context when loading the asset
@@ -1311,7 +1311,7 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
                 */
-            _loadMaterialAsync?(context: string, material: IMaterialV2, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign: (babylonMaterial: BABYLON.Material) => void): BABYLON.Nullable<Promise<BABYLON.Material>>;
+            _loadMaterialAsync?(context: string, material: IMaterial, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign: (babylonMaterial: BABYLON.Material) => void): BABYLON.Nullable<Promise<BABYLON.Material>>;
             /**
                 * Define this method to modify the default behavior when creating materials.
                 * @param context The context when loading the asset
@@ -1319,7 +1319,7 @@ declare module BABYLON {
                 * @param babylonDrawMode The draw mode for the Babylon material
                 * @returns The Babylon material or null if not handled
                 */
-            createMaterial?(context: string, material: IMaterialV2, babylonDrawMode: number): BABYLON.Nullable<BABYLON.Material>;
+            createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): BABYLON.Nullable<BABYLON.Material>;
             /**
                 * Define this method to modify the default behavior when loading material properties.
                 * @param context The context when loading the asset
@@ -1327,7 +1327,7 @@ declare module BABYLON {
                 * @param babylonMaterial The Babylon material
                 * @returns A promise that resolves when the load is complete or null if not handled
                 */
-            loadMaterialPropertiesAsync?(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
+            loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
             /**
                 * Define this method to modify the default behavior when loading texture infos.
                 * @param context The context when loading the asset
@@ -1335,14 +1335,14 @@ declare module BABYLON {
                 * @param assign A function called synchronously after parsing the glTF properties
                 * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
                 */
-            loadTextureInfoAsync?(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BABYLON.BaseTexture) => void): BABYLON.Nullable<Promise<BABYLON.BaseTexture>>;
+            loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BABYLON.BaseTexture) => void): BABYLON.Nullable<Promise<BABYLON.BaseTexture>>;
             /**
                 * Define this method to modify the default behavior when loading animations.
                 * @param context The context when loading the asset
                 * @param animation The glTF animation property
                 * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
                 */
-            loadAnimationAsync?(context: string, animation: IAnimationV2): BABYLON.Nullable<Promise<BABYLON.AnimationGroup>>;
+            loadAnimationAsync?(context: string, animation: IAnimation): BABYLON.Nullable<Promise<BABYLON.AnimationGroup>>;
             /**
                 * Define this method to modify the default behavior when loading uris.
                 * @param context The context when loading the asset
@@ -1358,7 +1358,7 @@ declare module BABYLON {
     /**
         * Loader interface with an index field.
         */
-    export interface IArrayItemV2 {
+    export interface IArrayItem {
             /**
                 * The index of this item in the array.
                 */
@@ -1367,7 +1367,7 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface IAccessorV2 extends BABYLON.GLTF2.IAccessor, IArrayItemV2 {
+    export interface IAccessor extends IGLTF2.IAccessor, IArrayItem {
             /** @hidden */
             _data?: Promise<ArrayBufferView>;
             /** @hidden */
@@ -1376,41 +1376,41 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface IAnimationChannelV2 extends BABYLON.GLTF2.IAnimationChannel, IArrayItemV2 {
+    export interface IAnimationChannel extends IGLTF2.IAnimationChannel, IArrayItem {
     }
     /** @hidden */
-    export interface _IAnimationSamplerDataV2 {
+    export interface _IAnimationSamplerData {
             input: Float32Array;
-            interpolation: BABYLON.GLTF2.AnimationSamplerInterpolation;
+            interpolation: IGLTF2.AnimationSamplerInterpolation;
             output: Float32Array;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IAnimationSamplerV2 extends BABYLON.GLTF2.IAnimationSampler, IArrayItemV2 {
+    export interface IAnimationSampler extends IGLTF2.IAnimationSampler, IArrayItem {
             /** @hidden */
-            _data?: Promise<_IAnimationSamplerDataV2>;
+            _data?: Promise<_IAnimationSamplerData>;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IAnimationV2 extends BABYLON.GLTF2.IAnimation, IArrayItemV2 {
-            channels: IAnimationChannelV2[];
-            samplers: IAnimationSamplerV2[];
+    export interface IAnimation extends IGLTF2.IAnimation, IArrayItem {
+            channels: IAnimationChannel[];
+            samplers: IAnimationSampler[];
             /** @hidden */
             _babylonAnimationGroup?: BABYLON.AnimationGroup;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IBufferV2 extends BABYLON.GLTF2.IBuffer, IArrayItemV2 {
+    export interface IBuffer extends IGLTF2.IBuffer, IArrayItem {
             /** @hidden */
             _data?: Promise<ArrayBufferView>;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IBufferViewV2 extends BABYLON.GLTF2.IBufferView, IArrayItemV2 {
+    export interface IBufferView extends IGLTF2.IBufferView, IArrayItem {
             /** @hidden */
             _data?: Promise<ArrayBufferView>;
             /** @hidden */
@@ -1419,40 +1419,40 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface ICameraV2 extends BABYLON.GLTF2.ICamera, IArrayItemV2 {
+    export interface ICamera extends IGLTF2.ICamera, IArrayItem {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IImageV2 extends BABYLON.GLTF2.IImage, IArrayItemV2 {
+    export interface IImage extends IGLTF2.IImage, IArrayItem {
             /** @hidden */
             _data?: Promise<ArrayBufferView>;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IMaterialNormalTextureInfoV2 extends BABYLON.GLTF2.IMaterialNormalTextureInfo, BABYLON.GLTF2.ITextureInfo {
+    export interface IMaterialNormalTextureInfo extends IGLTF2.IMaterialNormalTextureInfo, IGLTF2.ITextureInfo {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IMaterialOcclusionTextureInfoV2 extends BABYLON.GLTF2.IMaterialOcclusionTextureInfo, BABYLON.GLTF2.ITextureInfo {
+    export interface IMaterialOcclusionTextureInfo extends IGLTF2.IMaterialOcclusionTextureInfo, IGLTF2.ITextureInfo {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IMaterialPbrMetallicRoughnessV2 extends BABYLON.GLTF2.IMaterialPbrMetallicRoughness {
-            baseColorTexture?: ITextureInfoV2;
-            metallicRoughnessTexture?: ITextureInfoV2;
+    export interface IMaterialPbrMetallicRoughness extends IGLTF2.IMaterialPbrMetallicRoughness {
+            baseColorTexture?: ITextureInfo;
+            metallicRoughnessTexture?: ITextureInfo;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IMaterialV2 extends BABYLON.GLTF2.IMaterial, IArrayItemV2 {
-            pbrMetallicRoughness?: IMaterialPbrMetallicRoughnessV2;
-            normalTexture?: IMaterialNormalTextureInfoV2;
-            occlusionTexture?: IMaterialOcclusionTextureInfoV2;
-            emissiveTexture?: ITextureInfoV2;
+    export interface IMaterial extends IGLTF2.IMaterial, IArrayItem {
+            pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+            normalTexture?: IMaterialNormalTextureInfo;
+            occlusionTexture?: IMaterialOcclusionTextureInfo;
+            emissiveTexture?: ITextureInfo;
             /** @hidden */
             _babylonData?: {
                     [drawMode: number]: {
@@ -1465,22 +1465,22 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface IMeshV2 extends BABYLON.GLTF2.IMesh, IArrayItemV2 {
-            primitives: IMeshPrimitiveV2[];
+    export interface IMesh extends IGLTF2.IMesh, IArrayItem {
+            primitives: IMeshPrimitive[];
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IMeshPrimitiveV2 extends BABYLON.GLTF2.IMeshPrimitive, IArrayItemV2 {
+    export interface IMeshPrimitive extends IGLTF2.IMeshPrimitive, IArrayItem {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface INodeV2 extends BABYLON.GLTF2.INode, IArrayItemV2 {
+    export interface INode extends IGLTF2.INode, IArrayItem {
             /**
                 * The parent glTF node.
                 */
-            parent?: INodeV2;
+            parent?: INode;
             /** @hidden */
             _babylonMesh?: BABYLON.Mesh;
             /** @hidden */
@@ -1491,7 +1491,7 @@ declare module BABYLON {
             _numMorphTargets?: number;
     }
     /** @hidden */
-    export interface _ISamplerDataV2 {
+    export interface _ISamplerData {
             noMipMaps: boolean;
             samplingMode: number;
             wrapU: number;
@@ -1500,19 +1500,19 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface ISamplerV2 extends BABYLON.GLTF2.ISampler, IArrayItemV2 {
+    export interface ISampler extends IGLTF2.ISampler, IArrayItem {
             /** @hidden */
-            _data?: _ISamplerDataV2;
+            _data?: _ISamplerData;
     }
     /**
         * Loader interface with additional members.
         */
-    export interface ISceneV2 extends BABYLON.GLTF2.IScene, IArrayItemV2 {
+    export interface IScene extends IGLTF2.IScene, IArrayItem {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface ISkinV2 extends BABYLON.GLTF2.ISkin, IArrayItemV2 {
+    export interface ISkin extends IGLTF2.ISkin, IArrayItem {
             /** @hidden */
             _babylonSkeleton?: BABYLON.Skeleton;
             /** @hidden */
@@ -1521,30 +1521,30 @@ declare module BABYLON {
     /**
         * Loader interface with additional members.
         */
-    export interface ITextureV2 extends BABYLON.GLTF2.ITexture, IArrayItemV2 {
+    export interface ITexture extends IGLTF2.ITexture, IArrayItem {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface ITextureInfoV2 extends BABYLON.GLTF2.ITextureInfo {
+    export interface ITextureInfo extends IGLTF2.ITextureInfo {
     }
     /**
         * Loader interface with additional members.
         */
-    export interface IGLTFV2 extends BABYLON.GLTF2.IGLTF {
-            accessors?: IAccessorV2[];
-            animations?: IAnimationV2[];
-            buffers?: IBufferV2[];
-            bufferViews?: IBufferViewV2[];
-            cameras?: ICameraV2[];
-            images?: IImageV2[];
-            materials?: IMaterialV2[];
-            meshes?: IMeshV2[];
-            nodes?: INodeV2[];
-            samplers?: ISamplerV2[];
-            scenes?: ISceneV2[];
-            skins?: ISkinV2[];
-            textures?: ITextureV2[];
+    export interface IGLTF extends IGLTF2.IGLTF {
+            accessors?: IAccessor[];
+            animations?: IAnimation[];
+            buffers?: IBuffer[];
+            bufferViews?: IBufferView[];
+            cameras?: ICamera[];
+            images?: IImage[];
+            materials?: IMaterial[];
+            meshes?: IMesh[];
+            nodes?: INode[];
+            samplers?: ISampler[];
+            scenes?: IScene[];
+            skins?: ISkin[];
+            textures?: ITexture[];
     }
 }
 declare module BABYLON {
@@ -1563,7 +1563,7 @@ declare module BABYLON {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ISceneV2): BABYLON.Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): BABYLON.Nullable<Promise<void>>;
     }
 }
 declare module BABYLON {
@@ -1580,7 +1580,7 @@ declare module BABYLON {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        _loadVertexDataAsync(context: string, primitive: IMeshPrimitiveV2, babylonMesh: BABYLON.Mesh): BABYLON.Nullable<Promise<BABYLON.Geometry>>;
+        _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: BABYLON.Mesh): BABYLON.Nullable<Promise<BABYLON.Geometry>>;
     }
 }
 declare module BABYLON {
@@ -1599,7 +1599,7 @@ declare module BABYLON {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
     }
 }
 declare module BABYLON {
@@ -1616,7 +1616,7 @@ declare module BABYLON {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
     }
 }
 declare module BABYLON {
@@ -1633,7 +1633,7 @@ declare module BABYLON {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
     }
 }
 declare module BABYLON {
@@ -1650,7 +1650,7 @@ declare module BABYLON {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadTextureInfoAsync(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BABYLON.BaseTexture) => void): BABYLON.Nullable<Promise<BABYLON.BaseTexture>>;
+        loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BABYLON.BaseTexture) => void): BABYLON.Nullable<Promise<BABYLON.BaseTexture>>;
     }
 }
 declare module BABYLON {
@@ -1669,11 +1669,11 @@ declare module BABYLON {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ISceneV2): BABYLON.Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): BABYLON.Nullable<Promise<void>>;
         /** @hidden */
-        loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
         /** @hidden */
-        loadAnimationAsync(context: string, animation: IAnimationV2): BABYLON.Nullable<Promise<BABYLON.AnimationGroup>>;
+        loadAnimationAsync(context: string, animation: IAnimation): BABYLON.Nullable<Promise<BABYLON.AnimationGroup>>;
     }
 }
 declare module BABYLON {
@@ -1708,9 +1708,9 @@ declare module BABYLON {
             /** @hidden */
             onReady(): void;
             /** @hidden */
-            loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
+            loadNodeAsync(context: string, node: INode, assign: (babylonMesh: BABYLON.Mesh) => void): BABYLON.Nullable<Promise<BABYLON.Mesh>>;
             /** @hidden */
-            _loadMaterialAsync(context: string, material: IMaterialV2, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign: (babylonMaterial: BABYLON.Material) => void): BABYLON.Nullable<Promise<BABYLON.Material>>;
+            _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: BABYLON.Mesh, babylonDrawMode: number, assign: (babylonMaterial: BABYLON.Material) => void): BABYLON.Nullable<Promise<BABYLON.Material>>;
             /** @hidden */
             _loadUriAsync(context: string, uri: string): BABYLON.Nullable<Promise<ArrayBufferView>>;
     }
@@ -1722,7 +1722,7 @@ declare module BABYLON {
         enabled: boolean;
         constructor(loader: GLTF2Loader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
     }
 }
 declare module BABYLON {
@@ -1732,6 +1732,6 @@ declare module BABYLON {
         enabled: boolean;
         constructor(loader: GLTF2Loader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
     }
 }

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js.map


File diff suppressed because it is too large
+ 185 - 185
dist/preview release/loaders/babylonjs.loaders.module.d.ts


+ 2 - 2
loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts

@@ -1,6 +1,6 @@
 import { BaseTexture, Nullable, RawCubeTexture, Quaternion, Matrix, SphericalHarmonics, SphericalPolynomial, Scalar } from "babylonjs";
 import { IChildRootProperty } from "babylonjs-gltf2interface";
-import { ISceneV2 } from "../glTFLoaderInterfaces";
+import { IScene } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader, ArrayItem } from "../glTF2Loader";
 
@@ -59,7 +59,7 @@ export class EXT_lights_image_based implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadSceneAsync(context: string, scene: ISceneV2): Nullable<Promise<void>> {
+    public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtensionAsync<ILightReference>(context, scene, this.name, (extensionContext, extension) => {
             const promises = new Array<Promise<any>>();
 

+ 3 - 3
loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts

@@ -1,6 +1,6 @@
 import { Geometry, DracoCompression, Mesh, Nullable, VertexBuffer } from "babylonjs";
 import { MeshPrimitiveMode } from "babylonjs-gltf2interface";
-import { IBufferViewV2, IMeshPrimitiveV2 } from "../glTFLoaderInterfaces";
+import { IBufferView, IMeshPrimitive } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader, ArrayItem } from "../glTF2Loader";
 
@@ -11,7 +11,7 @@ interface IKHRDracoMeshCompression {
     attributes: { [name: string]: number };
 }
 
-interface IBufferViewDraco extends IBufferViewV2 {
+interface IBufferViewDraco extends IBufferView {
     _dracoBabylonGeometry?: Promise<Geometry>;
 }
 
@@ -44,7 +44,7 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public _loadVertexDataAsync(context: string, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
+    public _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
         return GLTF2Loader.LoadExtensionAsync<IKHRDracoMeshCompression, Geometry>(context, primitive, this.name, (extensionContext, extension) => {
             if (primitive.mode != undefined) {
                 if (primitive.mode !== MeshPrimitiveMode.TRIANGLE_STRIP &&

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts

@@ -1,6 +1,6 @@
 import { Mesh, Nullable, Light, DirectionalLight, Vector3, PointLight, SpotLight, Color3 } from "babylonjs";
 import { IChildRootProperty } from "babylonjs-gltf2interface";
-import { INodeV2 } from "../glTFLoaderInterfaces";
+import { INode } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader, ArrayItem } from "../glTF2Loader";
 
@@ -65,7 +65,7 @@ export class KHR_lights implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
+    public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
         return GLTF2Loader.LoadExtensionAsync<ILightReference, Mesh>(context, node, this.name, (extensionContext, extension) => {
             return this._loader.loadNodeAsync(context, node, (babylonMesh) => {
                 let babylonLight: Light;

+ 5 - 5
loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts

@@ -1,5 +1,5 @@
 import { Material, Nullable, PBRMaterial, Color3 } from "babylonjs";
-import { ITextureInfoV2, IMaterialV2 } from "../glTFLoaderInterfaces";
+import { ITextureInfo, IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader } from "../glTF2Loader";
 
@@ -7,10 +7,10 @@ const NAME = "KHR_materials_pbrSpecularGlossiness";
 
 interface IKHRMaterialsPbrSpecularGlossiness {
     diffuseFactor: number[];
-    diffuseTexture: ITextureInfoV2;
+    diffuseTexture: ITextureInfo;
     specularFactor: number[];
     glossinessFactor: number;
-    specularGlossinessTexture: ITextureInfoV2;
+    specularGlossinessTexture: ITextureInfo;
 }
 
 /**
@@ -36,7 +36,7 @@ export class KHR_materials_pbrSpecularGlossiness implements IGLTFLoaderExtension
     }
 
     /** @hidden */
-    public loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>> {
+    public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtensionAsync<IKHRMaterialsPbrSpecularGlossiness>(context, material, this.name, (extensionContext, extension) => {
             const promises = new Array<Promise<any>>();
             promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
@@ -46,7 +46,7 @@ export class KHR_materials_pbrSpecularGlossiness implements IGLTFLoaderExtension
         });
     }
 
-    private _loadSpecularGlossinessPropertiesAsync(context: string, material: IMaterialV2, properties: IKHRMaterialsPbrSpecularGlossiness, babylonMaterial: Material): Promise<void> {
+    private _loadSpecularGlossinessPropertiesAsync(context: string, material: IMaterial, properties: IKHRMaterialsPbrSpecularGlossiness, babylonMaterial: Material): Promise<void> {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }

+ 3 - 3
loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts

@@ -1,5 +1,5 @@
 import { Material, Nullable, PBRMaterial, Color3 } from "babylonjs";
-import { IMaterialV2 } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader } from "../glTF2Loader";
 
@@ -28,13 +28,13 @@ export class KHR_materials_unlit implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>> {
+    public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtensionAsync(context, material, this.name, () => {
             return this._loadUnlitPropertiesAsync(context, material, babylonMaterial);
         });
     }
 
-    private _loadUnlitPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Promise<void> {
+    private _loadUnlitPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void> {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -1,5 +1,5 @@
 import { BaseTexture, Nullable, Texture } from "babylonjs";
-import { ITextureInfoV2 } from "../glTFLoaderInterfaces";
+import { ITextureInfo } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader } from "../glTF2Loader";
 
@@ -35,7 +35,7 @@ export class KHR_texture_transform implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadTextureInfoAsync(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
+    public loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
         return GLTF2Loader.LoadExtensionAsync<IKHRTextureTransform, BaseTexture>(context, textureInfo, this.name, (extensionContext, extension) => {
             return this._loader.loadTextureInfoAsync(context, textureInfo, (babylonTexture) => {
                 if (!(babylonTexture instanceof Texture)) {

+ 8 - 8
loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts

@@ -1,5 +1,5 @@
 import { WeightedSound, Sound, Nullable, Mesh, Vector3, Tools, AnimationGroup, AnimationEvent } from "babylonjs";
-import { IArrayItemV2, ISceneV2, INodeV2, IAnimationV2 } from "../glTFLoaderInterfaces";
+import { IArrayItem, IScene, INode, IAnimation } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader, ArrayItem } from "../glTF2Loader";
 
@@ -43,11 +43,11 @@ interface IClip {
     mimeType?: AudioMimeType;
 }
 
-interface ILoaderClip extends IClip, IArrayItemV2 {
+interface ILoaderClip extends IClip, IArrayItem {
     _objectURL?: Promise<string>;
 }
 
-interface ILoaderEmitter extends IEmitter, IArrayItemV2 {
+interface ILoaderEmitter extends IEmitter, IArrayItem {
     _babylonData?: {
         sound?: WeightedSound;
         loaded: Promise<void>;
@@ -73,7 +73,7 @@ interface IAnimationEvent {
     startOffset?: number;
 }
 
-interface ILoaderAnimationEvent extends IAnimationEvent, IArrayItemV2 {
+interface ILoaderAnimationEvent extends IAnimationEvent, IArrayItem {
 }
 
 interface ILoaderAnimationEvents {
@@ -121,7 +121,7 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadSceneAsync(context: string, scene: ISceneV2): Nullable<Promise<void>> {
+    public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtensionAsync<IEmittersReference>(context, scene, this.name, (extensionContext, extension) => {
             const promises = new Array<Promise<any>>();
 
@@ -142,7 +142,7 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
+    public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
         return GLTF2Loader.LoadExtensionAsync<IEmittersReference, Mesh>(context, node, this.name, (extensionContext, extension) => {
             const promises = new Array<Promise<any>>();
 
@@ -173,7 +173,7 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadAnimationAsync(context: string, animation: IAnimationV2): Nullable<Promise<AnimationGroup>> {
+    public loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>> {
         return GLTF2Loader.LoadExtensionAsync<ILoaderAnimationEvents, AnimationGroup>(context, animation, this.name, (extensionContext, extension) => {
             return this._loader.loadAnimationAsync(context, animation).then((babylonAnimationGroup) => {
                 const promises = new Array<Promise<any>>();
@@ -276,7 +276,7 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtensionV2 {
         }
     }
 
-    private _loadAnimationEventAsync(context: string, animationContext: string, animation: IAnimationV2, event: ILoaderAnimationEvent, babylonAnimationGroup: AnimationGroup): Promise<void> {
+    private _loadAnimationEventAsync(context: string, animationContext: string, animation: IAnimation, event: ILoaderAnimationEvent, babylonAnimationGroup: AnimationGroup): Promise<void> {
         if (babylonAnimationGroup.targetedAnimations.length == 0) {
             return Promise.resolve();
         }

+ 3 - 3
loaders/src/glTF/2.0/Extensions/MSFT_lod.ts

@@ -1,5 +1,5 @@
 import { Observable, Nullable, Deferred, Mesh, Material } from "babylonjs";
-import { INodeV2, IMaterialV2 } from "../glTFLoaderInterfaces";
+import { INode, IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader, ArrayItem } from "../glTF2Loader";
 
@@ -113,7 +113,7 @@ export class MSFT_lod implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
+    public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
         return GLTF2Loader.LoadExtensionAsync<IMSFTLOD, Mesh>(context, node, this.name, (extensionContext, extension) => {
             let firstPromise: Promise<Mesh>;
 
@@ -159,7 +159,7 @@ export class MSFT_lod implements IGLTFLoaderExtensionV2 {
     }
 
     /** @hidden */
-    public _loadMaterialAsync(context: string, material: IMaterialV2, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
+    public _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
         // Don't load material LODs if already loading a node LOD.
         if (this._nodeIndexLOD) {
             return null;

+ 2 - 2
loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts

@@ -1,5 +1,5 @@
 import { Material, Nullable, PBRMaterial } from "babylonjs";
-import { IMaterialV2 } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader } from "../glTF2Loader";
 
@@ -20,7 +20,7 @@ export class MSFT_minecraftMesh implements IGLTFLoaderExtensionV2 {
         delete this._loader;
     }
 
-    public loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>> {
+    public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {
             if (extra) {
                 if (!(babylonMaterial instanceof PBRMaterial)) {

+ 2 - 2
loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts

@@ -1,5 +1,5 @@
 import { Material, Nullable, PBRMaterial } from "babylonjs";
-import { IMaterialV2 } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "../glTFLoaderExtension";
 import { GLTF2Loader } from "../glTF2Loader";
 
@@ -20,7 +20,7 @@ export class MSFT_sRGBFactors implements IGLTFLoaderExtensionV2 {
         delete this._loader;
     }
 
-    public loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>> {
+    public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
         return GLTF2Loader.LoadExtraAsync<boolean>(context, material, this.name, (extraContext, extra) => {
             if (extra) {
                 if (!(babylonMaterial instanceof PBRMaterial)) {

+ 52 - 52
loaders/src/glTF/2.0/glTF2Loader.ts

@@ -1,6 +1,6 @@
 import { IFileRequest, Buffer, Animation, Scene, Nullable, Mesh, Material, SceneLoaderProgressEvent, Tools, AbstractMesh, IParticleSystem, Skeleton, AnimationGroup, Geometry, VertexBuffer, MorphTargetManager, MorphTarget, TransformNode, Vector3, Quaternion, Matrix, Bone, Camera, FreeCamera, IAnimationKey, AnimationKeyInterpolation, IndicesArray, PBRMaterial, Color3, BaseTexture, Deferred, Texture, LoadFileError } from "babylonjs";
 import { IProperty, AccessorType, CameraType, AnimationChannelTargetPath, AnimationSamplerInterpolation, AccessorComponentType, MaterialAlphaMode, TextureMinFilter, TextureWrapMode, TextureMagFilter, MeshPrimitiveMode } from "babylonjs-gltf2interface";
-import { _IAnimationSamplerDataV2, IGLTFV2, ISamplerV2, INodeV2, ISceneV2, IMeshV2,  IAccessorV2, ISkinV2, ICameraV2, IAnimationV2, IAnimationChannelV2, IAnimationSamplerV2, IBufferV2, IBufferViewV2, IMaterialPbrMetallicRoughnessV2, IMaterialV2, ITextureInfoV2, ITextureV2, IImageV2, IMeshPrimitiveV2, IArrayItemV2, _ISamplerDataV2 } from "./glTFLoaderInterfaces";
+import { _IAnimationSamplerData, IGLTF, ISampler, INode, IScene, IMesh,  IAccessor, ISkin, ICamera, IAnimation, IAnimationChannel, IAnimationSampler, IBuffer, IBufferView, IMaterialPbrMetallicRoughness, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem, _ISamplerData } from "./glTFLoaderInterfaces";
 import { IGLTFLoaderExtensionV2 } from "./glTFLoaderExtension";
 import { IGLTFLoader, GLTFFileLoader, GLTFLoaderState, IGLTFLoaderData, GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode } from "../glTFFileLoader";
 
@@ -37,7 +37,7 @@ export class ArrayItem {
      * Assign an `index` field to each item of the given array.
      * @param array The array of items
      */
-    public static Assign(array?: IArrayItemV2[]): void {
+    public static Assign(array?: IArrayItem[]): void {
         if (array) {
             for (let index = 0; index < array.length; index++) {
                 array[index].index = index;
@@ -51,7 +51,7 @@ export class ArrayItem {
  */
 export class GLTF2Loader implements IGLTFLoader {
     /** The glTF object parsed from the JSON. */
-    public gltf: IGLTFV2;
+    public gltf: IGLTF;
 
     /** The Babylon scene when loading the asset. */
     public babylonScene: Scene;
@@ -71,7 +71,7 @@ export class GLTF2Loader implements IGLTFLoader {
     private _progressCallback?: (event: SceneLoaderProgressEvent) => void;
     private _requests = new Array<IFileRequestInfo>();
 
-    private static readonly _DefaultSampler: ISamplerV2 = { index: -1 };
+    private static readonly _DefaultSampler: ISampler = { index: -1 };
 
     private static _ExtensionNames = new Array<string>();
     private static _ExtensionFactories: { [name: string]: (loader: GLTF2Loader) => IGLTFLoaderExtensionV2 } = {};
@@ -293,7 +293,7 @@ export class GLTF2Loader implements IGLTFLoader {
     }
 
     private _loadData(data: IGLTFLoaderData): void {
-        this.gltf = data.json as IGLTFV2;
+        this.gltf = data.json as IGLTF;
         this._setupData();
 
         if (data.bin) {
@@ -372,10 +372,10 @@ export class GLTF2Loader implements IGLTFLoader {
         this.log(GLTFLoaderState[this._state]);
     }
 
-    private _createRootNode(): INodeV2 {
+    private _createRootNode(): INode {
         this._rootBabylonMesh = new Mesh("__root__", this.babylonScene);
 
-        const rootNode: INodeV2 = {
+        const rootNode: INode = {
             _babylonMesh: this._rootBabylonMesh,
             index: -1
         };
@@ -408,7 +408,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param scene The glTF scene property
      * @returns A promise that resolves when the load is complete
      */
-    public loadSceneAsync(context: string, scene: ISceneV2): Promise<void> {
+    public loadSceneAsync(context: string, scene: IScene): Promise<void> {
         const extensionPromise = this._extensionsLoadSceneAsync(context, scene);
         if (extensionPromise) {
             return extensionPromise;
@@ -434,7 +434,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return Promise.all(promises).then(() => { });
     }
 
-    private _forEachPrimitive(node: INodeV2, callback: (babylonMesh: Mesh) => void): void {
+    private _forEachPrimitive(node: INode, callback: (babylonMesh: Mesh) => void): void {
         if (node._primitiveBabylonMeshes) {
             for (const babylonMesh of node._primitiveBabylonMeshes) {
                 callback(babylonMesh);
@@ -533,7 +533,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
      */
-    public loadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void = () => { }): Promise<Mesh> {
+    public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void = () => { }): Promise<Mesh> {
         const extensionPromise = this._extensionsLoadNodeAsync(context, node, assign);
         if (extensionPromise) {
             return extensionPromise;
@@ -591,7 +591,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _loadMeshAsync(context: string, node: INodeV2, mesh: IMeshV2, babylonMesh: Mesh): Promise<void> {
+    private _loadMeshAsync(context: string, node: INode, mesh: IMesh, babylonMesh: Mesh): Promise<void> {
         const promises = new Array<Promise<any>>();
 
         this.logOpen(`${context} ${mesh.name || ""}`);
@@ -630,7 +630,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _loadMeshPrimitiveAsync(context: string, node: INodeV2, mesh: IMeshV2, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): Promise<void> {
+    private _loadMeshPrimitiveAsync(context: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, babylonMesh: Mesh): Promise<void> {
         const promises = new Array<Promise<any>>();
 
         this.logOpen(`${context}`);
@@ -664,7 +664,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return Promise.all(promises).then(() => { });
     }
 
-    private _loadVertexDataAsync(context: string, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): Promise<Geometry> {
+    private _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Promise<Geometry> {
         const extensionPromise = this._extensionsLoadVertexDataAsync(context, primitive, babylonMesh);
         if (extensionPromise) {
             return extensionPromise;
@@ -689,7 +689,7 @@ export class GLTF2Loader implements IGLTFLoader {
             }));
         }
 
-        const loadAttribute = (attribute: string, kind: string, callback?: (accessor: IAccessorV2) => void) => {
+        const loadAttribute = (attribute: string, kind: string, callback?: (accessor: IAccessor) => void) => {
             if (attributes[attribute] == undefined) {
                 return;
             }
@@ -727,7 +727,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _createMorphTargets(context: string, node: INodeV2, mesh: IMeshV2, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): void {
+    private _createMorphTargets(context: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, babylonMesh: Mesh): void {
         if (!primitive.targets) {
             return;
         }
@@ -747,7 +747,7 @@ export class GLTF2Loader implements IGLTFLoader {
         }
     }
 
-    private _loadMorphTargetsAsync(context: string, primitive: IMeshPrimitiveV2, babylonMesh: Mesh, babylonGeometry: Geometry): Promise<void> {
+    private _loadMorphTargetsAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh, babylonGeometry: Geometry): Promise<void> {
         if (!primitive.targets) {
             return Promise.resolve();
         }
@@ -814,7 +814,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return Promise.all(promises).then(() => { });
     }
 
-    private static _LoadTransform(node: INodeV2, babylonNode: TransformNode): void {
+    private static _LoadTransform(node: INode, babylonNode: TransformNode): void {
         let position = Vector3.Zero();
         let rotation = Quaternion.Identity();
         let scaling = Vector3.One();
@@ -834,7 +834,7 @@ export class GLTF2Loader implements IGLTFLoader {
         babylonNode.scaling = scaling;
     }
 
-    private _loadSkinAsync(context: string, node: INodeV2, skin: ISkinV2): Promise<void> {
+    private _loadSkinAsync(context: string, node: INode, skin: ISkin): Promise<void> {
         const assignSkeleton = (skeleton: Skeleton) => {
             this._forEachPrimitive(node, (babylonMesh) => {
                 babylonMesh.skeleton = skeleton;
@@ -864,7 +864,7 @@ export class GLTF2Loader implements IGLTFLoader {
         }));
     }
 
-    private _loadBones(context: string, skin: ISkinV2): void {
+    private _loadBones(context: string, skin: ISkin): void {
         const babylonBones: { [index: number]: Bone } = {};
         for (const index of skin.joints) {
             const node = ArrayItem.Get(`${context}/joints/${index}`, this.gltf.nodes, index);
@@ -872,7 +872,7 @@ export class GLTF2Loader implements IGLTFLoader {
         }
     }
 
-    private _loadBone(node: INodeV2, skin: ISkinV2, babylonBones: { [index: number]: Bone }): Bone {
+    private _loadBone(node: INode, skin: ISkin, babylonBones: { [index: number]: Bone }): Bone {
         let babylonBone = babylonBones[node.index];
         if (babylonBone) {
             return babylonBone;
@@ -894,7 +894,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return babylonBone;
     }
 
-    private _loadSkinInverseBindMatricesDataAsync(context: string, skin: ISkinV2): Promise<Nullable<Float32Array>> {
+    private _loadSkinInverseBindMatricesDataAsync(context: string, skin: ISkin): Promise<Nullable<Float32Array>> {
         if (skin.inverseBindMatrices == undefined) {
             return Promise.resolve(null);
         }
@@ -922,7 +922,7 @@ export class GLTF2Loader implements IGLTFLoader {
         }
     }
 
-    private _getNodeMatrix(node: INodeV2): Matrix {
+    private _getNodeMatrix(node: INode): Matrix {
         return node.matrix ?
             Matrix.FromArray(node.matrix) :
             Matrix.Compose(
@@ -938,7 +938,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon camera when the load is complete
      */
-    public loadCameraAsync(context: string, camera: ICameraV2, assign: (babylonCamera: Camera) => void = () => { }): Promise<Camera> {
+    public loadCameraAsync(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void = () => { }): Promise<Camera> {
         const extensionPromise = this._extensionsLoadCameraAsync(context, camera, assign);
         if (extensionPromise) {
             return extensionPromise;
@@ -1012,7 +1012,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param animation The glTF animation property
      * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
      */
-    public loadAnimationAsync(context: string, animation: IAnimationV2): Promise<AnimationGroup> {
+    public loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup> {
         const promise = this._extensionsLoadAnimationAsync(context, animation);
         if (promise) {
             return promise;
@@ -1036,7 +1036,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimationV2, channel: IAnimationChannelV2, babylonAnimationGroup: AnimationGroup): Promise<void> {
+    private _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup): Promise<void> {
         if (channel.target.node == undefined) {
             return Promise.resolve();
         }
@@ -1196,7 +1196,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _loadAnimationSamplerAsync(context: string, sampler: IAnimationSamplerV2): Promise<_IAnimationSamplerDataV2> {
+    private _loadAnimationSamplerAsync(context: string, sampler: IAnimationSampler): Promise<_IAnimationSamplerData> {
         if (sampler._data) {
             return sampler._data;
         }
@@ -1229,7 +1229,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return sampler._data;
     }
 
-    private _loadBufferAsync(context: string, buffer: IBufferV2): Promise<ArrayBufferView> {
+    private _loadBufferAsync(context: string, buffer: IBuffer): Promise<ArrayBufferView> {
         if (buffer._data) {
             return buffer._data;
         }
@@ -1249,7 +1249,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param bufferView The glTF buffer view property
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    public loadBufferViewAsync(context: string, bufferView: IBufferViewV2): Promise<ArrayBufferView> {
+    public loadBufferViewAsync(context: string, bufferView: IBufferView): Promise<ArrayBufferView> {
         if (bufferView._data) {
             return bufferView._data;
         }
@@ -1267,7 +1267,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return bufferView._data;
     }
 
-    private _loadIndicesAccessorAsync(context: string, accessor: IAccessorV2): Promise<IndicesArray> {
+    private _loadIndicesAccessorAsync(context: string, accessor: IAccessor): Promise<IndicesArray> {
         if (accessor.type !== AccessorType.SCALAR) {
             throw new Error(`${context}/type: Invalid value ${accessor.type}`);
         }
@@ -1290,7 +1290,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return accessor._data as Promise<IndicesArray>;
     }
 
-    private _loadFloatAccessorAsync(context: string, accessor: IAccessorV2): Promise<Float32Array> {
+    private _loadFloatAccessorAsync(context: string, accessor: IAccessor): Promise<Float32Array> {
         // TODO: support normalized and stride
 
         if (accessor.componentType !== AccessorComponentType.FLOAT) {
@@ -1342,7 +1342,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return accessor._data as Promise<Float32Array>;
     }
 
-    private _loadVertexBufferViewAsync(bufferView: IBufferViewV2, kind: string): Promise<Buffer> {
+    private _loadVertexBufferViewAsync(bufferView: IBufferView, kind: string): Promise<Buffer> {
         if (bufferView._babylonBuffer) {
             return bufferView._babylonBuffer;
         }
@@ -1354,7 +1354,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return bufferView._babylonBuffer;
     }
 
-    private _loadVertexAccessorAsync(context: string, accessor: IAccessorV2, kind: string): Promise<VertexBuffer> {
+    private _loadVertexAccessorAsync(context: string, accessor: IAccessor, kind: string): Promise<VertexBuffer> {
         if (accessor._babylonVertexBuffer) {
             return accessor._babylonVertexBuffer;
         }
@@ -1383,7 +1383,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return accessor._babylonVertexBuffer;
     }
 
-    private _loadMaterialMetallicRoughnessPropertiesAsync(context: string, properties: IMaterialPbrMetallicRoughnessV2, babylonMaterial: Material): Promise<void> {
+    private _loadMaterialMetallicRoughnessPropertiesAsync(context: string, properties: IMaterialPbrMetallicRoughness, babylonMaterial: Material): Promise<void> {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }
@@ -1423,7 +1423,7 @@ export class GLTF2Loader implements IGLTFLoader {
     }
 
     /** @hidden */
-    public _loadMaterialAsync(context: string, material: IMaterialV2, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void = () => { }): Promise<Material> {
+    public _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void = () => { }): Promise<Material> {
         const extensionPromise = this._extensionsLoadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign);
         if (extensionPromise) {
             return extensionPromise;
@@ -1485,7 +1485,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param babylonDrawMode The draw mode for the Babylon material
      * @returns The Babylon material
      */
-    public createMaterial(context: string, material: IMaterialV2, babylonDrawMode: number): Material {
+    public createMaterial(context: string, material: IMaterial, babylonDrawMode: number): Material {
         const extensionPromise = this._extensionsCreateMaterial(context, material, babylonDrawMode);
         if (extensionPromise) {
             return extensionPromise;
@@ -1502,7 +1502,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param babylonMaterial The Babylon material
      * @returns A promise that resolves when the load is complete
      */
-    public loadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Promise<void> {
+    public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void> {
         const extensionPromise = this._extensionsLoadMaterialPropertiesAsync(context, material, babylonMaterial);
         if (extensionPromise) {
             return extensionPromise;
@@ -1528,7 +1528,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param babylonMaterial The Babylon material
      * @returns A promise that resolves when the load is complete
      */
-    public loadMaterialBasePropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Promise<void> {
+    public loadMaterialBasePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void> {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }
@@ -1580,7 +1580,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param material The glTF material property
      * @param babylonMaterial The Babylon material
      */
-    public loadMaterialAlphaProperties(context: string, material: IMaterialV2, babylonMaterial: Material): void {
+    public loadMaterialAlphaProperties(context: string, material: IMaterial, babylonMaterial: Material): void {
         if (!(babylonMaterial instanceof PBRMaterial)) {
             throw new Error(`${context}: Material type not supported`);
         }
@@ -1620,7 +1620,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon texture when the load is complete
      */
-    public loadTextureInfoAsync(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BaseTexture) => void = () => { }): Promise<BaseTexture> {
+    public loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void = () => { }): Promise<BaseTexture> {
         const extensionPromise = this._extensionsLoadTextureInfoAsync(context, textureInfo, assign);
         if (extensionPromise) {
             return extensionPromise;
@@ -1639,7 +1639,7 @@ export class GLTF2Loader implements IGLTFLoader {
         return promise;
     }
 
-    private _loadTextureAsync(context: string, texture: ITextureV2, assign: (babylonTexture: BaseTexture) => void = () => { }): Promise<BaseTexture> {
+    private _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void = () => { }): Promise<BaseTexture> {
         const promises = new Array<Promise<any>>();
 
         this.logOpen(`${context} ${texture.name || ""}`);
@@ -1680,7 +1680,7 @@ export class GLTF2Loader implements IGLTFLoader {
         });
     }
 
-    private _loadSampler(context: string, sampler: ISamplerV2): _ISamplerDataV2 {
+    private _loadSampler(context: string, sampler: ISampler): _ISamplerData {
         if (!sampler._data) {
             sampler._data = {
                 noMipMaps: (sampler.minFilter === TextureMinFilter.NEAREST || sampler.minFilter === TextureMinFilter.LINEAR),
@@ -1699,7 +1699,7 @@ export class GLTF2Loader implements IGLTFLoader {
      * @param image The glTF image property
      * @returns A promise that resolves with the loaded data when the load is complete
      */
-    public loadImageAsync(context: string, image: IImageV2): Promise<ArrayBufferView> {
+    public loadImageAsync(context: string, image: IImage): Promise<ArrayBufferView> {
         if (!image._data) {
             this.logOpen(`${context} ${image.name || ""}`);
 
@@ -1814,7 +1814,7 @@ export class GLTF2Loader implements IGLTFLoader {
         }
     }
 
-    private static _GetTextureSamplingMode(context: string, sampler: ISamplerV2): number {
+    private static _GetTextureSamplingMode(context: string, sampler: ISampler): number {
         // Set defaults if undefined
         const magFilter = sampler.magFilter == undefined ? TextureMagFilter.LINEAR : sampler.magFilter;
         const minFilter = sampler.minFilter == undefined ? TextureMinFilter.LINEAR_MIPMAP_LINEAR : sampler.minFilter;
@@ -1998,39 +1998,39 @@ export class GLTF2Loader implements IGLTFLoader {
         this._forEachExtensions((extension) => extension.onReady && extension.onReady());
     }
 
-    private _extensionsLoadSceneAsync(context: string, scene: ISceneV2): Nullable<Promise<void>> {
+    private _extensionsLoadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {
         return this._applyExtensions(scene, (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));
     }
 
-    private _extensionsLoadNodeAsync(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
+    private _extensionsLoadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
         return this._applyExtensions(node, (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));
     }
 
-    private _extensionsLoadCameraAsync(context: string, camera: ICameraV2, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>> {
+    private _extensionsLoadCameraAsync(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>> {
         return this._applyExtensions(camera, (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));
     }
 
-    private _extensionsLoadVertexDataAsync(context: string, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
+    private _extensionsLoadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
         return this._applyExtensions(primitive, (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));
     }
 
-    private _extensionsLoadMaterialAsync(context: string, material: IMaterialV2, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
+    private _extensionsLoadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
         return this._applyExtensions(material, (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
     }
 
-    private _extensionsCreateMaterial(context: string, material: IMaterialV2, babylonDrawMode: number): Nullable<Material> {
+    private _extensionsCreateMaterial(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material> {
         return this._applyExtensions({}, (extension) => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));
     }
 
-    private _extensionsLoadMaterialPropertiesAsync(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>> {
+    private _extensionsLoadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
         return this._applyExtensions(material, (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));
     }
 
-    private _extensionsLoadTextureInfoAsync(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
+    private _extensionsLoadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
         return this._applyExtensions(textureInfo, (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));
     }
 
-    private _extensionsLoadAnimationAsync(context: string, animation: IAnimationV2): Nullable<Promise<AnimationGroup>> {
+    private _extensionsLoadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>> {
         return this._applyExtensions(animation, (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));
     }
 

+ 10 - 10
loaders/src/glTF/2.0/glTFLoaderExtension.ts

@@ -1,5 +1,5 @@
 import { IDisposable, Nullable, Mesh, Camera, Geometry, Material, BaseTexture, AnimationGroup } from "babylonjs";
-import { ISceneV2, INodeV2, ICameraV2, IMeshPrimitiveV2, IMaterialV2, ITextureInfoV2, IAnimationV2 } from "./glTFLoaderInterfaces";
+import { IScene, INode, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation } from "./glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFFileLoader";
 
 /** @hidden */
@@ -25,7 +25,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param scene The glTF scene property
      * @returns A promise that resolves when the load is complete or null if not handled
      */
-    loadSceneAsync?(context: string, scene: ISceneV2): Nullable<Promise<void>>;
+    loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;
 
     /**
      * Define this method to modify the default behavior when loading nodes.
@@ -34,7 +34,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
      */
-    loadNodeAsync?(context: string, node: INodeV2, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+    loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
 
     /**
      * Define this method to modify the default behavior when loading cameras.
@@ -43,7 +43,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
      */
-    loadCameraAsync?(context: string, camera: ICameraV2, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
+    loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
 
     /**
      * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
@@ -51,7 +51,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param primitive The glTF mesh primitive property
      * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
      */
-    _loadVertexDataAsync?(context: string, primitive: IMeshPrimitiveV2, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+    _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
 
     /**
      * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
@@ -60,7 +60,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
      */
-    _loadMaterialAsync?(context: string, material: IMaterialV2, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+    _loadMaterialAsync?(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
 
     /**
      * Define this method to modify the default behavior when creating materials.
@@ -69,7 +69,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param babylonDrawMode The draw mode for the Babylon material
      * @returns The Babylon material or null if not handled
      */
-    createMaterial?(context: string, material: IMaterialV2, babylonDrawMode: number): Nullable<Material>;
+    createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;
 
     /**
      * Define this method to modify the default behavior when loading material properties.
@@ -78,7 +78,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param babylonMaterial The Babylon material
      * @returns A promise that resolves when the load is complete or null if not handled
      */
-    loadMaterialPropertiesAsync?(context: string, material: IMaterialV2, babylonMaterial: Material): Nullable<Promise<void>>;
+    loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
 
     /**
      * Define this method to modify the default behavior when loading texture infos.
@@ -87,7 +87,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param assign A function called synchronously after parsing the glTF properties
      * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
      */
-    loadTextureInfoAsync?(context: string, textureInfo: ITextureInfoV2, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
+    loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
 
     /**
      * Define this method to modify the default behavior when loading animations.
@@ -95,7 +95,7 @@ export interface IGLTFLoaderExtensionV2 extends IGLTFLoaderExtension, IDisposabl
      * @param animation The glTF animation property
      * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
      */
-    loadAnimationAsync?(context: string, animation: IAnimationV2): Nullable<Promise<AnimationGroup>>;
+    loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
 
     /**
      * Define this method to modify the default behavior when loading uris.

+ 51 - 51
loaders/src/glTF/2.0/glTFLoaderInterfaces.ts

@@ -1,5 +1,5 @@
 import { VertexBuffer, Buffer, AnimationGroup, Material, AbstractMesh, Mesh, Bone, Skeleton } from "babylonjs";
-import { AnimationSamplerInterpolation, ITexture, ITextureInfo, IGLTF, ISampler, IScene, ISkin, IMesh, IMeshPrimitive, INode, IAccessor, IAnimationChannel, IAnimationSampler, IAnimation, IBuffer, IBufferView, ICamera, IImage, IMaterialNormalTextureInfo, IMaterialOcclusionTextureInfo, IMaterialPbrMetallicRoughness, IMaterial } from "babylonjs-gltf2interface";
+import * as IGLTF2 from "babylonjs-gltf2interface";
 
 /** @hidden */
 export var __IGLTFLoaderInterfacesV2 = 0; // I am here to allow dts to be created
@@ -7,7 +7,7 @@ export var __IGLTFLoaderInterfacesV2 = 0; // I am here to allow dts to be create
 /**
  * Loader interface with an index field.
  */
-export interface IArrayItemV2 {
+export interface IArrayItem {
     /**
      * The index of this item in the array.
      */
@@ -17,7 +17,7 @@ export interface IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IAccessorV2 extends IAccessor, IArrayItemV2 {
+export interface IAccessor extends IGLTF2.IAccessor, IArrayItem {
     /** @hidden */
     _data?: Promise<ArrayBufferView>;
 
@@ -28,30 +28,30 @@ export interface IAccessorV2 extends IAccessor, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IAnimationChannelV2 extends IAnimationChannel, IArrayItemV2 {
+export interface IAnimationChannel extends IGLTF2.IAnimationChannel, IArrayItem {
 }
 
 /** @hidden */
-export interface _IAnimationSamplerDataV2 {
+export interface _IAnimationSamplerData {
     input: Float32Array;
-    interpolation: AnimationSamplerInterpolation;
+    interpolation: IGLTF2.AnimationSamplerInterpolation;
     output: Float32Array;
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IAnimationSamplerV2 extends IAnimationSampler, IArrayItemV2 {
+export interface IAnimationSampler extends IGLTF2.IAnimationSampler, IArrayItem {
     /** @hidden */
-    _data?: Promise<_IAnimationSamplerDataV2>;
+    _data?: Promise<_IAnimationSamplerData>;
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IAnimationV2 extends IAnimation, IArrayItemV2 {
-    channels: IAnimationChannelV2[];
-    samplers: IAnimationSamplerV2[];
+export interface IAnimation extends IGLTF2.IAnimation, IArrayItem {
+    channels: IAnimationChannel[];
+    samplers: IAnimationSampler[];
 
     /** @hidden */
     _babylonAnimationGroup?: AnimationGroup;
@@ -60,7 +60,7 @@ export interface IAnimationV2 extends IAnimation, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IBufferV2 extends IBuffer, IArrayItemV2 {
+export interface IBuffer extends IGLTF2.IBuffer, IArrayItem {
     /** @hidden */
     _data?: Promise<ArrayBufferView>;
 }
@@ -68,7 +68,7 @@ export interface IBufferV2 extends IBuffer, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IBufferViewV2 extends IBufferView, IArrayItemV2 {
+export interface IBufferView extends IGLTF2.IBufferView, IArrayItem {
     /** @hidden */
     _data?: Promise<ArrayBufferView>;
 
@@ -79,13 +79,13 @@ export interface IBufferViewV2 extends IBufferView, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface ICameraV2 extends ICamera, IArrayItemV2 {
+export interface ICamera extends IGLTF2.ICamera, IArrayItem {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IImageV2 extends IImage, IArrayItemV2 {
+export interface IImage extends IGLTF2.IImage, IArrayItem {
     /** @hidden */
     _data?: Promise<ArrayBufferView>;
 }
@@ -93,31 +93,31 @@ export interface IImageV2 extends IImage, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IMaterialNormalTextureInfoV2 extends IMaterialNormalTextureInfo, ITextureInfo {
+export interface IMaterialNormalTextureInfo extends IGLTF2.IMaterialNormalTextureInfo, IGLTF2.ITextureInfo {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IMaterialOcclusionTextureInfoV2 extends IMaterialOcclusionTextureInfo, ITextureInfo {
+export interface IMaterialOcclusionTextureInfo extends IGLTF2.IMaterialOcclusionTextureInfo, IGLTF2.ITextureInfo {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IMaterialPbrMetallicRoughnessV2 extends IMaterialPbrMetallicRoughness {
-    baseColorTexture?: ITextureInfoV2;
-    metallicRoughnessTexture?: ITextureInfoV2;
+export interface IMaterialPbrMetallicRoughness extends IGLTF2.IMaterialPbrMetallicRoughness {
+    baseColorTexture?: ITextureInfo;
+    metallicRoughnessTexture?: ITextureInfo;
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IMaterialV2 extends IMaterial, IArrayItemV2 {
-    pbrMetallicRoughness?: IMaterialPbrMetallicRoughnessV2;
-    normalTexture?: IMaterialNormalTextureInfoV2;
-    occlusionTexture?: IMaterialOcclusionTextureInfoV2;
-    emissiveTexture?: ITextureInfoV2;
+export interface IMaterial extends IGLTF2.IMaterial, IArrayItem {
+    pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+    normalTexture?: IMaterialNormalTextureInfo;
+    occlusionTexture?: IMaterialOcclusionTextureInfo;
+    emissiveTexture?: ITextureInfo;
 
     /** @hidden */
     _babylonData?: {
@@ -132,24 +132,24 @@ export interface IMaterialV2 extends IMaterial, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface IMeshV2 extends IMesh, IArrayItemV2 {
-    primitives: IMeshPrimitiveV2[];
+export interface IMesh extends IGLTF2.IMesh, IArrayItem {
+    primitives: IMeshPrimitive[];
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IMeshPrimitiveV2 extends IMeshPrimitive, IArrayItemV2 {
+export interface IMeshPrimitive extends IGLTF2.IMeshPrimitive, IArrayItem {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface INodeV2 extends INode, IArrayItemV2 {
+export interface INode extends IGLTF2.INode, IArrayItem {
     /**
      * The parent glTF node.
      */
-    parent?: INodeV2;
+    parent?: INode;
 
     /** @hidden */
     _babylonMesh?: Mesh;
@@ -165,7 +165,7 @@ export interface INodeV2 extends INode, IArrayItemV2 {
 }
 
 /** @hidden */
-export interface _ISamplerDataV2 {
+export interface _ISamplerData {
     noMipMaps: boolean;
     samplingMode: number;
     wrapU: number;
@@ -175,21 +175,21 @@ export interface _ISamplerDataV2 {
 /**
  * Loader interface with additional members.
  */
-export interface ISamplerV2 extends ISampler, IArrayItemV2 {
+export interface ISampler extends IGLTF2.ISampler, IArrayItem {
     /** @hidden */
-    _data?: _ISamplerDataV2;
+    _data?: _ISamplerData;
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface ISceneV2 extends IScene, IArrayItemV2 {
+export interface IScene extends IGLTF2.IScene, IArrayItem {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface ISkinV2 extends ISkin, IArrayItemV2 {
+export interface ISkin extends IGLTF2.ISkin, IArrayItem {
     /** @hidden */
     _babylonSkeleton?: Skeleton;
 
@@ -200,30 +200,30 @@ export interface ISkinV2 extends ISkin, IArrayItemV2 {
 /**
  * Loader interface with additional members.
  */
-export interface ITextureV2 extends ITexture, IArrayItemV2 {
+export interface ITexture extends IGLTF2.ITexture, IArrayItem {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface ITextureInfoV2 extends ITextureInfo {
+export interface ITextureInfo extends IGLTF2.ITextureInfo {
 }
 
 /**
  * Loader interface with additional members.
  */
-export interface IGLTFV2 extends IGLTF {
-    accessors?: IAccessorV2[];
-    animations?: IAnimationV2[];
-    buffers?: IBufferV2[];
-    bufferViews?: IBufferViewV2[];
-    cameras?: ICameraV2[];
-    images?: IImageV2[];
-    materials?: IMaterialV2[];
-    meshes?: IMeshV2[];
-    nodes?: INodeV2[];
-    samplers?: ISamplerV2[];
-    scenes?: ISceneV2[];
-    skins?: ISkinV2[];
-    textures?: ITextureV2[];
+export interface IGLTF extends IGLTF2.IGLTF {
+    accessors?: IAccessor[];
+    animations?: IAnimation[];
+    buffers?: IBuffer[];
+    bufferViews?: IBufferView[];
+    cameras?: ICamera[];
+    images?: IImage[];
+    materials?: IMaterial[];
+    meshes?: IMesh[];
+    nodes?: INode[];
+    samplers?: ISampler[];
+    scenes?: IScene[];
+    skins?: ISkin[];
+    textures?: ITexture[];
 }