Skip to content

Commit d49c6b2

Browse files
committed
code review fixes
1 parent 4808609 commit d49c6b2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

com.unity.formats.fbx/Tests/FbxTests/ModelExporterTest.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private string ExportSkinnedMesh(string fileToExport, out SkinnedMeshRenderer or
570570
importer.optimizeMeshPolygons = false;
571571
importer.optimizeMeshVertices = false;
572572
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),
574574
// the vertex count between the original and exported meshes does not match.
575575
importer.importBlendShapeNormals = ModelImporterNormals.None;
576576
importer.weldVertices = true;
@@ -769,6 +769,8 @@ private static float ComputeHausdorffDistance<T>(T[] orig, T[] converted, GetDis
769769
return maxDistance;
770770
}
771771

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)
772774
private void TestFbxShapeNamesNotEmpty(FbxNode node)
773775
{
774776
var mesh = node.GetMesh();
@@ -841,10 +843,6 @@ private void FbxImportAndTestBlendshapes(string fbxPath)
841843
// Get blendshapes and check that the FbxShapes all have names
842844
var rootNode = fbxScene.GetRootNode();
843845
TestFbxShapeNamesNotEmpty(rootNode);
844-
845-
// cleanup
846-
fbxScene.Destroy();
847-
fbxImporter.Destroy();
848846
}
849847
}
850848

@@ -899,7 +897,7 @@ public void TestBlendShapeExport(string fbxPath)
899897
}
900898
// Compute the Hausdorff distance to determine if two meshes have the same vertices as
901899
// 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);
903901
Assert.That(hausdorffDistance, Is.LessThan(epsilon), "Maximum distance between two vertices greater than epsilon");
904902

905903
// TODO: Investigate importing blendshape normals without discrepancy in vertex count between the original/exported meshes

0 commit comments

Comments
 (0)