File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Assets/com.unity.formats.fbx/Editor/Scripts Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -3305,9 +3305,24 @@ protected static bool ExportSingleEditorClip(Object editorClipSelected)
3305
3305
object selClipItem = editorClipSelected . GetType ( ) . GetProperty ( "item" ) . GetValue ( editorClipSelected , null ) ;
3306
3306
object selClipItemParentTrack = selClipItem . GetType ( ) . GetProperty ( "parentTrack" ) . GetValue ( selClipItem , null ) ;
3307
3307
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
+ }
3309
3324
3310
- ExportSingleTimelineClip ( timeLineClip , animationTrackGObject ) ;
3325
+ ExportSingleTimelineClip ( timeLineClip , animationTrackGO ) ;
3311
3326
return true ;
3312
3327
}
3313
3328
return false ;
You can’t perform that action at this time.
0 commit comments