Skip to content

Commit c6eb97f

Browse files
committed
allow transfer motion on timeline export
1 parent 150525a commit c6eb97f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ protected override bool DisableTransferAnim {
401401
get {
402402
// don't transfer animation if we are exporting more than one hierarchy, the timeline clips from
403403
// a playable director, or if only the model is being exported
404-
return ToExport == null || ToExport.Length > 1 || IsPlayableDirector || SettingsObject.ModelAnimIncludeOption == ExportSettings.Include.Model;
404+
// if we are on the timeline then export length can be more than 1
405+
return ToExport == null || ToExport.Length == 0 || (!IsTimelineAnim && ToExport.Length > 1) || IsPlayableDirector || SettingsObject.ModelAnimIncludeOption == ExportSettings.Include.Model;
405406
}
406407
}
407408

@@ -453,14 +454,15 @@ protected override ExportOptionsSettingsSerializeBase SettingsObject
453454
public static void Init (IEnumerable<UnityEngine.Object> toExport, string filename = "", bool isTimelineAnim = false, bool isPlayableDirector = false)
454455
{
455456
ExportModelEditorWindow window = CreateWindow<ExportModelEditorWindow> ();
457+
window.IsTimelineAnim = isTimelineAnim;
458+
window.IsPlayableDirector = isPlayableDirector;
459+
456460
int numObjects = window.SetGameObjectsToExport (toExport);
457461
if (string.IsNullOrEmpty (filename)) {
458462
filename = window.GetFilenameFromObjects ();
459463
}
460464
window.InitializeWindow (filename);
461-
window.IsTimelineAnim = isTimelineAnim;
462465
window.SingleHierarchyExport = (numObjects == 1);
463-
window.IsPlayableDirector = isPlayableDirector;
464466
window.Show ();
465467
}
466468

@@ -471,7 +473,8 @@ protected int SetGameObjectsToExport(IEnumerable<UnityEngine.Object> toExport){
471473
TransferAnimationDest = null;
472474

473475
// if only one object selected, set transfer source/dest to this object
474-
if (ToExport.Length == 1) {
476+
if (ToExport.Length == 1 || (IsTimelineAnim && ToExport.Length > 0)) {
477+
Debug.Log ("here");
475478
var go = ModelExporter.GetGameObject (ToExport [0]);
476479
if (go) {
477480
TransferAnimationSource = go.transform;

0 commit comments

Comments
 (0)