@@ -261,6 +261,7 @@ public static string[] DCCVendorLocations {
261
261
List < string > locationsList = new List < string > ( ) ;
262
262
List < string > WindowsDefaultLocations = new List < string > ( ) { "C:/Program Files/Autodesk" , "D:/Program Files/Autodesk" } ;
263
263
List < string > OSXDefaultLocations = new List < string > ( ) { "/Applications/Autodesk" } ;
264
+ bool foundVendorLocation = false ;
264
265
265
266
if ( environmentVariable != null )
266
267
{
@@ -275,7 +276,7 @@ public static string[] DCCVendorLocations {
275
276
//If we found anything, just return the list
276
277
if ( locationsList . Count > 0 )
277
278
{
278
- return locationsList . ToArray ( ) ;
279
+ foundVendorLocation = true ;
279
280
}
280
281
}
281
282
@@ -291,16 +292,21 @@ public static string[] DCCVendorLocations {
291
292
//'Directory.GetParent()' will take care of any double backslashes the user may have added
292
293
possibleLocation = Directory . GetParent ( location ) . ToString ( ) ;
293
294
294
- //Make sure the user defined path is not included in the default paths
295
- for ( int i = 0 ; i < WindowsDefaultLocations . Count ; i ++ )
295
+ //We only need to remove duplicates of default locations if we are using the default locations-
296
+ //We only use default locations if we do not use the user specified vendor locations
297
+ if ( ! foundVendorLocation )
296
298
{
297
- //we don't want a minute difference in slashes or capitalization to throw off our check
298
- if ( WindowsDefaultLocations [ i ] != null &&
299
- possibleLocation != null &&
300
- WindowsDefaultLocations [ i ] . Replace ( "\\ " , "/" ) . ToLower ( ) . Equals ( possibleLocation . Replace ( "\\ " , "/" ) . ToLower ( ) ) )
299
+ //Make sure the user defined path is not included in the default paths
300
+ for ( int i = 0 ; i < WindowsDefaultLocations . Count ; i ++ )
301
301
{
302
- possibleLocation = null ;
303
- break ;
302
+ //we don't want a minute difference in slashes or capitalization to throw off our check
303
+ if ( WindowsDefaultLocations [ i ] != null &&
304
+ possibleLocation != null &&
305
+ WindowsDefaultLocations [ i ] . Replace ( "\\ " , "/" ) . ToLower ( ) . Equals ( possibleLocation . Replace ( "\\ " , "/" ) . ToLower ( ) ) )
306
+ {
307
+ possibleLocation = null ;
308
+ break ;
309
+ }
304
310
}
305
311
}
306
312
}
@@ -309,6 +315,12 @@ public static string[] DCCVendorLocations {
309
315
{
310
316
//We can assume our path is: /Applications/Autodesk/maya2017/Maya.app/Contents
311
317
//So we need to go up three folders.
318
+
319
+ //Remove any extra slashes on the end
320
+ //Maya would accept a single slash in either direction, so we should be able to
321
+ location . TrimEnd ( '/' ) ;
322
+ location . TrimEnd ( '\\ ' ) ;
323
+
312
324
var appFolder = Directory . GetParent ( location ) ;
313
325
if ( appFolder != null )
314
326
{
@@ -345,6 +357,11 @@ public static string[] DCCVendorLocations {
345
357
}
346
358
}
347
359
360
+ if ( foundVendorLocation )
361
+ {
362
+ return locationsList . ToArray ( ) ;
363
+ }
364
+
348
365
switch ( Application . platform )
349
366
{
350
367
case RuntimePlatform . WindowsEditor :
0 commit comments