@@ -214,7 +214,7 @@ private static System.Collections.Generic.Dictionary<string, string> FindMayaIns
214
214
var location = System . Environment . GetEnvironmentVariable ( "MAYA_LOCATION" ) ;
215
215
if ( ! string . IsNullOrEmpty ( location ) ) {
216
216
location = location . TrimEnd ( '/' ) ;
217
- mayaAppOptions . Add ( location , "MAYA_LOCATION" ) ;
217
+ mayaAppOptions . Add ( GetMayaExePath ( location . Replace ( " \\ " , "/" ) ) , "MAYA_LOCATION" ) ;
218
218
}
219
219
220
220
// List that directory and find the right version:
@@ -231,11 +231,37 @@ private static System.Collections.Generic.Dictionary<string, string> FindMayaIns
231
231
if ( product . StartsWith ( "mayalt" , StringComparison . InvariantCultureIgnoreCase ) ) {
232
232
continue ;
233
233
}
234
- mayaAppOptions . Add ( productDir . FullName , product ) ;
234
+ mayaAppOptions . Add ( GetMayaExePath ( productDir . FullName . Replace ( " \\ " , "/" ) ) , product ) ;
235
235
}
236
236
return mayaAppOptions ;
237
237
}
238
238
239
+ /// <summary>
240
+ /// Gets the maya exe at Maya install location.
241
+ /// </summary>
242
+ /// <returns>The maya exe path.</returns>
243
+ /// <param name="location">Location of Maya install.</param>
244
+ private static string GetMayaExePath ( string location )
245
+ {
246
+ #if UNITY_EDITOR_OSX
247
+ // MAYA_LOCATION on mac is set by Autodesk to be the
248
+ // Contents directory. But let's make it easier on people
249
+ // and allow just having it be the app bundle or a
250
+ // directory that holds the app bundle.
251
+ if ( location . EndsWith ( ".app/Contents" ) ) {
252
+ return location + "/MacOS/Maya" ;
253
+ } else if ( location . EndsWith ( ".app" ) ) {
254
+ return location + "/Contents/MacOS/Maya" ;
255
+ } else {
256
+ return location + "/Maya.app/Contents/MacOS/Maya" ;
257
+ }
258
+ #elif UNITY_EDITOR_LINUX
259
+ return location + "/bin/maya" ;
260
+ #else // WINDOWS
261
+ return location + "/bin/maya.exe" ;
262
+ #endif
263
+ }
264
+
239
265
public static GUIContent [ ] GetMayaOptions ( ) {
240
266
if ( instance . mayaAppOptions == null ) {
241
267
instance . mayaAppOptions = FindMayaInstalls ( ) ;
0 commit comments