Jelajahi Sumber

Fixed d.ts generation

David Catuhe 9 tahun lalu
induk
melakukan
239ad84a07

+ 1 - 1
Tools/Gulp/gulp-addDtsExport.js

@@ -5,7 +5,7 @@ module.exports = function (varName) {
     return through.obj(function (file, enc, cb) {
 
         var moduleExportsAddition =
-            '\nexport as namespace ' + varName + ';\n' +
+ //           '\nexport as namespace ' + varName + ';\n' +
             '\nexport = ' + varName + ';\n';
 
         if (file.isNull()) {

+ 0 - 2
dist/preview release/babylon.d.ts

@@ -15261,6 +15261,4 @@ declare module BABYLON {
     }
 }
 
-export as namespace BABYLON;
-
 export = BABYLON;

+ 5 - 7
loaders/OBJ/babylon.objFileLoader.js

@@ -1,4 +1,4 @@
-
+/// <reference path="../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
     /**
@@ -210,7 +210,7 @@ var BABYLON;
             //The complete path to the mtl file
             var pathOfFile = BABYLON.Tools.BaseUrl + rootUrl + url;
             // Loads through the babylon tools to allow fileInput search.
-            BABYLON.Tools.LoadFile(pathOfFile, onSuccess, null, null, false, function () { console.warn("Error - Unable to load " + pathOfFile); }, true /* synchronous call */);
+            BABYLON.Tools.LoadFile(pathOfFile, onSuccess, null, null, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
         };
         OBJFileLoader.prototype.importMesh = function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) {
             //get the meshes from OBJ file
@@ -354,13 +354,12 @@ var BABYLON;
                     unwrappedNormalsForBabylon.push(wrappedNormalsForBabylon[l].x, wrappedNormalsForBabylon[l].y, wrappedNormalsForBabylon[l].z);
                     unwrappedUVForBabylon.push(wrappedUvsForBabylon[l].x, wrappedUvsForBabylon[l].y); //z is an optional value not supported by BABYLON
                 }
-				// Reset arrays for the next new meshes
+                // Reset arrays for the next new meshes
                 wrappedPositionForBabylon = [];
                 wrappedNormalsForBabylon = [];
                 wrappedUvsForBabylon = [];
                 tuplePosNorm = [];
                 curPositionInIndices = 0;
-                
             };
             /**
              * Create triangles from polygons by recursion
@@ -505,7 +504,7 @@ var BABYLON;
                     indicesForBabylon = [];
                     unwrappedPositionsForBabylon = [];
                     unwrappedNormalsForBabylon = [];
-                    unwrappedUVForBabylon = [];  
+                    unwrappedUVForBabylon = [];
                 }
             };
             //Main function
@@ -685,9 +684,8 @@ var BABYLON;
                 //Push the name of the material to an array
                 //This is indispensable for the importMesh function
                 materialToUse.push(meshesFromObj[j].materialName);
-                //Set the data for the babylonMesh
-                
                 var vertexData = new BABYLON.VertexData(); //The container for the values
+                //Set the data for the babylonMesh
                 vertexData.positions = handledMesh.positions;
                 vertexData.normals = handledMesh.normals;
                 vertexData.uvs = handledMesh.uvs;

+ 1 - 2
loaders/OBJ/babylon.objFileLoader.ts

@@ -234,8 +234,7 @@ module BABYLON {
                 null, 
                 null, 
                 false, 
-                () => { console.warn("Error - Unable to load " + pathOfFile); }, 
-                true /* synchronous call */);
+                () => { console.warn("Error - Unable to load " + pathOfFile); });
         }
 
         public importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean {