Skip to content

Commit d5febfe

Browse files
committed
keep track and print how many bone weights were compared
1 parent 45c1531 commit d5febfe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Assets/FbxExporters/Editor/UnitTests/ModelExporterTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,10 @@ public void TestBoneWeightExport()
625625
var origBones = originalSkinnedMesh.bones;
626626
var expBones = exportedSkinnedMesh.bones;
627627

628-
for(int i = 0, n = Mathf.Min(origVerts.Length, expVerts.Length); i < n; i++){
629-
bool compared = false;
630-
for (int j = 0; j < n; j++) {
628+
int comparisonCount = 0;
629+
int minVertCount = Mathf.Min (origVerts.Length, expVerts.Length);
630+
for(int i = 0; i < minVertCount; i++){
631+
for (int j = 0; j < minVertCount; j++) {
631632
if (origVerts [i] == expVerts [j]) {
632633
// compare bone weights
633634
var origBw = origBoneWeights[i];
@@ -650,13 +651,12 @@ public void TestBoneWeightExport()
650651
Assert.That (expBw.weight2, Is.EqualTo (origBw.weight2).Within(0.001f));
651652
Assert.That (expBw.weight3, Is.EqualTo (origBw.weight3).Within(0.001f));
652653

653-
compared = true;
654+
comparisonCount++;
654655
break;
655656
}
656657
}
657-
// make sure that each vertex is compared
658-
Assert.That (compared, Is.True, string.Format("Couldn't find matching vertex for: {0}", origVerts[i]));
659658
}
659+
Debug.LogWarningFormat ("Compared {0} out of a possible {1} bone weights", comparisonCount, minVertCount);
660660
}
661661
}
662662
}

0 commit comments

Comments
 (0)