sevan 8 年之前
父节点
当前提交
c32bb607b3

二进制
Exporters/Blender/Blender2Babylon-5.1.zip


+ 1 - 1
Exporters/Blender/src/__init__.py

@@ -1,7 +1,7 @@
 bl_info = {
 bl_info = {
     'name': 'Babylon.js',
     'name': 'Babylon.js',
     'author': 'David Catuhe, Jeff Palmer',
     'author': 'David Catuhe, Jeff Palmer',
-    'version': (5, 1, 1),
+    'version': (5, 1, 2),
     'blender': (2, 76, 0),
     'blender': (2, 76, 0),
     'location': 'File > Export > Babylon.js (.babylon)',
     'location': 'File > Export > Babylon.js (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',

Exporters/Blender/src/animation.py → Exporters/Blender/src/babylon-js/animation.py


Exporters/Blender/src/armature.py → Exporters/Blender/src/babylon-js/armature.py


Exporters/Blender/src/camera.py → Exporters/Blender/src/babylon-js/camera.py


Exporters/Blender/src/exporter_settings_panel.py → Exporters/Blender/src/babylon-js/exporter_settings_panel.py


Exporters/Blender/src/f_curve_animatable.py → Exporters/Blender/src/babylon-js/f_curve_animatable.py


Exporters/Blender/src/json_exporter.py → Exporters/Blender/src/babylon-js/json_exporter.py


Exporters/Blender/src/light_shadow.py → Exporters/Blender/src/babylon-js/light_shadow.py


Exporters/Blender/src/logger.py → Exporters/Blender/src/babylon-js/logger.py


+ 1 - 1
Exporters/Blender/src/material.py

@@ -395,7 +395,7 @@ class StdMaterial(Material):
 
 
             if mtex.use_map_normal:
             if mtex.use_map_normal:
                 Logger.log('Bump texture found "' + mtex.name + '"', 3)
                 Logger.log('Bump texture found "' + mtex.name + '"', 3)
-                self.textures.append(Texture('bumpTexture', 1.0 / mtex.normal_factor, mtex, mesh, exporter))
+                self.textures.append(Texture('bumpTexture', mtex.normal_factor, mtex, mesh, exporter))
 
 
             if mtex.use_map_color_spec:
             if mtex.use_map_color_spec:
                 Logger.log('Specular texture found "' + mtex.name + '"', 3)
                 Logger.log('Specular texture found "' + mtex.name + '"', 3)

Exporters/Blender/src/mesh.py → Exporters/Blender/src/babylon-js/mesh.py


Exporters/Blender/src/package_level.py → Exporters/Blender/src/babylon-js/package_level.py


Exporters/Blender/src/sound.py → Exporters/Blender/src/babylon-js/sound.py


Exporters/Blender/src/world.py → Exporters/Blender/src/babylon-js/world.py


+ 10 - 0
Exporters/Blender/zip_media.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="zipper">
+	<property name="version" value="5.1"/>
+	
+	<!-- this target assumes it is run from Babylon.js/Exporters/Blender directory.  -->
+    <target name="make-zip">
+    	<zip destfile="Blender2Babylon-${version}.zip" basedir="src" level="9"></zip>
+    </target>
+
+</project>

文件差异内容过多而无法显示
+ 11 - 11
dist/preview release/babylon.core.js


文件差异内容过多而无法显示
+ 5826 - 5824
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 24 - 24
dist/preview release/babylon.js


+ 103 - 2
dist/preview release/babylon.max.js

@@ -22387,6 +22387,7 @@ var BABYLON;
         MeshBuilder.CreateBox = function (name, options, scene) {
         MeshBuilder.CreateBox = function (name, options, scene) {
             var box = new BABYLON.Mesh(name, scene);
             var box = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            box.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateBox(options);
             var vertexData = BABYLON.VertexData.CreateBox(options);
             vertexData.applyToMesh(box, options.updatable);
             vertexData.applyToMesh(box, options.updatable);
             return box;
             return box;
@@ -22406,6 +22407,7 @@ var BABYLON;
         MeshBuilder.CreateSphere = function (name, options, scene) {
         MeshBuilder.CreateSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
             var sphere = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            sphere.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateSphere(options);
             var vertexData = BABYLON.VertexData.CreateSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
             return sphere;
@@ -22423,6 +22425,7 @@ var BABYLON;
         MeshBuilder.CreateDisc = function (name, options, scene) {
         MeshBuilder.CreateDisc = function (name, options, scene) {
             var disc = new BABYLON.Mesh(name, scene);
             var disc = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            disc.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateDisc(options);
             var vertexData = BABYLON.VertexData.CreateDisc(options);
             vertexData.applyToMesh(disc, options.updatable);
             vertexData.applyToMesh(disc, options.updatable);
             return disc;
             return disc;
@@ -22441,6 +22444,7 @@ var BABYLON;
         MeshBuilder.CreateIcoSphere = function (name, options, scene) {
         MeshBuilder.CreateIcoSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
             var sphere = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            sphere.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateIcoSphere(options);
             var vertexData = BABYLON.VertexData.CreateIcoSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
             return sphere;
@@ -22590,6 +22594,7 @@ var BABYLON;
         MeshBuilder.CreateCylinder = function (name, options, scene) {
         MeshBuilder.CreateCylinder = function (name, options, scene) {
             var cylinder = new BABYLON.Mesh(name, scene);
             var cylinder = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            cylinder.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateCylinder(options);
             var vertexData = BABYLON.VertexData.CreateCylinder(options);
             vertexData.applyToMesh(cylinder, options.updatable);
             vertexData.applyToMesh(cylinder, options.updatable);
             return cylinder;
             return cylinder;
@@ -22607,6 +22612,7 @@ var BABYLON;
         MeshBuilder.CreateTorus = function (name, options, scene) {
         MeshBuilder.CreateTorus = function (name, options, scene) {
             var torus = new BABYLON.Mesh(name, scene);
             var torus = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            torus.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateTorus(options);
             var vertexData = BABYLON.VertexData.CreateTorus(options);
             vertexData.applyToMesh(torus, options.updatable);
             vertexData.applyToMesh(torus, options.updatable);
             return torus;
             return torus;
@@ -22625,6 +22631,7 @@ var BABYLON;
         MeshBuilder.CreateTorusKnot = function (name, options, scene) {
         MeshBuilder.CreateTorusKnot = function (name, options, scene) {
             var torusKnot = new BABYLON.Mesh(name, scene);
             var torusKnot = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            torusKnot.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
             var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
             vertexData.applyToMesh(torusKnot, options.updatable);
             vertexData.applyToMesh(torusKnot, options.updatable);
             return torusKnot;
             return torusKnot;
@@ -22900,6 +22907,7 @@ var BABYLON;
         MeshBuilder.CreatePlane = function (name, options, scene) {
         MeshBuilder.CreatePlane = function (name, options, scene) {
             var plane = new BABYLON.Mesh(name, scene);
             var plane = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            plane.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreatePlane(options);
             var vertexData = BABYLON.VertexData.CreatePlane(options);
             vertexData.applyToMesh(plane, options.updatable);
             vertexData.applyToMesh(plane, options.updatable);
             if (options.sourcePlane) {
             if (options.sourcePlane) {
@@ -23152,6 +23160,7 @@ var BABYLON;
         MeshBuilder.CreatePolyhedron = function (name, options, scene) {
         MeshBuilder.CreatePolyhedron = function (name, options, scene) {
             var polyhedron = new BABYLON.Mesh(name, scene);
             var polyhedron = new BABYLON.Mesh(name, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
+            polyhedron.sideOrientation = options.sideOrientation;
             var vertexData = BABYLON.VertexData.CreatePolyhedron(options);
             var vertexData = BABYLON.VertexData.CreatePolyhedron(options);
             vertexData.applyToMesh(polyhedron, options.updatable);
             vertexData.applyToMesh(polyhedron, options.updatable);
             return polyhedron;
             return polyhedron;
@@ -25246,10 +25255,10 @@ var BABYLON;
             return this._compilationError;
             return this._compilationError;
         };
         };
         Effect.prototype.getVertexShaderSource = function () {
         Effect.prototype.getVertexShaderSource = function () {
-            return this._engine.getVertexShaderSource(this._program);
+            return this._evaluateDefinesOnString(this._engine.getVertexShaderSource(this._program));
         };
         };
         Effect.prototype.getFragmentShaderSource = function () {
         Effect.prototype.getFragmentShaderSource = function () {
-            return this._engine.getFragmentShaderSource(this._program);
+            return this._evaluateDefinesOnString(this._engine.getFragmentShaderSource(this._program));
         };
         };
         // Methods
         // Methods
         Effect.prototype._loadVertexShader = function (vertex, callback) {
         Effect.prototype._loadVertexShader = function (vertex, callback) {
@@ -25691,6 +25700,98 @@ var BABYLON;
             }
             }
             return this;
             return this;
         };
         };
+        Effect.prototype._recombineShader = function (node) {
+            if (node.define) {
+                if (node.condition) {
+                }
+                else if (node.ndef) {
+                    if (this.defines.indexOf("#define " + node.define) !== -1) {
+                        return null;
+                    }
+                }
+                else if (this.defines.indexOf("#define " + node.define) === -1) {
+                    return null;
+                }
+            }
+            var result = "";
+            for (var index = 0; index < node.children.length; index++) {
+                var line = node.children[index];
+                if (line.children) {
+                    var combined = this._recombineShader(line) + "\r\n";
+                    if (combined !== null) {
+                        result += combined + "\r\n";
+                    }
+                    continue;
+                }
+                result += line + "\r\n";
+            }
+            return result;
+        };
+        Effect.prototype._evaluateDefinesOnString = function (shaderString) {
+            var root = {
+                children: []
+            };
+            var currentNode = root;
+            var lines = shaderString.split("\n");
+            for (var index = 0; index < lines.length; index++) {
+                var line = lines[index].trim();
+                // #ifdef
+                var pos = line.indexOf("#ifdef ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 7);
+                    var newNode = {
+                        condition: null,
+                        ndef: false,
+                        define: define,
+                        children: [],
+                        parent: currentNode
+                    };
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+                // #ifndef
+                var pos = line.indexOf("#ifndef ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 8);
+                    newNode = {
+                        condition: null,
+                        define: define,
+                        ndef: true,
+                        children: [],
+                        parent: currentNode
+                    };
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+                // #if
+                var pos = line.indexOf("#if ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 4).trim();
+                    var conditionPos = define.indexOf(" ");
+                    newNode = {
+                        condition: define.substr(conditionPos + 1),
+                        define: define.substr(0, conditionPos),
+                        ndef: false,
+                        children: [],
+                        parent: currentNode
+                    };
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+                // #endif
+                pos = line.indexOf("#endif");
+                if (pos !== -1) {
+                    currentNode = currentNode.parent;
+                    continue;
+                }
+                currentNode.children.push(line);
+            }
+            // Recombine
+            return this._recombineShader(root);
+        };
         // Statics
         // Statics
         Effect.ShadersStore = {};
         Effect.ShadersStore = {};
         Effect.IncludesShadersStore = {};
         Effect.IncludesShadersStore = {};

文件差异内容过多而无法显示
+ 24 - 24
dist/preview release/babylon.noworker.js


+ 1 - 1
src/Materials/Textures/babylon.hdrCubeTexture.ts

@@ -452,7 +452,7 @@ module BABYLON {
          * @param onError Method called if any error happens during download.
          * @param onError Method called if any error happens during download.
          * @return The packed binary data.
          * @return The packed binary data.
          */
          */
-        public static generateBabylonHDR(url: string, size: number, callback: ((ArrayBuffer) => void), onError: (() => void) = null): void {
+        public static generateBabylonHDR(url: string, size: number, callback: ((ArrayBuffer: ArrayBuffer) => void), onError: (() => void) = null): void {
             // Needs the url tho create the texture.
             // Needs the url tho create the texture.
             if (!url) {
             if (!url) {
                 return null;
                 return null;

+ 1 - 1
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -20,7 +20,7 @@
         * Use this predicate to dynamically define the list of mesh you want to render.
         * Use this predicate to dynamically define the list of mesh you want to render.
         * If set, the renderList property will be overwritten.
         * If set, the renderList property will be overwritten.
         */
         */
-        public renderListPredicate: (AbstractMesh) => boolean;
+        public renderListPredicate: (AbstractMesh: AbstractMesh) => boolean;
 
 
         /**
         /**
         * Use this list to define the list of mesh you want to render.
         * Use this list to define the list of mesh you want to render.

+ 116 - 2
src/Materials/babylon.effect.ts

@@ -169,11 +169,11 @@
         }
         }
 
 
         public getVertexShaderSource(): string {
         public getVertexShaderSource(): string {
-            return this._engine.getVertexShaderSource(this._program);
+            return this._evaluateDefinesOnString(this._engine.getVertexShaderSource(this._program));
         }
         }
 
 
         public getFragmentShaderSource(): string {
         public getFragmentShaderSource(): string {
-            return this._engine.getFragmentShaderSource(this._program);
+            return this._evaluateDefinesOnString(this._engine.getFragmentShaderSource(this._program));
         }
         }
 
 
         // Methods
         // Methods
@@ -707,6 +707,120 @@
             return this;
             return this;
         }
         }
 
 
+        private _recombineShader(node: any): string {
+            if (node.define) {
+                if (node.condition) {
+                    // TODO
+                }
+                else if (node.ndef) {
+                    if (this.defines.indexOf("#define " + node.define) !== -1) {
+                        return null;
+                    }
+                }
+                else if (this.defines.indexOf("#define " + node.define) === -1) {
+                    return null;
+                }
+            }
+
+            var result = "";
+            for (var index = 0; index < node.children.length; index++) {
+                var line = node.children[index];
+
+                if (line.children) {
+                    var combined = this._recombineShader(line) + "\r\n";
+                    if (combined !== null) {
+                        result += combined + "\r\n";
+                    }
+
+                    continue;
+                }
+
+                result += line + "\r\n";
+            }
+
+            return result;
+        }
+
+        private _evaluateDefinesOnString(shaderString: string): string {
+            var root = <any>{
+                children: []
+            };
+            var currentNode = root;
+
+            var lines = shaderString.split("\n");
+
+            for (var index = 0; index < lines.length; index++) {
+                var line = lines[index].trim();
+
+                // #ifdef
+                var pos = line.indexOf("#ifdef ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 7);
+
+                    var newNode = {
+                        condition: null,
+                        ndef: false,
+                        define: define,
+                        children: [],
+                        parent: currentNode
+                    }
+                    
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+
+                // #ifndef
+                var pos = line.indexOf("#ifndef ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 8);
+
+                    newNode = {
+                        condition: null,
+                        define: define,
+                        ndef: true,
+                        children: [],
+                        parent: currentNode
+                    }
+                    
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+
+                // #if
+                var pos = line.indexOf("#if ");
+                if (pos !== -1) {
+                    var define = line.substr(pos + 4).trim();
+                    var conditionPos = define.indexOf(" ");
+
+                    newNode = {
+                        condition: define.substr(conditionPos + 1),
+                        define: define.substr(0, conditionPos),
+                        ndef: false,
+                        children: [],
+                        parent: currentNode
+                    }
+                    
+                    currentNode.children.push(newNode);
+                    currentNode = newNode;
+                    continue;
+                }
+
+                // #endif
+                pos = line.indexOf("#endif");
+                if (pos !== -1) {
+                    currentNode = currentNode.parent;
+                    continue;
+                }
+
+                currentNode.children.push(line);
+            }
+
+            // Recombine
+            return this._recombineShader(root);
+        }
+
         // Statics
         // Statics
         public static ShadersStore = {};
         public static ShadersStore = {};
         public static IncludesShadersStore = {};
         public static IncludesShadersStore = {};

+ 19 - 10
src/Mesh/babylon.meshBuilder.ts

@@ -27,7 +27,8 @@
             var box = new Mesh(name, scene);
             var box = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            box.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateBox(options);
             var vertexData = VertexData.CreateBox(options);
 
 
             vertexData.applyToMesh(box, options.updatable);
             vertexData.applyToMesh(box, options.updatable);
@@ -51,7 +52,8 @@
             var sphere = new Mesh(name, scene);
             var sphere = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            sphere.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateSphere(options);
             var vertexData = VertexData.CreateSphere(options);
 
 
             vertexData.applyToMesh(sphere, options.updatable);
             vertexData.applyToMesh(sphere, options.updatable);
@@ -73,7 +75,8 @@
             var disc = new Mesh(name, scene);
             var disc = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            disc.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateDisc(options);
             var vertexData = VertexData.CreateDisc(options);
 
 
             vertexData.applyToMesh(disc, options.updatable);
             vertexData.applyToMesh(disc, options.updatable);
@@ -96,7 +99,8 @@
             var sphere = new Mesh(name, scene);
             var sphere = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            sphere.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateIcoSphere(options);
             var vertexData = VertexData.CreateIcoSphere(options);
 
 
             vertexData.applyToMesh(sphere, options.updatable);
             vertexData.applyToMesh(sphere, options.updatable);
@@ -256,9 +260,10 @@
          */
          */
         public static CreateCylinder(name: string, options: { height?: number, diameterTop?: number, diameterBottom?: number, diameter?: number, tessellation?: number, subdivisions?: number, arc?: number, faceColors?: Color4[], faceUV?: Vector4[], updatable?: boolean, hasRings?: boolean, enclose?: boolean, sideOrientation?: number }, scene: any): Mesh {
         public static CreateCylinder(name: string, options: { height?: number, diameterTop?: number, diameterBottom?: number, diameter?: number, tessellation?: number, subdivisions?: number, arc?: number, faceColors?: Color4[], faceUV?: Vector4[], updatable?: boolean, hasRings?: boolean, enclose?: boolean, sideOrientation?: number }, scene: any): Mesh {
             var cylinder = new Mesh(name, scene);
             var cylinder = new Mesh(name, scene);
-
+            
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            cylinder.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateCylinder(options);
             var vertexData = VertexData.CreateCylinder(options);
 
 
             vertexData.applyToMesh(cylinder, options.updatable);
             vertexData.applyToMesh(cylinder, options.updatable);
@@ -280,7 +285,8 @@
             var torus = new Mesh(name, scene);
             var torus = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            torus.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateTorus(options);
             var vertexData = VertexData.CreateTorus(options);
 
 
             vertexData.applyToMesh(torus, options.updatable);
             vertexData.applyToMesh(torus, options.updatable);
@@ -303,7 +309,8 @@
             var torusKnot = new Mesh(name, scene);
             var torusKnot = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            torusKnot.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreateTorusKnot(options);
             var vertexData = VertexData.CreateTorusKnot(options);
 
 
             vertexData.applyToMesh(torusKnot, options.updatable);
             vertexData.applyToMesh(torusKnot, options.updatable);
@@ -594,7 +601,8 @@
             var plane = new Mesh(name, scene);
             var plane = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            plane.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreatePlane(options);
             var vertexData = VertexData.CreatePlane(options);
 
 
             vertexData.applyToMesh(plane, options.updatable);
             vertexData.applyToMesh(plane, options.updatable);
@@ -880,7 +888,8 @@
             var polyhedron = new Mesh(name, scene);
             var polyhedron = new Mesh(name, scene);
 
 
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
-
+            polyhedron.sideOrientation = options.sideOrientation;
+            
             var vertexData = VertexData.CreatePolyhedron(options);
             var vertexData = VertexData.CreatePolyhedron(options);
 
 
             vertexData.applyToMesh(polyhedron, options.updatable);
             vertexData.applyToMesh(polyhedron, options.updatable);

+ 3 - 3
src/Tools/babylon.tools.ts

@@ -188,7 +188,7 @@
             };
             };
         }
         }
 
 
-        public static Vector2ArrayFeeder(array: Array<Vector2> | Float32Array): (i) => Vector2 {
+        public static Vector2ArrayFeeder(array: Array<Vector2> | Float32Array): (i: number) => Vector2 {
             return (index: number) => {
             return (index: number) => {
                 let isFloatArray = ((<Float32Array>array).BYTES_PER_ELEMENT !== undefined);
                 let isFloatArray = ((<Float32Array>array).BYTES_PER_ELEMENT !== undefined);
                 let length = isFloatArray ? array.length / 2 : array.length;
                 let length = isFloatArray ? array.length / 2 : array.length;
@@ -1065,7 +1065,7 @@
             return name;
             return name;
         }
         }
 
 
-        public static first<T>(array: Array<T>, predicate: (item) => boolean) {
+        public static first<T>(array: Array<T>, predicate: (item: T) => boolean) {
             for (let el of array) {
             for (let el of array) {
                 if (predicate(el)) {
                 if (predicate(el)) {
                     return el;
                     return el;
@@ -1107,7 +1107,7 @@
          * This method can be used with hashCodeFromStream when your input is an array of values that are either: number, string, boolean or custom type implementing the getHashCode():number method.
          * This method can be used with hashCodeFromStream when your input is an array of values that are either: number, string, boolean or custom type implementing the getHashCode():number method.
          * @param array
          * @param array
          */
          */
-        public static arrayOrStringFeeder(array: any): (i) => number {
+        public static arrayOrStringFeeder(array: any): (i: number) => number {
             return (index: number) => {
             return (index: number) => {
                 if (index >= array.length) {
                 if (index >= array.length) {
                     return null;
                     return null;

+ 1 - 1
src/babylon.engine.ts

@@ -2584,7 +2584,7 @@
         }
         }
 
 
         public createRawCubeTexture(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
         public createRawCubeTexture(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
-            callback: (ArrayBuffer) => ArrayBufferView[],
+            callback: (ArrayBuffer: ArrayBuffer) => ArrayBufferView[],
             mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][])): WebGLTexture {
             mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][])): WebGLTexture {
             var gl = this._gl;
             var gl = this._gl;
             var texture = gl.createTexture();
             var texture = gl.createTexture();