@@ -37,21 +37,6 @@ private static string GetUserFolder()
37
37
#endif
38
38
}
39
39
40
- public static string BuildCommandLineArgs ( List < string > argsList )
41
- {
42
- System . Text . StringBuilder sb = new System . Text . StringBuilder ( ) ;
43
-
44
- foreach ( string arg in argsList ) {
45
- sb . Append ( "\" \" " + arg . Replace ( "\" " , @"\" + "\" " ) + "\" \" " ) ;
46
- }
47
-
48
- if ( sb . Length > 0 ) {
49
- sb = sb . Remove ( sb . Length - 1 , 1 ) ;
50
- }
51
-
52
- return sb . ToString ( ) ;
53
- }
54
-
55
40
private static string GetModulePath ( string version )
56
41
{
57
42
string result = System . IO . Path . Combine ( GetUserFolder ( ) , REL_MAYA_MODULES_PATH ) ;
@@ -182,13 +167,29 @@ public static int ConfigureMaya(string version)
182
167
183
168
#if UNITY_EDITOR_OSX
184
169
myProcess . StartInfo . FileName = "open" ;
185
- string mayaCommandLine = string . Format ( @"/Applications/Autodesk/maya{0}/Maya.app --args -command '{1}'" , version , MAYA_COMMANDS ) ;
170
+ string mayaPath = string . Format ( "/Applications/Autodesk/maya{0}/Maya.app" , version ) ;
171
+
172
+ if ( ! System . IO . Directory . Exists ( mayaPath ) )
173
+ {
174
+ Debug . LogError ( string . Format ( "No maya installation found at {0}" , mayaPath ) ) ;
175
+ return - 1 ;
176
+ }
177
+
178
+ string mayaCommandLine = string . Format ( @"{0} --args -command '{1}'" , mayaPath , MAYA_COMMANDS ) ;
186
179
myProcess . StartInfo . Arguments = "-a " + mayaCommandLine ;
187
180
#elif UNITY_EDITOR_LINUX
188
181
throw new NotImplementedException ( ) ;
189
182
#else
183
+ string mayaPath = string . Format ( "C:/Program Files/Autodesk/Maya{0}/maya.exe" , version ) ;
184
+
185
+ if ( ! System . IO . File . Exists ( mayaPath ) )
186
+ {
187
+ Debug . LogError ( string . Format ( "No maya installation found at {0}" , mayaPath ) ) ;
188
+ return - 1 ;
189
+ }
190
+
190
191
myProcess . StartInfo . FileName = "C:/Windows/system32/cmd.exe" ;
191
- string mayaCommandLine = string . Format ( "C:/Program Files/Autodesk/Maya {0}/maya.exe -command '{1}'" , version , MAYA_COMMANDS ) ;
192
+ string mayaCommandLine = string . Format ( "{0} -command '{1}'" , mayaPath , MAYA_COMMANDS ) ;
192
193
myProcess . StartInfo . Arguments = "/c " + mayaCommandLine ;
193
194
#endif
194
195
myProcess . EnableRaisingEvents = true ;
0 commit comments