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

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 жил өмнө
parent
commit
b36e2ebcdf

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

@@ -1210,11 +1210,16 @@
 								} else {
 								} else {
 
 
 									material = new THREE.MeshBasicMaterial( { color: 0x3300ff } );
 									material = new THREE.MeshBasicMaterial( { color: 0x3300ff } );
+									materials.push( material );
 
 
 								}
 								}
 								if ( 'color' in geometry.attributes ) {
 								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 ) {
 								if ( geometry.FBX_Deformer ) {