Browse Source

MaterialExporter: Don't export vertexColors: 0.
Hesitant whether this should be done for everything (only export what isn't default).

Mr.doob 12 years ago
parent
commit
7a55265666
1 changed files with 3 additions and 3 deletions
  1. 3 3
      examples/js/exporters/MaterialExporter.js

+ 3 - 3
examples/js/exporters/MaterialExporter.js

@@ -26,7 +26,7 @@ THREE.MaterialExporter.prototype = {
 
 			output.type = 'MeshBasicMaterial';
 			output.color = material.color.getHex();
-			output.vertexColors = material.vertexColors;
+			if ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;
 			output.opacity = material.opacity;
 			output.transparent = material.transparent;
 			output.wireframe = material.wireframe;
@@ -37,7 +37,7 @@ THREE.MaterialExporter.prototype = {
 			output.color = material.color.getHex();
 			output.ambient = material.ambient.getHex();
 			output.emissive = material.emissive.getHex();
-			output.vertexColors = material.vertexColors;
+			if ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;
 			output.opacity = material.opacity;
 			output.transparent = material.transparent;
 			output.wireframe = material.wireframe;
@@ -50,7 +50,7 @@ THREE.MaterialExporter.prototype = {
 			output.emissive = material.emissive.getHex();
 			output.specular = material.specular.getHex();
 			output.shininess = material.shininess;
-			output.vertexColors = material.vertexColors;
+			if ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;
 			output.opacity = material.opacity;
 			output.transparent = material.transparent;
 			output.wireframe = material.wireframe;