Bläddra i källkod

MaterialLoader: Check if vertexColors is defined.

Mr.doob 12 år sedan
förälder
incheckning
0f6b0e6fee
1 ändrade filer med 2 tillägg och 3 borttagningar
  1. 2 3
      src/loaders/MaterialLoader.js

+ 2 - 3
src/loaders/MaterialLoader.js

@@ -43,7 +43,6 @@ THREE.MaterialLoader.prototype = {
 				material = new THREE.MeshBasicMaterial( {
 
 					color: json.color,
-					vertexColors: json.vertexColors,
 					opacity: json.opacity,
 					transparent: json.transparent,
 					wireframe: json.wireframe
@@ -59,7 +58,6 @@ THREE.MaterialLoader.prototype = {
 					color: json.color,
 					ambient: json.ambient,
 					emissive: json.emissive,
-					vertexColors: json.vertexColors,
 					opacity: json.opacity,
 					transparent: json.transparent,
 					wireframe: json.wireframe
@@ -77,7 +75,6 @@ THREE.MaterialLoader.prototype = {
 					emissive: json.emissive,
 					specular: json.specular,
 					shininess: json.shininess,
-					vertexColors: json.vertexColors,
 					opacity: json.opacity,
 					transparent: json.transparent,
 					wireframe: json.wireframe
@@ -112,6 +109,8 @@ THREE.MaterialLoader.prototype = {
 
 		}
 
+		if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors;
+
 		return material;
 
 	}