@@ -85,17 +85,6 @@ public override void OnInspectorGUI() {
85
85
}
86
86
}
87
87
}
88
- GUILayout . EndHorizontal ( ) ;
89
- GUILayout . BeginHorizontal ( ) ;
90
-
91
- GUILayout . Label ( new GUIContent (
92
- "Turntable Scene:" ,
93
- "Scene to use for reviewing models. If none, a scene will be created on review." ) ) ;
94
-
95
- exportSettings . turntableScene = EditorGUILayout . ObjectField (
96
- exportSettings . turntableScene , typeof ( SceneAsset ) , false
97
- ) ;
98
-
99
88
GUILayout . EndHorizontal ( ) ;
100
89
101
90
EditorGUILayout . Space ( ) ;
@@ -114,23 +103,46 @@ public override void OnInspectorGUI() {
114
103
int oldValue = exportSettings . selectedMayaApp ;
115
104
exportSettings . selectedMayaApp = EditorGUILayout . Popup ( exportSettings . selectedMayaApp , options ) ;
116
105
if ( exportSettings . selectedMayaApp == options . Length - 1 ) {
117
- var ext = "exe" ;
118
- #if UNITY_EDITOR_OSX
119
- ext = "app" ;
120
- #endif
106
+ var ext = "" ;
107
+ switch ( Application . platform ) {
108
+ case RuntimePlatform . WindowsEditor :
109
+ ext = "exe" ;
110
+ break ;
111
+ case RuntimePlatform . OSXEditor :
112
+ ext = "app" ;
113
+ break ;
114
+ default :
115
+ throw new NotImplementedException ( ) ;
116
+ }
121
117
string mayaPath = EditorUtility . OpenFilePanel ( "Select Maya Application" , ExportSettings . kDefaultAdskRoot , ext ) ;
122
118
123
119
// check that the path is valid and references the maya executable
124
120
if ( ! string . IsNullOrEmpty ( mayaPath ) ) {
121
+ var md = Directory . GetParent ( mayaPath ) ;
122
+ if ( md . Parent . Name . ToLower ( ) . StartsWith ( "mayalt" ) ) {
123
+ Debug . LogError ( string . Format ( "Unity Integration does not support Maya LT: \" {0}\" " , md . FullName ) ) ;
124
+ exportSettings . selectedMayaApp = oldValue ;
125
+ return ;
126
+ }
127
+
125
128
if ( ! Path . GetFileNameWithoutExtension ( mayaPath ) . ToLower ( ) . Equals ( "maya" ) ) {
126
129
// clicked on the wrong application, try to see if we can still find
127
130
// maya in this directory.
128
131
var mayaDir = new DirectoryInfo ( Path . GetDirectoryName ( mayaPath ) ) ;
129
- #if UNITY_EDITOR_OSX
130
- var files = mayaDir . GetDirectories ( "*." + ext ) ;
131
- #else
132
- var files = mayaDir . GetFiles ( "*." + ext ) ;
133
- #endif
132
+
133
+ FileSystemInfo [ ] files = null ;
134
+
135
+ switch ( Application . platform ) {
136
+ case RuntimePlatform . WindowsEditor :
137
+ files = mayaDir . GetFiles ( "*." + ext ) ;
138
+ break ;
139
+ case RuntimePlatform . OSXEditor :
140
+ files = mayaDir . GetDirectories ( "*." + ext ) ;
141
+ break ;
142
+ default :
143
+ throw new NotImplementedException ( ) ;
144
+ }
145
+
134
146
bool foundMaya = false ;
135
147
foreach ( var file in files ) {
136
148
var filename = Path . GetFileNameWithoutExtension ( file . Name ) . ToLower ( ) ;
@@ -181,15 +193,18 @@ public class ExportSettings : ScriptableSingleton<ExportSettings>
181
193
/// The path where all the different versions of Maya are installed
182
194
/// by default. Depends on the platform.
183
195
/// </summary>
184
- public const string kDefaultAdskRoot =
185
- #if UNITY_EDITOR_OSX
186
- "/Applications/Autodesk"
187
- #elif UNITY_EDITOR_LINUX
188
- "/usr/autodesk"
189
- #else // WINDOWS
190
- "C:/Program Files/Autodesk"
191
- #endif
192
- ;
196
+ public static string kDefaultAdskRoot {
197
+ get {
198
+ switch ( Application . platform ) {
199
+ case RuntimePlatform . WindowsEditor :
200
+ return "C:/Program Files/Autodesk" ;
201
+ case RuntimePlatform . OSXEditor :
202
+ return "/Applications/Autodesk" ;
203
+ default :
204
+ throw new NotImplementedException ( ) ;
205
+ }
206
+ }
207
+ }
193
208
194
209
// Note: default values are set in LoadDefaults().
195
210
public bool mayaCompatibleNames ;
@@ -204,9 +219,6 @@ public class ExportSettings : ScriptableSingleton<ExportSettings>
204
219
205
220
public int selectedMayaApp = 0 ;
206
221
207
- [ SerializeField ]
208
- public UnityEngine . Object turntableScene ;
209
-
210
222
/// <summary>
211
223
/// The path where Convert To Model will save the new fbx and prefab.
212
224
///
@@ -233,7 +245,6 @@ protected override void LoadDefaults()
233
245
centerObjects = true ;
234
246
keepOriginalAfterConvert = false ;
235
247
convertToModelSavePath = kDefaultSavePath ;
236
- turntableScene = null ;
237
248
mayaOptionPaths = null ;
238
249
mayaOptionNames = null ;
239
250
}
@@ -317,23 +328,24 @@ private static void FindMayaInstalls() {
317
328
/// <param name="location">Location of Maya install.</param>
318
329
private static string GetMayaExePath ( string location )
319
330
{
320
- #if UNITY_EDITOR_OSX
321
- // MAYA_LOCATION on mac is set by Autodesk to be the
322
- // Contents directory. But let's make it easier on people
323
- // and allow just having it be the app bundle or a
324
- // directory that holds the app bundle.
325
- if ( location . EndsWith ( ".app/Contents" ) ) {
326
- return location + "/MacOS/Maya" ;
327
- } else if ( location . EndsWith ( ".app" ) ) {
328
- return location + "/Contents/MacOS/Maya" ;
329
- } else {
330
- return location + "/Maya.app/Contents/MacOS/Maya" ;
331
+ switch ( Application . platform ) {
332
+ case RuntimePlatform . WindowsEditor :
333
+ return location + "/bin/maya.exe" ;
334
+ case RuntimePlatform . OSXEditor :
335
+ // MAYA_LOCATION on mac is set by Autodesk to be the
336
+ // Contents directory. But let's make it easier on people
337
+ // and allow just having it be the app bundle or a
338
+ // directory that holds the app bundle.
339
+ if ( location . EndsWith ( ".app/Contents" ) ) {
340
+ return location + "/MacOS/Maya" ;
341
+ } else if ( location . EndsWith ( ".app" ) ) {
342
+ return location + "/Contents/MacOS/Maya" ;
343
+ } else {
344
+ return location + "/Maya.app/Contents/MacOS/Maya" ;
345
+ }
346
+ default :
347
+ throw new NotImplementedException ( ) ;
331
348
}
332
- #elif UNITY_EDITOR_LINUX
333
- return location + "/bin/maya" ;
334
- #else // WINDOWS
335
- return location + "/bin/maya.exe" ;
336
- #endif
337
349
}
338
350
339
351
public static GUIContent [ ] GetMayaOptions ( ) {
@@ -373,9 +385,9 @@ public static GUIContent[] GetMayaOptions(){
373
385
374
386
public static void AddMayaOption ( string newOption ) {
375
387
// on OSX we get a path ending in .app, which is not quite the exe
376
- # if UNITY_EDITOR_OSX
377
- newOption = GetMayaExePath ( newOption ) ;
378
- #endif
388
+ if ( Application . platform == RuntimePlatform . OSXEditor ) {
389
+ newOption = GetMayaExePath ( newOption ) ;
390
+ }
379
391
380
392
var mayaOptionPaths = instance . mayaOptionPaths ;
381
393
if ( mayaOptionPaths . Contains ( newOption ) ) {
@@ -417,20 +429,6 @@ public static string GetSelectedMayaPath()
417
429
return instance . mayaOptionPaths [ instance . selectedMayaApp ] ;
418
430
}
419
431
420
- public static string GetTurnTableSceneName ( ) {
421
- if ( instance . turntableScene ) {
422
- return instance . turntableScene . name ;
423
- }
424
- return null ;
425
- }
426
-
427
- public static string GetTurnTableScenePath ( ) {
428
- if ( instance . turntableScene ) {
429
- return AssetDatabase . GetAssetPath ( instance . turntableScene ) ;
430
- }
431
- return null ;
432
- }
433
-
434
432
/// <summary>
435
433
/// The path where Convert To Model will save the new fbx and prefab.
436
434
/// This is relative to the Application.dataPath ; it uses '/' as the
0 commit comments