@@ -133,8 +133,14 @@ private static string ESCAPED_QUOTE {
133
133
}
134
134
}
135
135
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;" ,
138
144
ESCAPED_QUOTE , GetProjectPath ( ) , GetAppPath ( ) , GetTempSavePath ( ) ,
139
145
GetExportSettingsPath ( ) , GetMayaInstructionPath ( ) , ( IsHeadlessInstall ( ) ? 1 : 0 ) ) ;
140
146
} }
@@ -325,10 +331,28 @@ public static int ConfigureMaya(string mayaPath)
325
331
326
332
switch ( Application . platform ) {
327
333
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
+ }
329
344
break ;
330
345
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
+ }
332
356
break ;
333
357
default :
334
358
throw new NotImplementedException ( ) ;
@@ -340,11 +364,6 @@ public static int ConfigureMaya(string mayaPath)
340
364
ExitCode = myProcess . ExitCode ;
341
365
Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
342
366
mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
343
-
344
- if ( EditorTools . ExportSettings . instance . launchAfterInstallation )
345
- {
346
- LaunchDCCApplication ( mayaPath ) ;
347
- }
348
367
}
349
368
catch ( Exception e )
350
369
{
0 commit comments