@@ -310,45 +310,21 @@ private static string GetUniqueName(string name){
310
310
}
311
311
312
312
/// <summary>
313
- /// Find 3DsMax installations at default install path.
314
- /// Add results to given dictionary.
315
- /// </summary>
316
- private static void FindMaxInstalls ( ) {
317
- var maxOptionName = instance . dccOptionNames ;
318
- var maxOptionPath = instance . dccOptionPaths ;
319
-
320
- // List that directory and find the right version:
321
- // either the newest version, or the exact version we wanted.
322
- var adskRoot = new System . IO . DirectoryInfo ( kDefaultAdskRoot ) ;
323
- foreach ( var productDir in adskRoot . GetDirectories ( ) ) {
324
- var product = productDir . Name ;
325
-
326
- // Only accept those that start with 'maya' in either case.
327
- if ( ! product . StartsWith ( "3ds max" , StringComparison . InvariantCultureIgnoreCase ) ) {
328
- continue ;
329
- }
330
- string version = product . Substring ( "3ds max " . Length ) ;
331
- maxOptionPath . Add ( string . Format ( "{0}/{1}" , productDir . FullName . Replace ( "\\ " , "/" ) , "3dsmax.exe" ) ) ;
332
- maxOptionName . Add ( GetUniqueName ( "3ds Max " + version ) ) ;
333
- }
334
- }
335
-
336
- /// <summary>
337
- /// Find Maya installations at default install path.
313
+ /// Find Maya and 3DsMax installations at default install path.
338
314
/// Add results to given dictionary.
339
315
///
340
316
/// If MAYA_LOCATION is set, add this to the list as well.
341
317
/// </summary>
342
- private static void FindMayaInstalls ( ) {
343
- var mayaOptionName = instance . dccOptionNames ;
344
- var mayaOptionPath = instance . dccOptionPaths ;
318
+ private static void FindDCCInstalls ( ) {
319
+ var dccOptionName = instance . dccOptionNames ;
320
+ var dccOptionPath = instance . dccOptionPaths ;
345
321
346
322
// If the location is given by the environment, use it.
347
323
var location = System . Environment . GetEnvironmentVariable ( "MAYA_LOCATION" ) ;
348
324
if ( ! string . IsNullOrEmpty ( location ) ) {
349
325
location = location . TrimEnd ( '/' ) ;
350
- mayaOptionPath . Add ( GetMayaExePath ( location . Replace ( "\\ " , "/" ) ) ) ;
351
- mayaOptionName . Add ( "MAYA_LOCATION" ) ;
326
+ dccOptionPath . Add ( GetMayaExePath ( location . Replace ( "\\ " , "/" ) ) ) ;
327
+ dccOptionName . Add ( "MAYA_LOCATION" ) ;
352
328
}
353
329
354
330
// List that directory and find the right version:
@@ -358,16 +334,21 @@ private static void FindMayaInstalls() {
358
334
var product = productDir . Name ;
359
335
360
336
// Only accept those that start with 'maya' in either case.
361
- if ( ! product . StartsWith ( "maya" , StringComparison . InvariantCultureIgnoreCase ) ) {
362
- continue ;
337
+ if ( product . StartsWith ( "maya" , StringComparison . InvariantCultureIgnoreCase ) ) {
338
+ // Reject MayaLT -- it doesn't have plugins.
339
+ if ( product . StartsWith ( "mayalt" , StringComparison . InvariantCultureIgnoreCase ) ) {
340
+ continue ;
341
+ }
342
+ string version = product . Substring ( "maya" . Length ) ;
343
+ dccOptionPath . Add ( GetMayaExePath ( productDir . FullName . Replace ( "\\ " , "/" ) ) ) ;
344
+ dccOptionName . Add ( GetUniqueName ( "Maya " + version ) ) ;
363
345
}
364
- // Reject MayaLT -- it doesn't have plugins.
365
- if ( product . StartsWith ( "mayalt" , StringComparison . InvariantCultureIgnoreCase ) ) {
366
- continue ;
346
+
347
+ if ( product . StartsWith ( "3ds max" , StringComparison . InvariantCultureIgnoreCase ) ) {
348
+ string version = product . Substring ( "3ds max " . Length ) ;
349
+ dccOptionPath . Add ( string . Format ( "{0}/{1}" , productDir . FullName . Replace ( "\\ " , "/" ) , "3dsmax.exe" ) ) ;
350
+ dccOptionName . Add ( GetUniqueName ( "3ds Max " + version ) ) ;
367
351
}
368
- string version = product . Substring ( "maya" . Length ) ;
369
- mayaOptionPath . Add ( GetMayaExePath ( productDir . FullName . Replace ( "\\ " , "/" ) ) ) ;
370
- mayaOptionName . Add ( GetUniqueName ( "Maya " + version ) ) ;
371
352
}
372
353
}
373
354
@@ -404,8 +385,7 @@ public static GUIContent[] GetDCCOptions(){
404
385
405
386
instance . dccOptionPaths = new List < string > ( ) ;
406
387
instance . dccOptionNames = new List < string > ( ) ;
407
- FindMayaInstalls ( ) ;
408
- FindMaxInstalls ( ) ;
388
+ FindDCCInstalls ( ) ;
409
389
}
410
390
411
391
// remove options that no longer exist
0 commit comments