@@ -585,8 +585,7 @@ void ExportMesh (MeshInfo meshInfo, FbxNode fbxNode)
585
585
}
586
586
}
587
587
588
- int [ ] unmergedPolygons = new int [ meshInfo . Triangles . Length ] ;
589
- int current = 0 ;
588
+ var unmergedPolygons = new List < int > ( ) ;
590
589
var mesh = meshInfo . mesh ;
591
590
for ( int s = 0 ; s < mesh . subMeshCount ; s ++ ) {
592
591
var topology = mesh . GetTopology ( s ) ;
@@ -624,12 +623,11 @@ void ExportMesh (MeshInfo meshInfo, FbxNode fbxNode)
624
623
625
624
// Save the polygon order (without merging vertices) so we
626
625
// properly export UVs, normals, binormals, etc.
627
- unmergedPolygons [ current ] = polyVert ;
626
+ unmergedPolygons . Add ( polyVert ) ;
628
627
629
628
polyVert = ControlPointToIndex [ meshInfo . Vertices [ polyVert ] ] ;
630
629
fbxMesh . AddPolygon ( polyVert ) ;
631
630
632
- current ++ ;
633
631
}
634
632
fbxMesh . EndPolygon ( ) ;
635
633
}
@@ -643,7 +641,7 @@ void ExportMesh (MeshInfo meshInfo, FbxNode fbxNode)
643
641
AssignLayerElementMaterial ( fbxMesh , meshInfo . mesh , meshInfo . Materials . Length ) ;
644
642
645
643
// Set up normals, etc.
646
- ExportComponentAttributes ( meshInfo , fbxMesh , unmergedPolygons ) ;
644
+ ExportComponentAttributes ( meshInfo , fbxMesh , unmergedPolygons . ToArray ( ) ) ;
647
645
648
646
// set the fbxNode containing the mesh
649
647
fbxNode . SetNodeAttribute ( fbxMesh ) ;
0 commit comments