Jelajahi Sumber

Materials array Consistency fix
- Fixed bug where if no material was present, the resulting default material would not have appropriate vertexColors or skinning attributes applied.

Kyle-Larson 8 tahun lalu
induk
melakukan
b36e2ebcdf
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      examples/js/loaders/FBXLoader2.js

+ 6 - 1
examples/js/loaders/FBXLoader2.js

@@ -1210,11 +1210,16 @@
 								} else {
 
 									material = new THREE.MeshBasicMaterial( { color: 0x3300ff } );
+									materials.push( material );
 
 								}
 								if ( 'color' in geometry.attributes ) {
 
-									material.vertexColors = THREE.VertexColors;
+									for ( var materialIndex = 0, numMaterials = materials.length; materialIndex < numMaterials; ++materialIndex ) {
+
+										materials[ materialIndex ].vertexColors = THREE.VertexColors;
+
+									}
 
 								}
 								if ( geometry.FBX_Deformer ) {