Procházet zdrojové kódy

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 před 8 roky
rodič
revize
b36e2ebcdf
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  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 ) {