Skip to content

Commit ed3f7fe

Browse files
committed
fix merge
1 parent ac29d34 commit ed3f7fe

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,9 @@ protected int ExportNodes(
17211721
FbxNode fbxNode = FbxNode.Create (fbxScene, GetUniqueName (unityGo.name));
17221722
MapUnityObjectToFbxNode [unityGo] = fbxNode;
17231723

1724+
if (Verbose)
1725+
Debug.Log (string.Format ("exporting {0}", fbxNode.GetName ()));
1726+
17241727
numObjectsExported++;
17251728
if (EditorUtility.DisplayCancelableProgressBar (
17261729
ProgressBarTitle,
@@ -1739,21 +1742,13 @@ protected int ExportNodes(
17391742

17401743
ExportTransform (unityGo.transform, fbxNode, newCenter, exportType);
17411744

1742-
MapUnityObjectToFbxNode.Add (unityGo, fbxNode);
1743-
1744-
if (Verbose)
1745-
Debug.Log (string.Format ("exporting {0}", fbxNode.GetName ()));
1746-
17471745
fbxNodeParent.AddChild (fbxNode);
17481746

17491747
// now unityGo through our children and recurse
17501748
foreach (Transform childT in unityGo.transform) {
17511749
numObjectsExported = ExportNodes (childT.gameObject, fbxScene, fbxNode, numObjectsExported, objectCount, newCenter);
17521750
}
17531751

1754-
// now export animation (after hierarchy has been exported)
1755-
ExportAnimation (unityGo, fbxScene);
1756-
17571752
return numObjectsExported;
17581753
}
17591754

@@ -1795,6 +1790,9 @@ protected bool ExportComponents(FbxScene fbxScene)
17951790
ExportLight (unityGo, fbxScene, fbxNode);
17961791
}
17971792

1793+
// now (try) export animation
1794+
ExportAnimation (unityGo, fbxScene);
1795+
17981796
}
17991797
return true;
18001798
}
@@ -2580,12 +2578,6 @@ bool ExportMesh (GameObject gameObject, FbxNode fbxNode)
25802578
return false;
25812579
}
25822580

2583-
/// <summary>
2584-
/// keep a map between GameObject and FbxNode for quick lookup when we export
2585-
/// animation.
2586-
/// </summary>
2587-
Dictionary<GameObject, FbxNode> MapUnityObjectToFbxNode = new Dictionary<GameObject, FbxNode> ();
2588-
25892581
/// <summary>
25902582
/// Number of nodes exported including siblings and decendents
25912583
/// </summary>

Assets/FbxExporters/Editor/UnitTests/ModelExporterTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ private void CompareMeshComponentAttributes(Mesh mesh, Mesh fbxMesh)
507507
Assert.AreEqual (mesh.tangents, fbxMesh.tangents);
508508
}
509509

510+
[Test]
510511
public void TestSkinnedMeshExport(){
511512
// for now use this cowboy taken from the asset store as the test file
512513
// TODO: find a better/simpler test file
@@ -574,7 +575,7 @@ public void TestSkinnedMeshExport(){
574575

575576
for (int j = 0; j < 4; j++) {
576577
for (int k = 0; k < 4; k++) {
577-
Assert.AreEqual (origBp.GetColumn (j)[k], expBp.GetColumn (j)[k], 0.001);
578+
Assert.That (origBp.GetColumn (j)[k], Is.EqualTo(expBp.GetColumn (j)[k]).Within(0.001f), string.Format("bind pose doesn't match {0},{1}", j, k));
578579
}
579580
}
580581
}

0 commit comments

Comments
 (0)