Forráskód Böngészése

Gulp clean a bit up

sebastien 6 éve
szülő
commit
ca39d2aa46

+ 1 - 1
.travis.yml

@@ -11,7 +11,7 @@ cache:
   - Playground/node_modules
   - tests/unit/node_modules
 install:
-- travis_retry npm install -g gulp
+- travis_retry npm install -g gulp@4.0.0
 - cd ./Tools/Gulp
 - travis_retry npm install
 jobs:

+ 242 - 242
Playground/babylon.d.txt

@@ -5916,52 +5916,6 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
-     * Interface used to define a behavior
-     */
-    interface Behavior<T> {
-        /** gets or sets behavior's name */
-        name: string;
-        /**
-         * Function called when the behavior needs to be initialized (after attaching it to a target)
-         */
-        init(): void;
-        /**
-         * Called when the behavior is attached to a target
-         * @param target defines the target where the behavior is attached to
-         */
-        attach(target: T): void;
-        /**
-         * Called when the behavior is detached from its target
-         */
-        detach(): void;
-    }
-    /**
-     * Interface implemented by classes supporting behaviors
-     */
-    interface IBehaviorAware<T> {
-        /**
-         * Attach a behavior
-         * @param behavior defines the behavior to attach
-         * @returns the current host
-         */
-        addBehavior(behavior: Behavior<T>): T;
-        /**
-         * Remove a behavior from the current object
-         * @param behavior defines the behavior to detach
-         * @returns the current host
-         */
-        removeBehavior(behavior: Behavior<T>): T;
-        /**
-         * Gets a behavior using its name to search
-         * @param name defines the name to search
-         * @returns the behavior or null if not found
-         */
-        getBehaviorByName(name: string): Nullable<Behavior<T>>;
-    }
-}
-
-declare module BABYLON {
-    /**
      * Class used to store bone information
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons
      */
@@ -6719,6 +6673,52 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
+     * Interface used to define a behavior
+     */
+    interface Behavior<T> {
+        /** gets or sets behavior's name */
+        name: string;
+        /**
+         * Function called when the behavior needs to be initialized (after attaching it to a target)
+         */
+        init(): void;
+        /**
+         * Called when the behavior is attached to a target
+         * @param target defines the target where the behavior is attached to
+         */
+        attach(target: T): void;
+        /**
+         * Called when the behavior is detached from its target
+         */
+        detach(): void;
+    }
+    /**
+     * Interface implemented by classes supporting behaviors
+     */
+    interface IBehaviorAware<T> {
+        /**
+         * Attach a behavior
+         * @param behavior defines the behavior to attach
+         * @returns the current host
+         */
+        addBehavior(behavior: Behavior<T>): T;
+        /**
+         * Remove a behavior from the current object
+         * @param behavior defines the behavior to detach
+         * @returns the current host
+         */
+        removeBehavior(behavior: Behavior<T>): T;
+        /**
+         * Gets a behavior using its name to search
+         * @param name defines the name to search
+         * @returns the behavior or null if not found
+         */
+        getBehaviorByName(name: string): Nullable<Behavior<T>>;
+    }
+}
+
+declare module BABYLON {
+    /**
      * This represents an orbital type of camera.
      *
      * This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events.
@@ -24062,6 +24062,202 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
+     * Defines a target to use with MorphTargetManager
+     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
+     */
+    class MorphTarget implements IAnimatable {
+        /** defines the name of the target */
+        name: string;
+        /**
+         * Gets or sets the list of animations
+         */
+        animations: Animation[];
+        private _scene;
+        private _positions;
+        private _normals;
+        private _tangents;
+        private _influence;
+        /**
+         * Observable raised when the influence changes
+         */
+        onInfluenceChanged: Observable<boolean>;
+        /** @hidden */
+
+        /**
+         * Gets or sets the influence of this target (ie. its weight in the overall morphing)
+         */
+        influence: number;
+        private _animationPropertiesOverride;
+        /**
+         * Gets or sets the animation properties override
+         */
+        animationPropertiesOverride: Nullable<AnimationPropertiesOverride>;
+        /**
+         * Creates a new MorphTarget
+         * @param name defines the name of the target
+         * @param influence defines the influence to use
+         */
+        constructor(
+        /** defines the name of the target */
+        name: string, influence?: number, scene?: Nullable<Scene>);
+        /**
+         * Gets a boolean defining if the target contains position data
+         */
+        readonly hasPositions: boolean;
+        /**
+         * Gets a boolean defining if the target contains normal data
+         */
+        readonly hasNormals: boolean;
+        /**
+         * Gets a boolean defining if the target contains tangent data
+         */
+        readonly hasTangents: boolean;
+        /**
+         * Affects position data to this target
+         * @param data defines the position data to use
+         */
+        setPositions(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the position data stored in this target
+         * @returns a FloatArray containing the position data (or null if not present)
+         */
+        getPositions(): Nullable<FloatArray>;
+        /**
+         * Affects normal data to this target
+         * @param data defines the normal data to use
+         */
+        setNormals(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the normal data stored in this target
+         * @returns a FloatArray containing the normal data (or null if not present)
+         */
+        getNormals(): Nullable<FloatArray>;
+        /**
+         * Affects tangent data to this target
+         * @param data defines the tangent data to use
+         */
+        setTangents(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the tangent data stored in this target
+         * @returns a FloatArray containing the tangent data (or null if not present)
+         */
+        getTangents(): Nullable<FloatArray>;
+        /**
+         * Serializes the current target into a Serialization object
+         * @returns the serialized object
+         */
+        serialize(): any;
+        /**
+         * Creates a new target from serialized data
+         * @param serializationObject defines the serialized data to use
+         * @returns a new MorphTarget
+         */
+        static Parse(serializationObject: any): MorphTarget;
+        /**
+         * Creates a MorphTarget from mesh data
+         * @param mesh defines the source mesh
+         * @param name defines the name to use for the new target
+         * @param influence defines the influence to attach to the target
+         * @returns a new MorphTarget
+         */
+        static FromMesh(mesh: AbstractMesh, name?: string, influence?: number): MorphTarget;
+    }
+}
+
+declare module BABYLON {
+    /**
+     * This class is used to deform meshes using morphing between different targets
+     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
+     */
+    class MorphTargetManager {
+        private _targets;
+        private _targetInfluenceChangedObservers;
+        private _targetDataLayoutChangedObservers;
+        private _activeTargets;
+        private _scene;
+        private _influences;
+        private _supportsNormals;
+        private _supportsTangents;
+        private _vertexCount;
+        private _uniqueId;
+        private _tempInfluences;
+        /**
+         * Creates a new MorphTargetManager
+         * @param scene defines the current scene
+         */
+        constructor(scene?: Nullable<Scene>);
+        /**
+         * Gets the unique ID of this manager
+         */
+        readonly uniqueId: number;
+        /**
+         * Gets the number of vertices handled by this manager
+         */
+        readonly vertexCount: number;
+        /**
+         * Gets a boolean indicating if this manager supports morphing of normals
+         */
+        readonly supportsNormals: boolean;
+        /**
+         * Gets a boolean indicating if this manager supports morphing of tangents
+         */
+        readonly supportsTangents: boolean;
+        /**
+         * Gets the number of targets stored in this manager
+         */
+        readonly numTargets: number;
+        /**
+         * Gets the number of influencers (ie. the number of targets with influences > 0)
+         */
+        readonly numInfluencers: number;
+        /**
+         * Gets the list of influences (one per target)
+         */
+        readonly influences: Float32Array;
+        /**
+         * Gets the active target at specified index. An active target is a target with an influence > 0
+         * @param index defines the index to check
+         * @returns the requested target
+         */
+        getActiveTarget(index: number): MorphTarget;
+        /**
+         * Gets the target at specified index
+         * @param index defines the index to check
+         * @returns the requested target
+         */
+        getTarget(index: number): MorphTarget;
+        /**
+         * Add a new target to this manager
+         * @param target defines the target to add
+         */
+        addTarget(target: MorphTarget): void;
+        /**
+         * Removes a target from the manager
+         * @param target defines the target to remove
+         */
+        removeTarget(target: MorphTarget): void;
+        /**
+         * Serializes the current manager into a Serialization object
+         * @returns the serialized object
+         */
+        serialize(): any;
+        private _syncActiveTargets;
+        /**
+         * Syncrhonize the targets with all the meshes using this morph target manager
+         */
+        synchronize(): void;
+        /**
+         * Creates a new MorphTargetManager from serialized data
+         * @param serializationObject defines the serialized data
+         * @param scene defines the hosting scene
+         * @returns the new MorphTargetManager
+         */
+        static Parse(serializationObject: any, scene: Scene): MorphTargetManager;
+    }
+}
+
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -29687,202 +29883,6 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
-     * Defines a target to use with MorphTargetManager
-     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
-     */
-    class MorphTarget implements IAnimatable {
-        /** defines the name of the target */
-        name: string;
-        /**
-         * Gets or sets the list of animations
-         */
-        animations: Animation[];
-        private _scene;
-        private _positions;
-        private _normals;
-        private _tangents;
-        private _influence;
-        /**
-         * Observable raised when the influence changes
-         */
-        onInfluenceChanged: Observable<boolean>;
-        /** @hidden */
-
-        /**
-         * Gets or sets the influence of this target (ie. its weight in the overall morphing)
-         */
-        influence: number;
-        private _animationPropertiesOverride;
-        /**
-         * Gets or sets the animation properties override
-         */
-        animationPropertiesOverride: Nullable<AnimationPropertiesOverride>;
-        /**
-         * Creates a new MorphTarget
-         * @param name defines the name of the target
-         * @param influence defines the influence to use
-         */
-        constructor(
-        /** defines the name of the target */
-        name: string, influence?: number, scene?: Nullable<Scene>);
-        /**
-         * Gets a boolean defining if the target contains position data
-         */
-        readonly hasPositions: boolean;
-        /**
-         * Gets a boolean defining if the target contains normal data
-         */
-        readonly hasNormals: boolean;
-        /**
-         * Gets a boolean defining if the target contains tangent data
-         */
-        readonly hasTangents: boolean;
-        /**
-         * Affects position data to this target
-         * @param data defines the position data to use
-         */
-        setPositions(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the position data stored in this target
-         * @returns a FloatArray containing the position data (or null if not present)
-         */
-        getPositions(): Nullable<FloatArray>;
-        /**
-         * Affects normal data to this target
-         * @param data defines the normal data to use
-         */
-        setNormals(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the normal data stored in this target
-         * @returns a FloatArray containing the normal data (or null if not present)
-         */
-        getNormals(): Nullable<FloatArray>;
-        /**
-         * Affects tangent data to this target
-         * @param data defines the tangent data to use
-         */
-        setTangents(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the tangent data stored in this target
-         * @returns a FloatArray containing the tangent data (or null if not present)
-         */
-        getTangents(): Nullable<FloatArray>;
-        /**
-         * Serializes the current target into a Serialization object
-         * @returns the serialized object
-         */
-        serialize(): any;
-        /**
-         * Creates a new target from serialized data
-         * @param serializationObject defines the serialized data to use
-         * @returns a new MorphTarget
-         */
-        static Parse(serializationObject: any): MorphTarget;
-        /**
-         * Creates a MorphTarget from mesh data
-         * @param mesh defines the source mesh
-         * @param name defines the name to use for the new target
-         * @param influence defines the influence to attach to the target
-         * @returns a new MorphTarget
-         */
-        static FromMesh(mesh: AbstractMesh, name?: string, influence?: number): MorphTarget;
-    }
-}
-
-declare module BABYLON {
-    /**
-     * This class is used to deform meshes using morphing between different targets
-     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
-     */
-    class MorphTargetManager {
-        private _targets;
-        private _targetInfluenceChangedObservers;
-        private _targetDataLayoutChangedObservers;
-        private _activeTargets;
-        private _scene;
-        private _influences;
-        private _supportsNormals;
-        private _supportsTangents;
-        private _vertexCount;
-        private _uniqueId;
-        private _tempInfluences;
-        /**
-         * Creates a new MorphTargetManager
-         * @param scene defines the current scene
-         */
-        constructor(scene?: Nullable<Scene>);
-        /**
-         * Gets the unique ID of this manager
-         */
-        readonly uniqueId: number;
-        /**
-         * Gets the number of vertices handled by this manager
-         */
-        readonly vertexCount: number;
-        /**
-         * Gets a boolean indicating if this manager supports morphing of normals
-         */
-        readonly supportsNormals: boolean;
-        /**
-         * Gets a boolean indicating if this manager supports morphing of tangents
-         */
-        readonly supportsTangents: boolean;
-        /**
-         * Gets the number of targets stored in this manager
-         */
-        readonly numTargets: number;
-        /**
-         * Gets the number of influencers (ie. the number of targets with influences > 0)
-         */
-        readonly numInfluencers: number;
-        /**
-         * Gets the list of influences (one per target)
-         */
-        readonly influences: Float32Array;
-        /**
-         * Gets the active target at specified index. An active target is a target with an influence > 0
-         * @param index defines the index to check
-         * @returns the requested target
-         */
-        getActiveTarget(index: number): MorphTarget;
-        /**
-         * Gets the target at specified index
-         * @param index defines the index to check
-         * @returns the requested target
-         */
-        getTarget(index: number): MorphTarget;
-        /**
-         * Add a new target to this manager
-         * @param target defines the target to add
-         */
-        addTarget(target: MorphTarget): void;
-        /**
-         * Removes a target from the manager
-         * @param target defines the target to remove
-         */
-        removeTarget(target: MorphTarget): void;
-        /**
-         * Serializes the current manager into a Serialization object
-         * @returns the serialized object
-         */
-        serialize(): any;
-        private _syncActiveTargets;
-        /**
-         * Syncrhonize the targets with all the meshes using this morph target manager
-         */
-        synchronize(): void;
-        /**
-         * Creates a new MorphTargetManager from serialized data
-         * @param serializationObject defines the serialized data
-         * @param scene defines the hosting scene
-         * @returns the new MorphTargetManager
-         */
-        static Parse(serializationObject: any, scene: Scene): MorphTargetManager;
-    }
-}
-
-declare module BABYLON {
-    /**
      * Class used to enable access to IndexedDB
      * @see http://doc.babylonjs.com/how_to/caching_resources_in_indexeddb
      */

+ 115 - 330
Tools/Gulp/gulpfile.js

@@ -19,7 +19,6 @@ var dtsBundle = require('dts-bundle');
 var through = require('through2');
 
 // Gulp Helpers
-var appendSrcToVariable = require("./helpers/gulp-appendSrcToVariable");
 var addDtsExport = require("./helpers/gulp-addDtsExport");
 var addDecorateAndExtends = require("./helpers/gulp-decorateAndExtends");
 var addModuleExports = require("./helpers/gulp-addModuleExports");
@@ -46,7 +45,6 @@ var workersStream;
 
 var extendsSearchRegex = /var\s__extends[\s\S]+?\}\)\(\);/g;
 var decorateSearchRegex = /var\s__decorate[\s\S]+?\};/g;
-var referenceSearchRegex = /\/\/\/ <reference.*/g;
 
 /**
  * TS configurations shared in the gulp file.
@@ -73,26 +71,6 @@ var tsConfig = {
 };
 var tsProject = typescript.createProject(tsConfig);
 
-var externalTsConfig = {
-    noResolve: false,
-    target: "ES5",
-    declarationFiles: true,
-    typescript: require("typescript"),
-    experimentalDecorators: true,
-    isolatedModules: false,
-    noImplicitAny: true,
-    noImplicitReturns: true,
-    noImplicitThis: true,
-    noUnusedLocals: true,
-    strictNullChecks: true,
-    types: [],
-    lib: [
-        "dom",
-        "es2015.promise",
-        "es5"
-    ]
-};
-
 function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
     if (!firstLevelOnly && dependency.dependUpon) {
         for (var i = 0; i < dependency.dependUpon.length; i++) {
@@ -302,338 +280,154 @@ gulp.task("typescript-compile", function() {
  */
 gulp.task("typescript", gulp.series("typescript-compile", "buildWorker", "build"));
 
-/**
- * Helper methods to build external library (mat, post processes, ...).
- */
-var buildExternalLibraries = function(settings) {
-    var tasks = settings.libraries.map(function(library) {
-        return buildExternalLibrary(library, settings, false);
-    });
-
-    let mergedTasks = merge2(tasks);
-
-    if (settings.build.buildAsModule) {
-        mergedTasks.on("end", function() {
-            //generate js file list
-            let files = settings.libraries.filter(function(lib) {
-                return !lib.doNotIncludeInBundle;
-            }).map(function(lib) {
-                return config.build.outputDirectory + settings.build.distOutputDirectory + lib.output;
-            });
-
-            var outputDirectory = config.build.outputDirectory + settings.build.distOutputDirectory;
-
-            let srcTask = gulp.src(files)
-                .pipe(concat(settings.build.outputFilename + ".js"))
-                .pipe(replace(extendsSearchRegex, ""))
-                .pipe(replace(decorateSearchRegex, ""))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(addDecorateAndExtends())
-                .pipe(addModuleExports(settings.build.moduleDeclaration, { subModule: true, extendsRoot: settings.build.extendsRoot }))
-                .pipe(gulp.dest(outputDirectory))
-                .pipe(cleants())
-                .pipe(rename({ extname: ".min.js" }))
-                .pipe(uglify())
-                .pipe(optimisejs())
-                .pipe(gulp.dest(outputDirectory));
-
-            let dtsFiles = files.map(function(filename) {
-                return filename.replace(".js", ".d.ts");
-            });
-            let dtsModuleTask = gulp.src(dtsFiles)
-                .pipe(concat(settings.build.outputFilename + ".module.d.ts"))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(addDtsExport(settings.build.moduleDeclaration, settings.build.moduleName, true, settings.build.extendsRoot, settings.build.extraTypesDependencies))
-                .pipe(gulp.dest(outputDirectory));
-            let dtsTask = gulp.src(dtsFiles)
-                .pipe(concat(settings.build.outputFilename + ".d.ts"))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(gulp.dest(outputDirectory));
-
-            return merge2([srcTask, dtsTask, dtsModuleTask]);
-        });
-    }
-
-    return mergedTasks;
-}
-
-var buildExternalLibrary = function(library, settings, watch) {
-    var tsProcess;
-    if (library.files && library.files.length) {
-        tsProcess = gulp.src(library.files, { base: settings.build.srcOutputDirectory })
-            .pipe(sourcemaps.init())
-            .pipe(typescript(externalTsConfig));
-    }
-
-    let tasks = [];
-
-    let shaderTask;
-
-    let shadersInclueTask;
-
-    if (library.shadersIncludeFiles && library.shadersIncludeFiles.length) {
-        shadersInclueTask = gulp.src(library.shadersIncludeFiles, { base: settings.build.srcOutputDirectory })
-            .pipe(uncommentShader())
-            .pipe(appendSrcToVariable("BABYLON.Effect.IncludesShadersStore", includeShadersName, library.output + ".include.fx"))
-            .pipe(gulp.dest(settings.build.srcOutputDirectory));
-        tasks.push(shadersInclueTask);
-    }
-
-    if (library.shaderFiles && library.shaderFiles.length) {
-        shaderTask = gulp.src(library.shaderFiles, { base: settings.build.srcOutputDirectory })
-            .pipe(uncommentShader())
-            .pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, library.output + ".fx"))
-            .pipe(gulp.dest(settings.build.srcOutputDirectory));
-        tasks.push(shaderTask);
-    }
-
-    var dev;
-
-    if (tsProcess) {
-        dev = tsProcess.js
-            .pipe(sourcemaps.write("./", {
-                includeContent: false,
-                sourceRoot: (filePath) => {
-                    return "";
-                }
-            })).pipe(gulp.dest(settings.build.srcOutputDirectory));
-
-        tasks.push(dev);
-    }
-
+var buildExternalLibrary = function(library, settings) {
     var outputDirectory = config.build.outputDirectory + settings.build.distOutputDirectory;
 
-    if (watch) {
-        return merge2(tasks);
+    if (!library.webpack) {
+        throw "Missing Webpack configuration in " + library;
     }
-    else {
-        let currentTasks = [];
-        if (tsProcess) {
-            currentTasks.push(tsProcess.js);
-        }
-        if (shaderTask) {
-            currentTasks.push(shaderTask);
-        }
-        if (shadersInclueTask) {
-            currentTasks.push(shadersInclueTask);
-        }
-        var code;
-
-        if (currentTasks.length) {
-            code = merge2(currentTasks)
-                .pipe(concat(library.output));
-        }
 
-        if (library.buildAsModule && code) {
-            code = code.pipe(replace(extendsSearchRegex, ""))
-                .pipe(replace(decorateSearchRegex, ""))
-                .pipe(addDecorateAndExtends())
-                .pipe(addModuleExports(library.moduleDeclaration, { subModule: true, extendsRoot: library.extendsRoot }))
-        }
-
-        if (code) {
-
-            code = code.pipe(gulp.dest(outputDirectory))
-                .pipe(cleants())
-                .pipe(rename({ extname: ".min.js" }))
-                .pipe(uglify())
-                .pipe(optimisejs())
-                .pipe(gulp.dest(outputDirectory));
-            /*}*/
-
-        }
-
-        var dts;
+    const sequence = [];
+    if (settings.build.outputs) {
+        settings.build.outputs.forEach(out => {
+            let wpConfig = require(library.webpack);
+            if (!out.minified) {
+                wpConfig.mode = "development";
+            }
 
-        if (tsProcess) {
-            dts = tsProcess.dts
-                .pipe(concat(library.output))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(rename({ extname: ".d.ts" }))
-                .pipe(gulp.dest(outputDirectory));
-        }
+            let wpBuild = webpackStream(wpConfig, require("webpack"));
+
+            //shoud dtsBundle create the declaration?
+            if (settings.build.dtsBundle) {
+                let event = wpBuild
+                    .pipe(through.obj(function(file, enc, cb) {
+                        // only declaration files
+                        const isdts = /\.d\.ts$/.test(file.path);
+                        if (isdts) this.push(file);
+                        cb();
+                    }))
+                    .pipe(gulp.dest(outputDirectory));
+                // dts-bundle does NOT support (gulp) streams, so files have to be saved and reloaded, 
+                // until I fix it
+                event.on("end", function() {
+                    // create the file
+                    dtsBundle.bundle(settings.build.dtsBundle);
+                    // prepend the needed reference
+                    let fileLocation = path.join(path.dirname(settings.build.dtsBundle.main), settings.build.dtsBundle.out);
+                    fs.readFile(fileLocation, function(err, data) {
+                        if (err) throw err;
+                        data = (settings.build.dtsBundle.prependText || "") + '\n' + data.toString();
+                        fs.writeFileSync(fileLocation, data);
+                        if (settings.build.processDeclaration) {
+                            var newData = processDeclaration(data, settings.build.processDeclaration);
+                            fs.writeFileSync(fileLocation.replace('.module', ''), newData);
+                        }
+                    });
+                });
+            }
 
-        var waitAll;
-        let waitAllTasks = [];
+            let build = wpBuild
+                .pipe(through.obj(function(file, enc, cb) {
+                    // only pipe js files
+                    const isJs = /\.js$/.test(file.path);
+                    if (isJs) this.push(file);
+                    cb();
+                }))
+                .pipe(addModuleExports(library.moduleDeclaration, { subModule: false, extendsRoot: false, externalUsingBabylon: true, noBabylonInit: library.babylonIncluded }));
+
+            function processDestination(dest) {
+                var outputDirectory = config.build.outputDirectory + dest.outputDirectory;
+                build = build
+                    .pipe(rename(dest.filename.replace(".js", library.noBundleInName ? '.js' : ".bundle.js")))
+                    .pipe(gulp.dest(outputDirectory));
+
+                if (library.babylonIncluded && dest.addBabylonDeclaration) {
+                    // include the babylon declaration
+                    if (dest.addBabylonDeclaration === true) {
+                        dest.addBabylonDeclaration = [config.build.declarationFilename];
+                    }
+                    var decsToAdd = dest.addBabylonDeclaration.map(function(dec) {
+                        return config.build.outputDirectory + '/' + dec;
+                    });
+                    sequence.unshift(gulp.src(decsToAdd)
+                        .pipe(rename(function(path) {
+                            path.dirname = '';
+                        }))
+                        .pipe(gulp.dest(outputDirectory)))
+                }
+            }
 
+            out.destinations.forEach(dest => {
+                processDestination(dest);
+            });
 
-        if (dev) {
-            waitAllTasks.push(dev);
-        }
+            sequence.push(build);
 
-        if (code) {
-            waitAllTasks.push(code);
+        });
+    } else {
+        var wpConfig;
+        if (library.entry) {
+            wpConfig = require(settings.build.webpack);
+            wpConfig.entry = {
+                'main': path.resolve(wpConfig.context, library.entry),
+            };
+            wpConfig.output.filename = library.output;
         }
-
-        if (dts) {
-            waitAllTasks.push(dts);
+        else {
+            wpConfig = require(library.webpack);
         }
 
-        if (library.buildAsModule && tsProcess) {
-            var dts2 = tsProcess.dts
-                .pipe(concat(library.output))
-                .pipe(replace(referenceSearchRegex, ""))
-                .pipe(addDtsExport(library.moduleDeclaration, library.moduleName, true, library.extendsRoot, config.build.extraTypesDependencies))
-                .pipe(rename({ extname: ".module.d.ts" }))
-                .pipe(gulp.dest(outputDirectory));
-            waitAllTasks.push(dts2);
-        }
-        if (waitAllTasks.length) {
-            waitAll = merge2(waitAllTasks);
-        }
+        let wpBuild = webpackStream(wpConfig, webpack);
 
-        if (library.webpack) {
-            let sequence = [];
-            if (waitAll) {
-                sequence.push(waitAll);
-            }
+        let buildEvent = wpBuild.pipe(gulp.dest(outputDirectory));
+        sequence.push(buildEvent);
 
-            if (settings.build.outputs) {
+        // Generate unminified
+        wpConfig.mode = "development";
+        wpConfig.output.filename = wpConfig.output.filename.replace(".min", "");
 
-                settings.build.outputs.forEach(out => {
-                    let wpConfig = require(library.webpack);
-                    if (!out.minified) {
-                        wpConfig.mode = "development";
-                    }
+        wpBuild = webpackStream(wpConfig, webpack);
 
-                    let wpBuild = webpackStream(wpConfig, require("webpack"));
+        let buildEvent2 = wpBuild.pipe(gulp.dest(outputDirectory));
+        sequence.push(buildEvent2);
 
-                    //shoud dtsBundle create the declaration?
+        if (library.isMain) {
+            if (settings.build.dtsBundle || settings.build.processDeclaration) {
+                buildEvent.on("end", function() {
                     if (settings.build.dtsBundle) {
-                        let event = wpBuild
-                            .pipe(through.obj(function(file, enc, cb) {
-                                // only declaration files
-                                const isdts = /\.d\.ts$/.test(file.path);
-                                if (isdts) this.push(file);
-                                cb();
-                            }))
-                            .pipe(gulp.dest(outputDirectory));
-                        // dts-bundle does NOT support (gulp) streams, so files have to be saved and reloaded, 
-                        // until I fix it
-                        event.on("end", function() {
-                            // create the file
-                            dtsBundle.bundle(settings.build.dtsBundle);
-                            // prepend the needed reference
-                            let fileLocation = path.join(path.dirname(settings.build.dtsBundle.main), settings.build.dtsBundle.out);
-                            fs.readFile(fileLocation, function(err, data) {
-                                if (err) throw err;
-                                data = (settings.build.dtsBundle.prependText || "") + '\n' + data.toString();
-                                fs.writeFileSync(fileLocation, data);
-                                if (settings.build.processDeclaration) {
-                                    var newData = processDeclaration(data, settings.build.processDeclaration);
-                                    fs.writeFileSync(fileLocation.replace('.module', ''), newData);
-                                }
-                            });
-                        });
+                        dtsBundle.bundle(settings.build.dtsBundle);
                     }
 
-                    let build = wpBuild
-                        .pipe(through.obj(function(file, enc, cb) {
-                            // only pipe js files
-                            const isJs = /\.js$/.test(file.path);
-                            if (isJs) this.push(file);
-                            cb();
-                        }))
-                        .pipe(addModuleExports(library.moduleDeclaration, { subModule: false, extendsRoot: false, externalUsingBabylon: true, noBabylonInit: library.babylonIncluded }));
-
-                    function processDestination(dest) {
-                        var outputDirectory = config.build.outputDirectory + dest.outputDirectory;
-                        build = build
-                            .pipe(rename(dest.filename.replace(".js", library.noBundleInName ? '.js' : ".bundle.js")))
-                            .pipe(gulp.dest(outputDirectory));
-
-                        if (library.babylonIncluded && dest.addBabylonDeclaration) {
-                            // include the babylon declaration
-                            if (dest.addBabylonDeclaration === true) {
-                                dest.addBabylonDeclaration = [config.build.declarationFilename];
-                            }
-                            var decsToAdd = dest.addBabylonDeclaration.map(function(dec) {
-                                return config.build.outputDirectory + '/' + dec;
-                            });
-                            sequence.unshift(gulp.src(decsToAdd)
-                                .pipe(rename(function(path) {
-                                    path.dirname = '';
-                                }))
-                                .pipe(gulp.dest(outputDirectory)))
-                        }
-                    }
+                    if (settings.build.processDeclaration) {
+                        let fileLocation = path.join(outputDirectory, settings.build.processDeclaration.filename);
+                        fs.readFile(fileLocation, function(err, data) {
+                            if (err) throw err;
 
-                    out.destinations.forEach(dest => {
-                        processDestination(dest);
-                    });
-
-                    sequence.push(build);
-
-                });
-            } else {
-                var wpConfig;
-                if (library.entry) {
-                    wpConfig = require(settings.build.webpack);
-                    wpConfig.entry = {
-                        'main': path.resolve(wpConfig.context, library.entry),
-                    };
-                    wpConfig.output.filename = library.output;
-                }
-                else {
-                    wpConfig = require(library.webpack);
-                }
+                            // For Raanan, litteral import hack TO BETTER INTEGRATE
+                            data = data + "";
+                            data = data.replace('import "../sass/main.scss";', "");
 
-                let wpBuild = webpackStream(wpConfig, webpack);
-
-                let buildEvent = wpBuild.pipe(gulp.dest(outputDirectory));
-                sequence.push(buildEvent);
-
-                // Generate unminified
-                wpConfig.mode = "development";
-                wpConfig.output.filename = wpConfig.output.filename.replace(".min", "");
-
-                wpBuild = webpackStream(wpConfig, webpack);
-
-                let buildEvent2 = wpBuild.pipe(gulp.dest(outputDirectory));
-                sequence.push(buildEvent2);
-
-                if (library.isMain) {
-                    if (settings.build.dtsBundle || settings.build.processDeclaration) {
-                        buildEvent.on("end", function() {
-                            if (settings.build.dtsBundle) {
-                                dtsBundle.bundle(settings.build.dtsBundle);
-                            }
-
-                            if (settings.build.processDeclaration) {
-                                let fileLocation = path.join(outputDirectory, settings.build.processDeclaration.filename);
-                                fs.readFile(fileLocation, function(err, data) {
-                                    if (err) throw err;
-
-                                    // For Raanan, litteral import hack TO BETTER INTEGRATE
-                                    data = data + "";
-                                    data = data.replace('import "../sass/main.scss";', "");
-
-                                    var newData = processDeclaration(data, settings.build.processDeclaration);
-                                    fs.writeFileSync(fileLocation.replace('.module', ''), newData);
-                                    //legacy module support
-                                    fs.writeFileSync(fileLocation, data + "\n" + newData);
-                                });
-                            }
+                            var newData = processDeclaration(data, settings.build.processDeclaration);
+                            fs.writeFileSync(fileLocation.replace('.module', ''), newData);
+                            //legacy module support
+                            fs.writeFileSync(fileLocation, data + "\n" + newData);
                         });
                     }
-                }
+                });
             }
-
-            return merge2(sequence);
-        }
-        else {
-            return waitAll || Promise.resolve();
         }
     }
+
+    return merge2(sequence);
 }
 
 /**
  * Dynamic module creation In Serie for WebPack leaks.
  */
-function buildExternalLibrariesInSeries(settings) {
+function buildExternalLibraries(settings) {
     var tasks = settings.libraries.map(function(library) {
         var build = function(cb) {
-            return buildExternalLibrary(library, settings, false);
+            return buildExternalLibrary(library, settings);
         }
         return build;
     });
@@ -645,16 +439,7 @@ function buildExternalLibrariesInSeries(settings) {
  * Dynamic module creation.
  */
 config.modules.map(function(module) {
-    // New Way
-    if (!config[module].buildAsModule) {
-        gulp.task(module, buildExternalLibrariesInSeries(config[module]));
-    }
-    // Soon To Be Gone
-    else {
-        gulp.task(module, function() {
-            return buildExternalLibraries(config[module]);
-        });
-    }
+    gulp.task(module, buildExternalLibraries(config[module]));
 });
 
 /**

+ 0 - 99
Tools/Gulp/helpers/gulp-appendSrcToVariable.js

@@ -1,99 +0,0 @@
-var through = require('through2');
-var gutil = require('gulp-util');
-var PluginError = gutil.PluginError;
-var path = require('path');
-var File = gutil.File;
-
-// Consts
-const PLUGIN_NAME = 'gulp-appendSrcToVariable';
-
-var appendSrcToVariable = function appendSrcToVariable(varName, namingCallback, output, moduleType) {
-
-    var content;
-    var firstFile;
-
-    namingCallback = namingCallback || function (filename) { return filename; };
-
-    function bufferContents(file, enc, cb) {
-        // ignore empty files
-        if (file.isNull()) {
-            cb();
-            return;
-        }
-
-        // no stream support, only files.
-        if (file.isStream()) {
-            this.emit('error', new PluginError('gulp-concat', 'Streaming not supported'));
-            cb();
-            return;
-        }
-
-        // construct concat instance
-        if (!content) {
-            content = "";
-        }
-
-        // set first file if not already set
-        if (!firstFile) {
-            if (moduleType === "es6") {
-                content += `
-// import * as BABYLON from 'babylonjs/core/es6';
-`;
-            }
-            firstFile = file;
-        }
-
-
-        var name = namingCallback(file.relative);
-        if (moduleType) {
-            let vars = varName.split(".");
-            // shader support when using modules
-            if (moduleType === "es6") {
-                content += `
-let ${name} = ${JSON.stringify(file.contents.toString())};
-// ${varName}["${name}"] = ${varName}["${name}"] || ${name};
-export { ${name}  };
-`;
-            } else {
-                // commonjs
-                content += `
-if(typeof require !== 'undefined'){
-var BABYLON = require("babylonjs/core");
-let data = ${JSON.stringify(file.contents.toString())};
-${varName}["${name}"] = ${varName}["${name}"] || data;
-module.exports = module.exports || {};
-module.exports["${name}"] = data;
-}
-`;
-            }
-        } else {
-            content += varName + "['" + name + "'] = " + JSON.stringify(file.contents.toString()) + ";\r\n";
-        }
-        cb();
-    }
-
-    function endStream(cb) {
-        if (!firstFile || !content) {
-            cb();
-            return;
-        }
-
-        var pathObject = path.parse(firstFile.path);
-        var joinedPath = path.join(pathObject.dir, output);
-
-        var joinedFile = new File({
-            cwd: firstFile.cwd,
-            base: firstFile.base,
-            path: joinedPath,
-            contents: Buffer.from(content)
-        });
-
-        this.push(joinedFile);
-
-        cb();
-    }
-
-    return through.obj(bufferContents, endStream);
-}
-
-module.exports = appendSrcToVariable;

+ 0 - 34
Tools/Gulp/tasks/gulpTasks-watch.js

@@ -24,8 +24,6 @@ gulp.task("srcTscWatch", function() {
  * Watch ts files and fire repective tasks.
  */
 gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
-    var interval = 1000;
-
     var tasks = [];
 
     config.modules.map(function(module) {
@@ -41,38 +39,6 @@ gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
             //config.stats = "minimal";
             tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
         }
-        else {
-            // Soon To Be Gone
-            config[module].libraries.map(function(library) {
-                if (library.webpack) {
-                    if (library.noWatch) return;
-                    var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
-                    let wpconfig = require("../" + library.webpack);
-                    wpconfig.watch = true;
-                    // dev mode and absolute path sourcemaps for debugging
-                    wpconfig.mode = "development";
-                    wpconfig.output.devtoolModuleFilenameTemplate = "[absolute-resource-path]";
-                    //config.stats = "minimal";
-                    tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
-                } else {
-                    tasks.push(gulp.watch(library.files, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug());
-                    }));
-                    tasks.push(gulp.watch(library.shaderFiles, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug())
-                    }));
-                    tasks.push(gulp.watch(library.sassFiles, { interval: interval }, function() {
-                        console.log(library.output);
-                        return buildExternalLibrary(library, config[module], true)
-                            .pipe(debug())
-                    }));
-                }
-            });
-        }
     });
 
     console.log(tasks.length);

+ 242 - 242
dist/preview release/babylon.d.ts

@@ -5916,52 +5916,6 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
-     * Interface used to define a behavior
-     */
-    interface Behavior<T> {
-        /** gets or sets behavior's name */
-        name: string;
-        /**
-         * Function called when the behavior needs to be initialized (after attaching it to a target)
-         */
-        init(): void;
-        /**
-         * Called when the behavior is attached to a target
-         * @param target defines the target where the behavior is attached to
-         */
-        attach(target: T): void;
-        /**
-         * Called when the behavior is detached from its target
-         */
-        detach(): void;
-    }
-    /**
-     * Interface implemented by classes supporting behaviors
-     */
-    interface IBehaviorAware<T> {
-        /**
-         * Attach a behavior
-         * @param behavior defines the behavior to attach
-         * @returns the current host
-         */
-        addBehavior(behavior: Behavior<T>): T;
-        /**
-         * Remove a behavior from the current object
-         * @param behavior defines the behavior to detach
-         * @returns the current host
-         */
-        removeBehavior(behavior: Behavior<T>): T;
-        /**
-         * Gets a behavior using its name to search
-         * @param name defines the name to search
-         * @returns the behavior or null if not found
-         */
-        getBehaviorByName(name: string): Nullable<Behavior<T>>;
-    }
-}
-
-declare module BABYLON {
-    /**
      * Class used to store bone information
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons
      */
@@ -6719,6 +6673,52 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
+     * Interface used to define a behavior
+     */
+    interface Behavior<T> {
+        /** gets or sets behavior's name */
+        name: string;
+        /**
+         * Function called when the behavior needs to be initialized (after attaching it to a target)
+         */
+        init(): void;
+        /**
+         * Called when the behavior is attached to a target
+         * @param target defines the target where the behavior is attached to
+         */
+        attach(target: T): void;
+        /**
+         * Called when the behavior is detached from its target
+         */
+        detach(): void;
+    }
+    /**
+     * Interface implemented by classes supporting behaviors
+     */
+    interface IBehaviorAware<T> {
+        /**
+         * Attach a behavior
+         * @param behavior defines the behavior to attach
+         * @returns the current host
+         */
+        addBehavior(behavior: Behavior<T>): T;
+        /**
+         * Remove a behavior from the current object
+         * @param behavior defines the behavior to detach
+         * @returns the current host
+         */
+        removeBehavior(behavior: Behavior<T>): T;
+        /**
+         * Gets a behavior using its name to search
+         * @param name defines the name to search
+         * @returns the behavior or null if not found
+         */
+        getBehaviorByName(name: string): Nullable<Behavior<T>>;
+    }
+}
+
+declare module BABYLON {
+    /**
      * This represents an orbital type of camera.
      *
      * This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events.
@@ -24062,6 +24062,202 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
+     * Defines a target to use with MorphTargetManager
+     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
+     */
+    class MorphTarget implements IAnimatable {
+        /** defines the name of the target */
+        name: string;
+        /**
+         * Gets or sets the list of animations
+         */
+        animations: Animation[];
+        private _scene;
+        private _positions;
+        private _normals;
+        private _tangents;
+        private _influence;
+        /**
+         * Observable raised when the influence changes
+         */
+        onInfluenceChanged: Observable<boolean>;
+        /** @hidden */
+        _onDataLayoutChanged: Observable<void>;
+        /**
+         * Gets or sets the influence of this target (ie. its weight in the overall morphing)
+         */
+        influence: number;
+        private _animationPropertiesOverride;
+        /**
+         * Gets or sets the animation properties override
+         */
+        animationPropertiesOverride: Nullable<AnimationPropertiesOverride>;
+        /**
+         * Creates a new MorphTarget
+         * @param name defines the name of the target
+         * @param influence defines the influence to use
+         */
+        constructor(
+        /** defines the name of the target */
+        name: string, influence?: number, scene?: Nullable<Scene>);
+        /**
+         * Gets a boolean defining if the target contains position data
+         */
+        readonly hasPositions: boolean;
+        /**
+         * Gets a boolean defining if the target contains normal data
+         */
+        readonly hasNormals: boolean;
+        /**
+         * Gets a boolean defining if the target contains tangent data
+         */
+        readonly hasTangents: boolean;
+        /**
+         * Affects position data to this target
+         * @param data defines the position data to use
+         */
+        setPositions(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the position data stored in this target
+         * @returns a FloatArray containing the position data (or null if not present)
+         */
+        getPositions(): Nullable<FloatArray>;
+        /**
+         * Affects normal data to this target
+         * @param data defines the normal data to use
+         */
+        setNormals(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the normal data stored in this target
+         * @returns a FloatArray containing the normal data (or null if not present)
+         */
+        getNormals(): Nullable<FloatArray>;
+        /**
+         * Affects tangent data to this target
+         * @param data defines the tangent data to use
+         */
+        setTangents(data: Nullable<FloatArray>): void;
+        /**
+         * Gets the tangent data stored in this target
+         * @returns a FloatArray containing the tangent data (or null if not present)
+         */
+        getTangents(): Nullable<FloatArray>;
+        /**
+         * Serializes the current target into a Serialization object
+         * @returns the serialized object
+         */
+        serialize(): any;
+        /**
+         * Creates a new target from serialized data
+         * @param serializationObject defines the serialized data to use
+         * @returns a new MorphTarget
+         */
+        static Parse(serializationObject: any): MorphTarget;
+        /**
+         * Creates a MorphTarget from mesh data
+         * @param mesh defines the source mesh
+         * @param name defines the name to use for the new target
+         * @param influence defines the influence to attach to the target
+         * @returns a new MorphTarget
+         */
+        static FromMesh(mesh: AbstractMesh, name?: string, influence?: number): MorphTarget;
+    }
+}
+
+declare module BABYLON {
+    /**
+     * This class is used to deform meshes using morphing between different targets
+     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
+     */
+    class MorphTargetManager {
+        private _targets;
+        private _targetInfluenceChangedObservers;
+        private _targetDataLayoutChangedObservers;
+        private _activeTargets;
+        private _scene;
+        private _influences;
+        private _supportsNormals;
+        private _supportsTangents;
+        private _vertexCount;
+        private _uniqueId;
+        private _tempInfluences;
+        /**
+         * Creates a new MorphTargetManager
+         * @param scene defines the current scene
+         */
+        constructor(scene?: Nullable<Scene>);
+        /**
+         * Gets the unique ID of this manager
+         */
+        readonly uniqueId: number;
+        /**
+         * Gets the number of vertices handled by this manager
+         */
+        readonly vertexCount: number;
+        /**
+         * Gets a boolean indicating if this manager supports morphing of normals
+         */
+        readonly supportsNormals: boolean;
+        /**
+         * Gets a boolean indicating if this manager supports morphing of tangents
+         */
+        readonly supportsTangents: boolean;
+        /**
+         * Gets the number of targets stored in this manager
+         */
+        readonly numTargets: number;
+        /**
+         * Gets the number of influencers (ie. the number of targets with influences > 0)
+         */
+        readonly numInfluencers: number;
+        /**
+         * Gets the list of influences (one per target)
+         */
+        readonly influences: Float32Array;
+        /**
+         * Gets the active target at specified index. An active target is a target with an influence > 0
+         * @param index defines the index to check
+         * @returns the requested target
+         */
+        getActiveTarget(index: number): MorphTarget;
+        /**
+         * Gets the target at specified index
+         * @param index defines the index to check
+         * @returns the requested target
+         */
+        getTarget(index: number): MorphTarget;
+        /**
+         * Add a new target to this manager
+         * @param target defines the target to add
+         */
+        addTarget(target: MorphTarget): void;
+        /**
+         * Removes a target from the manager
+         * @param target defines the target to remove
+         */
+        removeTarget(target: MorphTarget): void;
+        /**
+         * Serializes the current manager into a Serialization object
+         * @returns the serialized object
+         */
+        serialize(): any;
+        private _syncActiveTargets;
+        /**
+         * Syncrhonize the targets with all the meshes using this morph target manager
+         */
+        synchronize(): void;
+        /**
+         * Creates a new MorphTargetManager from serialized data
+         * @param serializationObject defines the serialized data
+         * @param scene defines the hosting scene
+         * @returns the new MorphTargetManager
+         */
+        static Parse(serializationObject: any, scene: Scene): MorphTargetManager;
+    }
+}
+
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -29689,202 +29885,6 @@ declare module BABYLON {
 
 declare module BABYLON {
     /**
-     * Defines a target to use with MorphTargetManager
-     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
-     */
-    class MorphTarget implements IAnimatable {
-        /** defines the name of the target */
-        name: string;
-        /**
-         * Gets or sets the list of animations
-         */
-        animations: Animation[];
-        private _scene;
-        private _positions;
-        private _normals;
-        private _tangents;
-        private _influence;
-        /**
-         * Observable raised when the influence changes
-         */
-        onInfluenceChanged: Observable<boolean>;
-        /** @hidden */
-        _onDataLayoutChanged: Observable<void>;
-        /**
-         * Gets or sets the influence of this target (ie. its weight in the overall morphing)
-         */
-        influence: number;
-        private _animationPropertiesOverride;
-        /**
-         * Gets or sets the animation properties override
-         */
-        animationPropertiesOverride: Nullable<AnimationPropertiesOverride>;
-        /**
-         * Creates a new MorphTarget
-         * @param name defines the name of the target
-         * @param influence defines the influence to use
-         */
-        constructor(
-        /** defines the name of the target */
-        name: string, influence?: number, scene?: Nullable<Scene>);
-        /**
-         * Gets a boolean defining if the target contains position data
-         */
-        readonly hasPositions: boolean;
-        /**
-         * Gets a boolean defining if the target contains normal data
-         */
-        readonly hasNormals: boolean;
-        /**
-         * Gets a boolean defining if the target contains tangent data
-         */
-        readonly hasTangents: boolean;
-        /**
-         * Affects position data to this target
-         * @param data defines the position data to use
-         */
-        setPositions(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the position data stored in this target
-         * @returns a FloatArray containing the position data (or null if not present)
-         */
-        getPositions(): Nullable<FloatArray>;
-        /**
-         * Affects normal data to this target
-         * @param data defines the normal data to use
-         */
-        setNormals(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the normal data stored in this target
-         * @returns a FloatArray containing the normal data (or null if not present)
-         */
-        getNormals(): Nullable<FloatArray>;
-        /**
-         * Affects tangent data to this target
-         * @param data defines the tangent data to use
-         */
-        setTangents(data: Nullable<FloatArray>): void;
-        /**
-         * Gets the tangent data stored in this target
-         * @returns a FloatArray containing the tangent data (or null if not present)
-         */
-        getTangents(): Nullable<FloatArray>;
-        /**
-         * Serializes the current target into a Serialization object
-         * @returns the serialized object
-         */
-        serialize(): any;
-        /**
-         * Creates a new target from serialized data
-         * @param serializationObject defines the serialized data to use
-         * @returns a new MorphTarget
-         */
-        static Parse(serializationObject: any): MorphTarget;
-        /**
-         * Creates a MorphTarget from mesh data
-         * @param mesh defines the source mesh
-         * @param name defines the name to use for the new target
-         * @param influence defines the influence to attach to the target
-         * @returns a new MorphTarget
-         */
-        static FromMesh(mesh: AbstractMesh, name?: string, influence?: number): MorphTarget;
-    }
-}
-
-declare module BABYLON {
-    /**
-     * This class is used to deform meshes using morphing between different targets
-     * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
-     */
-    class MorphTargetManager {
-        private _targets;
-        private _targetInfluenceChangedObservers;
-        private _targetDataLayoutChangedObservers;
-        private _activeTargets;
-        private _scene;
-        private _influences;
-        private _supportsNormals;
-        private _supportsTangents;
-        private _vertexCount;
-        private _uniqueId;
-        private _tempInfluences;
-        /**
-         * Creates a new MorphTargetManager
-         * @param scene defines the current scene
-         */
-        constructor(scene?: Nullable<Scene>);
-        /**
-         * Gets the unique ID of this manager
-         */
-        readonly uniqueId: number;
-        /**
-         * Gets the number of vertices handled by this manager
-         */
-        readonly vertexCount: number;
-        /**
-         * Gets a boolean indicating if this manager supports morphing of normals
-         */
-        readonly supportsNormals: boolean;
-        /**
-         * Gets a boolean indicating if this manager supports morphing of tangents
-         */
-        readonly supportsTangents: boolean;
-        /**
-         * Gets the number of targets stored in this manager
-         */
-        readonly numTargets: number;
-        /**
-         * Gets the number of influencers (ie. the number of targets with influences > 0)
-         */
-        readonly numInfluencers: number;
-        /**
-         * Gets the list of influences (one per target)
-         */
-        readonly influences: Float32Array;
-        /**
-         * Gets the active target at specified index. An active target is a target with an influence > 0
-         * @param index defines the index to check
-         * @returns the requested target
-         */
-        getActiveTarget(index: number): MorphTarget;
-        /**
-         * Gets the target at specified index
-         * @param index defines the index to check
-         * @returns the requested target
-         */
-        getTarget(index: number): MorphTarget;
-        /**
-         * Add a new target to this manager
-         * @param target defines the target to add
-         */
-        addTarget(target: MorphTarget): void;
-        /**
-         * Removes a target from the manager
-         * @param target defines the target to remove
-         */
-        removeTarget(target: MorphTarget): void;
-        /**
-         * Serializes the current manager into a Serialization object
-         * @returns the serialized object
-         */
-        serialize(): any;
-        private _syncActiveTargets;
-        /**
-         * Syncrhonize the targets with all the meshes using this morph target manager
-         */
-        synchronize(): void;
-        /**
-         * Creates a new MorphTargetManager from serialized data
-         * @param serializationObject defines the serialized data
-         * @param scene defines the hosting scene
-         * @returns the new MorphTargetManager
-         */
-        static Parse(serializationObject: any, scene: Scene): MorphTargetManager;
-    }
-}
-
-declare module BABYLON {
-    /**
      * Class used to enable access to IndexedDB
      * @see http://doc.babylonjs.com/how_to/caching_resources_in_indexeddb
      */