@@ -1727,8 +1727,6 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
1727
1727
if ( Verbose )
1728
1728
Debug . Log ( string . Format ( "Exporting animation clip ({1}) for {0}" , uniRoot . name , uniAnimClip . name ) ) ;
1729
1729
1730
- Debug . Log ( "ExportAnimationClip: " + uniAnimClip . name + " uniRoot " + uniRoot . name ) ;
1731
-
1732
1730
// setup anim stack
1733
1731
FbxAnimStack fbxAnimStack = FbxAnimStack . Create ( fbxScene , uniAnimClip . name ) ;
1734
1732
fbxAnimStack . Description . Set ( "Animation Take: " + uniAnimClip . name ) ;
@@ -1773,7 +1771,6 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
1773
1771
1774
1772
foreach ( EditorCurveBinding uniCurveBinding in AnimationUtility . GetCurveBindings ( uniAnimClip ) ) {
1775
1773
Object uniObj = AnimationUtility . GetAnimatedObject ( uniRoot , uniCurveBinding ) ;
1776
- Debug . Log ( "Curve " + uniObj . name + " uniCurveBinding " + uniCurveBinding . propertyName ) ;
1777
1774
if ( ! uniObj ) { continue ; }
1778
1775
1779
1776
AnimationCurve uniAnimCurve = AnimationUtility . GetEditorCurve ( uniAnimClip , uniCurveBinding ) ;
@@ -1789,30 +1786,33 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
1789
1786
if ( ! uniGO ) {
1790
1787
continue ;
1791
1788
}
1792
-
1789
+
1793
1790
// 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
+ }
1802
1795
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
+ }
1809
1803
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 ;
1815
1809
}
1810
+
1811
+ /* simple property (e.g. intensity), export right away */
1812
+ ExportAnimationCurve ( uniGO , uniAnimCurve , uniAnimClip . frameRate ,
1813
+ uniCurveBinding . propertyName ,
1814
+ fbxScene ,
1815
+ fbxAnimLayer ) ;
1816
1816
}
1817
1817
1818
1818
/* now export all the quaternion curves */
@@ -1855,8 +1855,6 @@ ref Dictionary<GameObject, RotationCurve> rotations
1855
1855
/// </summary>
1856
1856
protected void ExportAnimation ( GameObject uniRoot , FbxScene fbxScene )
1857
1857
{
1858
- Debug . Log ( "Export animation: " + uniRoot . name ) ;
1859
-
1860
1858
var exportedClips = new HashSet < AnimationClip > ( ) ;
1861
1859
1862
1860
var uniAnimator = uniRoot . GetComponent < Animator > ( ) ;
0 commit comments