Skip to content

Commit 349ce85

Browse files
author
AJubrey
committed
[ADDED] a function to find the first valid vendor location, such that browsing for one will start you in a vendor folder if you have one (else you start in the project folder)
1 parent 46b8473 commit 349ce85

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public override void OnInspectorGUI() {
111111
throw new System.NotImplementedException ();
112112
}
113113

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.GetFirstValidVendorLocation(), ext);
115115

116116
// check that the path is valid and references the maya executable
117117
if (!string.IsNullOrEmpty (dccPath)) {
@@ -511,6 +511,25 @@ private static void FindDCCInstalls() {
511511
instance.selectedDCCApp = instance.GetPreferredDCCApp();
512512
}
513513

514+
/// <summary>
515+
/// Returns the first valid folder in our list of vendor locations
516+
/// </summary>
517+
/// <returns>The first valid vendor location</returns>
518+
public static string GetFirstValidVendorLocation()
519+
{
520+
string[] locations = DCCVendorLocations;
521+
for (int i = 0; i < locations.Length; i++)
522+
{
523+
//Look through the list of locations we have and take the first valid one
524+
if (Directory.Exists(locations[i]))
525+
{
526+
return locations[i];
527+
}
528+
}
529+
//if no valid locations exist, just take us to the project folder
530+
return Directory.GetCurrentDirectory();
531+
}
532+
514533
/// <summary>
515534
/// Gets the maya exe at Maya install location.
516535
/// </summary>

0 commit comments

Comments
 (0)