@@ -1251,7 +1251,7 @@ protected bool ExportInstance (GameObject unityGo, FbxNode fbxNode, FbxScene fbx
1251
1251
if ( unityPrefabType != PrefabType . PrefabInstance &&
1252
1252
unityPrefabType != PrefabType . ModelPrefabInstance ) return false ;
1253
1253
1254
- Object unityPrefabParent = PrefabUtility . GetPrefabParent ( unityGo ) ;
1254
+ Object unityPrefabParent = PrefabUtility . GetCorrespondingObjectFromSource ( unityGo ) ;
1255
1255
1256
1256
if ( Verbose )
1257
1257
Debug . Log ( string . Format ( "exporting instance {0}({1})" , unityGo . name , unityPrefabParent . name ) ) ;
@@ -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 ;
0 commit comments