Skip to content

Commit 8f7fe3c

Browse files
authored
Merge pull request #114 from Unity-Technologies/UNI-24488-move-maya-integration-to-settings
UNI-24488 move install maya integration into export settings
2 parents 302a84d + e07914b commit 8f7fe3c

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public override void OnInspectorGUI() {
105105
FbxExporters.Review.TurnTable.LastSavedModel ();
106106
}
107107

108+
EditorGUILayout.Space ();
109+
if (GUILayout.Button ("Install Maya Integration")) {
110+
FbxExporters.Editor.IntegrationsUI.InstallMayaIntegration ();
111+
}
112+
108113
GUILayout.FlexibleSpace ();
109114
GUILayout.EndScrollView ();
110115

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)