Skip to content

Commit 955d861

Browse files
authored
Merge pull request #388 from Unity-Technologies/UT-513-2018.2-fixes
Ut 513 2018.2 fixes
2 parents 3e8a691 + a20b24d commit 955d861

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Assets/com.unity.formats.fbx/Editor/Scripts/FbxExporter.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,9 +3305,24 @@ protected static bool ExportSingleEditorClip(Object editorClipSelected)
33053305
object selClipItem = editorClipSelected.GetType().GetProperty("item").GetValue(editorClipSelected, null);
33063306
object selClipItemParentTrack = selClipItem.GetType().GetProperty("parentTrack").GetValue(selClipItem, null);
33073307
AnimationTrack editorClipAnimationTrack = selClipItemParentTrack as AnimationTrack;
3308-
GameObject animationTrackGObject = UnityEditor.Timeline.TimelineEditor.playableDirector.GetGenericBinding (editorClipAnimationTrack) as GameObject;
3308+
Object animationTrackObject = UnityEditor.Timeline.TimelineEditor.inspectedDirector.GetGenericBinding (editorClipAnimationTrack);
3309+
GameObject animationTrackGO = null;
3310+
if (animationTrackObject is GameObject)
3311+
{
3312+
animationTrackGO = animationTrackObject as GameObject;
3313+
}
3314+
else if (animationTrackObject is Animator)
3315+
{
3316+
animationTrackGO = (animationTrackObject as Animator).gameObject;
3317+
}
3318+
3319+
if(animationTrackGO == null)
3320+
{
3321+
Debug.LogErrorFormat("Could not export animation track object of type {0}", animationTrackObject.GetType().Name);
3322+
return false;
3323+
}
33093324

3310-
ExportSingleTimelineClip(timeLineClip, animationTrackGObject);
3325+
ExportSingleTimelineClip(timeLineClip, animationTrackGO);
33113326
return true;
33123327
}
33133328
return false;

0 commit comments

Comments
 (0)