Skip to content

Commit 96f4c60

Browse files
committed
move install maya integration into export settings
As a button
1 parent fba9544 commit 96f4c60

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ public override void OnInspectorGUI() {
9898
);
9999

100100
GUILayout.EndHorizontal ();
101+
102+
103+
EditorGUILayout.Space ();
104+
if (GUILayout.Button ("Install Maya Integration")) {
105+
FbxExporters.Editor.IntegrationsUI.InstallMayaIntegration ();
106+
}
107+
101108
GUILayout.FlexibleSpace ();
102109
GUILayout.EndScrollView ();
103110

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -499,32 +499,26 @@ public static bool InstallMaya(MayaVersion version = null, bool verbose = false)
499499
}
500500
}
501501

502-
namespace Editors
502+
class IntegrationsUI
503503
{
504-
class IntegrationsUI
504+
public static void InstallMayaIntegration ()
505505
{
506-
const string MenuItemName1 = "FbxExporters/Install Maya Integration";
507-
508-
[MenuItem (MenuItemName1, false, 0)]
509-
public static void OnMenuItem1 ()
510-
{
511-
var mayaVersion = new Integrations.MayaVersion();
512-
if (!Integrations.InstallMaya(mayaVersion, verbose: true)) {
513-
return;
514-
}
506+
var mayaVersion = new Integrations.MayaVersion();
507+
if (!Integrations.InstallMaya(mayaVersion, verbose: true)) {
508+
return;
509+
}
515510

516-
int exitCode = Integrations.ConfigureMaya (mayaVersion);
511+
int exitCode = Integrations.ConfigureMaya (mayaVersion);
517512

518-
string title, message;
519-
if (exitCode != 0) {
520-
title = string.Format("Failed to install Maya {0} Integration.", mayaVersion.Version);
521-
message = string.Format("Failed to configure Maya, please check logs (exitcode={0}).", exitCode);
522-
} else {
523-
title = string.Format("Completed installation of Maya {0} Integration.", mayaVersion.Version);
524-
message = string.Format("Enjoy the new \"Unity\" menu in Maya {0}.", mayaVersion.Version);
525-
}
526-
UnityEditor.EditorUtility.DisplayDialog (title, message, "Ok");
513+
string title, message;
514+
if (exitCode != 0) {
515+
title = string.Format("Failed to install Maya {0} Integration.", mayaVersion.Version);
516+
message = string.Format("Failed to configure Maya, please check logs (exitcode={0}).", exitCode);
517+
} else {
518+
title = string.Format("Completed installation of Maya {0} Integration.", mayaVersion.Version);
519+
message = string.Format("Enjoy the new \"Unity\" menu in Maya {0}.", mayaVersion.Version);
527520
}
521+
UnityEditor.EditorUtility.DisplayDialog (title, message, "Ok");
528522
}
529523
}
530524
}

0 commit comments

Comments
 (0)