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

Editor: Some work towards fixing #5982. Still not done, the first render doesn't show the new "groups".

Mr.doob 10 жил өмнө
parent
commit
0c5b9d0e6c

+ 15 - 3
editor/js/Sidebar.Material.js

@@ -369,7 +369,7 @@ Sidebar.Material = function ( editor ) {
 
 		var geometry = object.geometry;
 		var material = object.material;
-		
+
 		var textureWarning = false;
 		var objectHasUvs = false;
 
@@ -436,8 +436,20 @@ Sidebar.Material = function ( editor ) {
 
 			if ( material.vertexColors !== undefined ) {
 
-				material.vertexColors = parseInt( materialVertexColors.getValue() );
-				material.needsUpdate = true;
+				var vertexColors = parseInt( materialVertexColors.getValue() );
+
+				if ( material.vertexColors !== vertexColors ) {
+
+					if ( geometry instanceof THREE.Geometry ) {
+
+						geometry.groupsNeedUpdate = true;
+
+					}
+
+					material.vertexColors = vertexColors;
+					material.needsUpdate = true;
+
+				}
 
 			}