Skip to content

Commit 11d168c

Browse files
author
AJubrey
committed
[CHANGED] the wording for the check box in the settings menu
[FIXED] bug where unity would freeze if you chose to keep Maya up [CHANGED] consolidated a lot of logic in the ConfigureMaya function
1 parent bf1e194 commit 11d168c

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public override void OnInspectorGUI() {
168168
}
169169

170170
exportSettings.launchAfterInstallation = EditorGUILayout.Toggle(
171-
new GUIContent("Launch program after installation:",
171+
new GUIContent("Launch 3D Application:",
172172
"Launch the selected application after unity integration is completed."),
173173
exportSettings.launchAfterInstallation
174174
);

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ private static string MAYA_CONFIG_COMMAND { get {
140140
}}
141141

142142
private static string MAYA_CLOSE_COMMAND { get {
143-
return string.Format("scriptJob -idleEvent quit;",
144-
ESCAPED_QUOTE, GetProjectPath(), GetAppPath(), GetTempSavePath(),
145-
GetExportSettingsPath(), GetMayaInstructionPath(), (IsHeadlessInstall()?1:0));
143+
return string.Format("scriptJob -idleEvent quit;");
146144
}}
147145
private static Char[] FIELD_SEPARATORS = new Char[] {':'};
148146

@@ -329,41 +327,44 @@ public static int ConfigureMaya(string mayaPath)
329327
myProcess.StartInfo.CreateNoWindow = true;
330328
myProcess.StartInfo.UseShellExecute = false;
331329

330+
string commandString;
331+
332332
switch (Application.platform) {
333333
case RuntimePlatform.WindowsEditor:
334-
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
335-
{
336-
myProcess.StartInfo.Arguments = string.Format("-command \"{0}\"", MAYA_CONFIG_COMMAND);
337-
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
338-
myProcess.StartInfo.CreateNoWindow = false;
339-
}
340-
else
341-
{
342-
myProcess.StartInfo.Arguments = string.Format("-command \"{0}\"", MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND);
343-
}
334+
commandString = "-command \"{0}\"";
344335
break;
345336
case RuntimePlatform.OSXEditor:
346-
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
347-
{
348-
myProcess.StartInfo.Arguments = string.Format(@"-command '{0}'", MAYA_CONFIG_COMMAND);
349-
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
350-
myProcess.StartInfo.CreateNoWindow = false;
351-
}
352-
else
353-
{
354-
myProcess.StartInfo.Arguments = string.Format(@"-command '{0}'", MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND);
355-
}
337+
commandString = @"-command '{0}'";
356338
break;
357339
default:
358340
throw new NotImplementedException ();
359341
}
360342

343+
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
344+
{
345+
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
346+
myProcess.StartInfo.CreateNoWindow = false;
347+
myProcess.StartInfo.Arguments = string.Format(commandString, MAYA_CONFIG_COMMAND);
348+
}
349+
else
350+
{
351+
myProcess.StartInfo.Arguments = string.Format(commandString, MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND);
352+
}
353+
361354
myProcess.EnableRaisingEvents = true;
362355
myProcess.Start();
363-
myProcess.WaitForExit();
364-
ExitCode = myProcess.ExitCode;
365-
Debug.Log(string.Format("Ran maya: [{0}]\nWith args [{1}]\nResult {2}",
366-
mayaPath, myProcess.StartInfo.Arguments, ExitCode));
356+
357+
if (!EditorTools.ExportSettings.instance.launchAfterInstallation)
358+
{
359+
myProcess.WaitForExit();
360+
ExitCode = myProcess.ExitCode;
361+
Debug.Log(string.Format("Ran maya: [{0}]\nWith args [{1}]\nResult {2}",
362+
mayaPath, myProcess.StartInfo.Arguments, ExitCode));
363+
}
364+
else
365+
{
366+
ExitCode = 0;
367+
}
367368
}
368369
catch (Exception e)
369370
{

0 commit comments

Comments
 (0)