Skip to content

Commit bf1e194

Browse files
author
AJubrey
committed
[CHANGED] maya now just stays up after installation if you check the box, split up the config and closing commands which were previously MAYA_COMMANDS
1 parent 3a7fddf commit bf1e194

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,14 @@ private static string ESCAPED_QUOTE {
133133
}
134134
}
135135

136-
private static string MAYA_COMMANDS { get {
137-
return string.Format("configureUnityFbxForMaya {0}{1}{0} {0}{2}{0} {0}{3}{0} {0}{4}{0} {0}{5}{0} {6}; scriptJob -idleEvent quit;",
136+
private static string MAYA_CONFIG_COMMAND { get {
137+
return string.Format("configureUnityFbxForMaya {0}{1}{0} {0}{2}{0} {0}{3}{0} {0}{4}{0} {0}{5}{0} {6};",
138+
ESCAPED_QUOTE, GetProjectPath(), GetAppPath(), GetTempSavePath(),
139+
GetExportSettingsPath(), GetMayaInstructionPath(), (IsHeadlessInstall() ? 1 : 0));
140+
}}
141+
142+
private static string MAYA_CLOSE_COMMAND { get {
143+
return string.Format("scriptJob -idleEvent quit;",
138144
ESCAPED_QUOTE, GetProjectPath(), GetAppPath(), GetTempSavePath(),
139145
GetExportSettingsPath(), GetMayaInstructionPath(), (IsHeadlessInstall()?1:0));
140146
}}
@@ -325,10 +331,28 @@ public static int ConfigureMaya(string mayaPath)
325331

326332
switch (Application.platform) {
327333
case RuntimePlatform.WindowsEditor:
328-
myProcess.StartInfo.Arguments = string.Format("-command \"{0}\"", MAYA_COMMANDS);
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+
}
329344
break;
330345
case RuntimePlatform.OSXEditor:
331-
myProcess.StartInfo.Arguments = string.Format(@"-command '{0}'", MAYA_COMMANDS);
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+
}
332356
break;
333357
default:
334358
throw new NotImplementedException ();
@@ -340,11 +364,6 @@ public static int ConfigureMaya(string mayaPath)
340364
ExitCode = myProcess.ExitCode;
341365
Debug.Log(string.Format("Ran maya: [{0}]\nWith args [{1}]\nResult {2}",
342366
mayaPath, myProcess.StartInfo.Arguments, ExitCode));
343-
344-
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
345-
{
346-
LaunchDCCApplication(mayaPath);
347-
}
348367
}
349368
catch (Exception e)
350369
{

0 commit comments

Comments
 (0)