|
1 |
| -using System.Collections; |
| 1 | +using System.Collections; |
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using UnityEngine;
|
4 | 4 | using UnityEditor;
|
@@ -413,6 +413,7 @@ protected bool IsTimelineAnim {
|
413 | 413 | set{
|
414 | 414 | m_isTimelineAnim = value;
|
415 | 415 | if (m_isTimelineAnim) {
|
| 416 | + m_previousInclude = ExportSettings.instance.exportModelSettings.info.ModelAnimIncludeOption; |
416 | 417 | ExportSettings.instance.exportModelSettings.info.SetModelAnimIncludeOption(ExportSettings.Include.Anim);
|
417 | 418 | }
|
418 | 419 | if (m_innerEditor) {
|
@@ -452,6 +453,8 @@ protected override ExportOptionsSettingsSerializeBase SettingsObject
|
452 | 453 | get { return ExportSettings.instance.exportModelSettings.info; }
|
453 | 454 | }
|
454 | 455 |
|
| 456 | + private ExportSettings.Include m_previousInclude = ExportSettings.Include.ModelAndAnim; |
| 457 | + |
455 | 458 | public static void Init (IEnumerable<UnityEngine.Object> toExport, string filename = "", bool isTimelineAnim = false, bool isPlayableDirector = false)
|
456 | 459 | {
|
457 | 460 | ExportModelEditorWindow window = CreateWindow<ExportModelEditorWindow> ();
|
@@ -510,12 +513,28 @@ protected override void OnEnable ()
|
510 | 513 | }
|
511 | 514 | }
|
512 | 515 |
|
| 516 | + protected void OnDisable() |
| 517 | + { |
| 518 | + RestoreSettings (); |
| 519 | + } |
| 520 | + |
| 521 | + /// <summary> |
| 522 | + /// Restore changed export settings after export |
| 523 | + /// </summary> |
| 524 | + protected virtual void RestoreSettings() |
| 525 | + { |
| 526 | + if (IsTimelineAnim) { |
| 527 | + ExportSettings.instance.exportModelSettings.info.SetModelAnimIncludeOption(m_previousInclude); |
| 528 | + SaveExportSettings (); |
| 529 | + } |
| 530 | + } |
| 531 | + |
| 532 | + |
513 | 533 | protected override bool Export(){
|
514 | 534 | if (string.IsNullOrEmpty (m_exportFileName)) {
|
515 | 535 | Debug.LogError ("FbxExporter: Please specify an fbx filename");
|
516 | 536 | return false;
|
517 | 537 | }
|
518 |
| - |
519 | 538 | var folderPath = ExportSettings.GetFbxAbsoluteSavePath ();
|
520 | 539 | var filePath = System.IO.Path.Combine (folderPath, m_exportFileName + ".fbx");
|
521 | 540 |
|
|
0 commit comments