@@ -111,7 +111,7 @@ public override void OnInspectorGUI() {
111
111
throw new System . NotImplementedException ( ) ;
112
112
}
113
113
114
- string dccPath = EditorUtility . OpenFilePanel ( "Select Digital Content Creation Application" , ExportSettings . DCCVendorLocations ( ) [ 0 ] , ext ) ;
114
+ string dccPath = EditorUtility . OpenFilePanel ( "Select Digital Content Creation Application" , ExportSettings . DCCVendorLocations [ 0 ] , ext ) ;
115
115
116
116
// check that the path is valid and references the maya executable
117
117
if ( ! string . IsNullOrEmpty ( dccPath ) ) {
@@ -229,28 +229,36 @@ public class ExportSettings : ScriptableSingleton<ExportSettings>
229
229
/// The paths where all the different versions of Maya are installed
230
230
/// by default. Depends on the platform.
231
231
/// </summary>
232
- public static string [ ] DCCVendorLocations ( ) {
233
-
234
- if ( Environment . GetEnvironmentVariable ( "UNITY_FBX_3DAPP_VENDOR_LOCATIONS" ) != null )
235
- {
236
- string [ ] locations = Environment . GetEnvironmentVariable ( "UNITY_FBX_3DAPP_VENDOR_LOCATIONS" ) . Split ( ';' ) ;
237
- for ( int i = 0 ; i < locations . Length ; i ++ )
232
+ public static string [ ] DCCVendorLocations {
233
+ get {
234
+ var environmentVariable = Environment . GetEnvironmentVariable ( "UNITY_FBX_3DAPP_VENDOR_LOCATIONS" ) ;
235
+ if ( environmentVariable != null )
238
236
{
239
- if ( Directory . Exists ( locations [ i ] ) )
237
+ string [ ] locations = environmentVariable . Split ( ';' ) ;
238
+ List < string > locationsList = new List < string > ( ) ;
239
+ for ( int i = 0 ; i < locations . Length ; i ++ )
240
+ {
241
+ if ( Directory . Exists ( locations [ i ] ) )
242
+ {
243
+ locationsList . Add ( locations [ i ] ) ;
244
+ }
245
+ }
246
+ if ( locationsList . Count > 0 )
240
247
{
241
- return locations ;
248
+ return locationsList . ToArray ( ) ;
242
249
}
243
250
}
244
- }
245
251
246
- switch ( Application . platform ) {
247
- case RuntimePlatform . WindowsEditor :
248
- return new string [ ] { "C:/Program Files/Autodesk" , "D:/Program Files/Autodesk" } ;
249
- case RuntimePlatform . OSXEditor :
250
- return new string [ ] { "/Applications/Autodesk" } ;
251
- default :
252
- throw new NotImplementedException ( ) ;
253
- }
252
+ switch ( Application . platform )
253
+ {
254
+ case RuntimePlatform . WindowsEditor :
255
+ return new string [ ] { "C:/Program Files/Autodesk" , "D:/Program Files/Autodesk" } ;
256
+ case RuntimePlatform . OSXEditor :
257
+ return new string [ ] { "/Applications/Autodesk" } ;
258
+ default :
259
+ throw new NotImplementedException ( ) ;
260
+ }
261
+ }
254
262
}
255
263
256
264
// Note: default values are set in LoadDefaults().
@@ -455,16 +463,16 @@ private static void FindDCCInstalls() {
455
463
var dccOptionName = instance . dccOptionNames ;
456
464
var dccOptionPath = instance . dccOptionPaths ;
457
465
458
- for ( int i = 0 ; i < DCCVendorLocations ( ) . Length ; i ++ )
466
+ for ( int i = 0 ; i < DCCVendorLocations . Length ; i ++ )
459
467
{
460
- if ( ! Directory . Exists ( DCCVendorLocations ( ) [ 0 ] ) )
468
+ if ( ! Directory . Exists ( DCCVendorLocations [ i ] ) )
461
469
{
462
470
// no autodesk products installed
463
471
continue ;
464
472
}
465
473
// List that directory and find the right version:
466
474
// either the newest version, or the exact version we wanted.
467
- var adskRoot = new System . IO . DirectoryInfo ( DCCVendorLocations ( ) [ i ] ) ;
475
+ var adskRoot = new System . IO . DirectoryInfo ( DCCVendorLocations [ i ] ) ;
468
476
foreach ( var productDir in adskRoot . GetDirectories ( ) )
469
477
{
470
478
var product = productDir . Name ;
@@ -561,6 +569,7 @@ public static GUIContent[] GetDCCOptions(){
561
569
}
562
570
563
571
if ( instance . dccOptionPaths . Count <= 0 ) {
572
+ instance . selectedDCCApp = 0 ;
564
573
return new GUIContent [ ] {
565
574
new GUIContent ( "<No 3D Application found>" )
566
575
} ;
0 commit comments