Skip to content

Commit 7bd50f5

Browse files
committed
Fixed Pull request changes
1 parent 7417d94 commit 7bd50f5

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,6 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
17271727
if (Verbose)
17281728
Debug.Log (string.Format ("Exporting animation clip ({1}) for {0}", uniRoot.name, uniAnimClip.name));
17291729

1730-
Debug.Log("ExportAnimationClip: " + uniAnimClip.name + " uniRoot " + uniRoot.name);
1731-
17321730
// setup anim stack
17331731
FbxAnimStack fbxAnimStack = FbxAnimStack.Create (fbxScene, uniAnimClip.name);
17341732
fbxAnimStack.Description.Set ("Animation Take: " + uniAnimClip.name);
@@ -1773,7 +1771,6 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
17731771

17741772
foreach (EditorCurveBinding uniCurveBinding in AnimationUtility.GetCurveBindings (uniAnimClip)) {
17751773
Object uniObj = AnimationUtility.GetAnimatedObject (uniRoot, uniCurveBinding);
1776-
Debug.Log ("Curve " + uniObj.name + " uniCurveBinding " + uniCurveBinding.propertyName);
17771774
if (!uniObj) { continue; }
17781775

17791776
AnimationCurve uniAnimCurve = AnimationUtility.GetEditorCurve (uniAnimClip, uniCurveBinding);
@@ -1789,30 +1786,33 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
17891786
if (!uniGO) {
17901787
continue;
17911788
}
1792-
1789+
17931790
// Do not create the curves if the component is a SkinnedMeshRenderer and if the option in FBX Export settings is toggled on.
1794-
if (!removeAnimationsFromSkinnedMeshRenderer || (removeAnimationsFromSkinnedMeshRenderer && uniGO.GetComponent<SkinnedMeshRenderer>() == null && uniGO.GetComponentInChildren<SkinnedMeshRenderer>() == null)) {
1795-
int index = QuaternionCurve.GetQuaternionIndex (uniCurveBinding.propertyName);
1796-
if (index >= 0) {
1797-
/* Rotation property; save it to convert quaternion -> euler later. */
1798-
RotationCurve rotCurve = GetRotationCurve<QuaternionCurve>(uniGO, uniAnimClip.frameRate, ref rotations);
1799-
rotCurve.SetCurve (index, uniAnimCurve);
1800-
continue;
1801-
}
1791+
if (removeAnimationsFromSkinnedMeshRenderer && (uniGO.GetComponent<SkinnedMeshRenderer>() != null || uniGO.GetComponentInChildren<SkinnedMeshRenderer>() != null))
1792+
{
1793+
continue;
1794+
}
18021795

1803-
index = EulerCurve.GetEulerIndex (uniCurveBinding.propertyName);
1804-
if (index >= 0) {
1805-
RotationCurve rotCurve = GetRotationCurve<EulerCurve> (uniGO, uniAnimClip.frameRate, ref rotations);
1806-
rotCurve.SetCurve (index, uniAnimCurve);
1807-
continue;
1808-
}
1796+
int index = QuaternionCurve.GetQuaternionIndex (uniCurveBinding.propertyName);
1797+
if (index >= 0) {
1798+
/* Rotation property; save it to convert quaternion -> euler later. */
1799+
RotationCurve rotCurve = GetRotationCurve<QuaternionCurve>(uniGO, uniAnimClip.frameRate, ref rotations);
1800+
rotCurve.SetCurve (index, uniAnimCurve);
1801+
continue;
1802+
}
18091803

1810-
/* simple property (e.g. intensity), export right away */
1811-
ExportAnimationCurve (uniGO, uniAnimCurve, uniAnimClip.frameRate,
1812-
uniCurveBinding.propertyName,
1813-
fbxScene,
1814-
fbxAnimLayer);
1804+
index = EulerCurve.GetEulerIndex (uniCurveBinding.propertyName);
1805+
if (index >= 0) {
1806+
RotationCurve rotCurve = GetRotationCurve<EulerCurve> (uniGO, uniAnimClip.frameRate, ref rotations);
1807+
rotCurve.SetCurve (index, uniAnimCurve);
1808+
continue;
18151809
}
1810+
1811+
/* simple property (e.g. intensity), export right away */
1812+
ExportAnimationCurve (uniGO, uniAnimCurve, uniAnimClip.frameRate,
1813+
uniCurveBinding.propertyName,
1814+
fbxScene,
1815+
fbxAnimLayer);
18161816
}
18171817

18181818
/* now export all the quaternion curves */
@@ -1855,8 +1855,6 @@ ref Dictionary<GameObject, RotationCurve> rotations
18551855
/// </summary>
18561856
protected void ExportAnimation (GameObject uniRoot, FbxScene fbxScene)
18571857
{
1858-
Debug.Log("Export animation: " + uniRoot.name);
1859-
18601858
var exportedClips = new HashSet<AnimationClip> ();
18611859

18621860
var uniAnimator = uniRoot.GetComponent<Animator> ();

0 commit comments

Comments
 (0)