2
0
Эх сурвалжийг харах

MaterialLoader: Check if vertexColors is defined.

Mr.doob 12 жил өмнө
parent
commit
0f6b0e6fee

+ 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;
 
 	}