@@ -570,7 +570,7 @@ private string ExportSkinnedMesh(string fileToExport, out SkinnedMeshRenderer or
570
570
importer . optimizeMeshPolygons = false ;
571
571
importer . optimizeMeshVertices = false ;
572
572
importer . meshCompression = ModelImporterMeshCompression . Off ;
573
- // If blendshape normals are imported or weldVertices is turned off,
573
+ // If either blendshape normals are imported or weldVertices is turned off (or both) ,
574
574
// the vertex count between the original and exported meshes does not match.
575
575
importer . importBlendShapeNormals = ModelImporterNormals . None ;
576
576
importer . weldVertices = true ;
@@ -769,6 +769,8 @@ private static float ComputeHausdorffDistance<T>(T[] orig, T[] converted, GetDis
769
769
return maxDistance ;
770
770
}
771
771
772
+ // Test for bug where exporting FbxShapes with empty names would fail to import all
773
+ // blendshapes except the first in Maya (fixed by UT-3216)
772
774
private void TestFbxShapeNamesNotEmpty ( FbxNode node )
773
775
{
774
776
var mesh = node . GetMesh ( ) ;
@@ -841,10 +843,6 @@ private void FbxImportAndTestBlendshapes(string fbxPath)
841
843
// Get blendshapes and check that the FbxShapes all have names
842
844
var rootNode = fbxScene . GetRootNode ( ) ;
843
845
TestFbxShapeNamesNotEmpty ( rootNode ) ;
844
-
845
- // cleanup
846
- fbxScene . Destroy ( ) ;
847
- fbxImporter . Destroy ( ) ;
848
846
}
849
847
}
850
848
@@ -899,7 +897,7 @@ public void TestBlendShapeExport(string fbxPath)
899
897
}
900
898
// Compute the Hausdorff distance to determine if two meshes have the same vertices as
901
899
// we can't rely on the vertex order matching.
902
- var hausdorffDistance = ComputeHausdorffDistance < Vector3 > ( worldVertices , exportedWorldVertices , ( Vector3 a , Vector3 b ) => Vector3 . Distance ( a , b ) ) ;
900
+ var hausdorffDistance = ComputeHausdorffDistance < Vector3 > ( worldVertices , exportedWorldVertices , Vector3 . Distance ) ;
903
901
Assert . That ( hausdorffDistance , Is . LessThan ( epsilon ) , "Maximum distance between two vertices greater than epsilon" ) ;
904
902
905
903
// TODO: Investigate importing blendshape normals without discrepancy in vertex count between the original/exported meshes
0 commit comments