Skip to content

Commit 032c4e4

Browse files
committed
Exporting Single Timeline clip bug fix
1 parent 926bf17 commit 032c4e4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,23 +3079,23 @@ static void OnClipContextClick(MenuCommand command)
30793079
}
30803080
Debug.Log(folderPath);
30813081

3082+
Object[] selectedObjects = Selection.objects;
30823083

3083-
var selectedObjects = Selection.objects;
3084-
foreach (GameObject editorClipSelected in selectedObjects)
3084+
foreach (Object editorClipSelected in selectedObjects)
30853085
{
30863086
ExportSingleEditorClip(editorClipSelected, folderPath);
30873087
}
30883088
}
30893089

3090-
public static void ExportSingleEditorClip(GameObject editorClipSelected, string folderPath)
3090+
public static void ExportSingleEditorClip(Object editorClipSelected, string folderPath)
30913091
{
30923092
if (editorClipSelected.GetType().Name.Contains("EditorClip"))
30933093
{
3094-
var selClip = editorClipSelected.GetType().GetProperty("clip").GetValue(editorClipSelected, null);
3094+
object selClip = editorClipSelected.GetType().GetProperty("clip").GetValue(editorClipSelected, null);
30953095
UnityEngine.Timeline.TimelineClip timeLineClip = selClip as UnityEngine.Timeline.TimelineClip;
30963096

3097-
var selClipItem = editorClipSelected.GetType().GetProperty("item").GetValue(editorClipSelected, null);
3098-
var selClipItemParentTrack = selClipItem.GetType().GetProperty("parentTrack").GetValue(selClipItem, null);
3097+
object selClipItem = editorClipSelected.GetType().GetProperty("item").GetValue(editorClipSelected, null);
3098+
object selClipItemParentTrack = selClipItem.GetType().GetProperty("parentTrack").GetValue(selClipItem, null);
30993099
AnimationTrack editorClipAnimationTrack = selClipItemParentTrack as AnimationTrack;
31003100
GameObject animationTrackGObject = UnityEditor.Timeline.TimelineEditor.playableDirector.GetGenericBinding (editorClipAnimationTrack) as GameObject;
31013101

@@ -3106,7 +3106,6 @@ public static void ExportSingleEditorClip(GameObject editorClipSelected, string
31063106
public static void ExportSingleTimelineClip(TimelineClip timelineClipSelected, string folderPath, GameObject animationTrackGObject)
31073107
{
31083108
string filePath = folderPath + "/" + animationTrackGObject.name + "@" + timelineClipSelected.animationClip.name + ".fbx";
3109-
//Debug.Log("filepath: " + filePath);
31103109
UnityEngine.Object[] myArray = new UnityEngine.Object[] { animationTrackGObject, timelineClipSelected.animationClip };
31113110
ExportObjects(filePath, myArray, AnimationExportType.timelineAnimationClip);
31123111
}
@@ -3141,7 +3140,7 @@ public static void OnPlayableDirectorGameObjectContextClick(MenuCommand command)
31413140
else
31423141
{
31433142
// We were invoked from the right-click menu, so use the context of the context menu.
3144-
var selected = command.context as GameObject;
3143+
GameObject selected = command.context as GameObject;
31453144
if (selected)
31463145
{
31473146
selection = new GameObject[] { selected };

0 commit comments

Comments
 (0)