Skip to content

Commit

Permalink
Merge pull request #238 from Unity-Technologies/UNI-32157-fix-empty-v…
Browse files Browse the repository at this point in the history
…endor-location-folder-error

Uni 32157 fix empty vendor location folder error
  • Loading branch information
vkovec authored Dec 1, 2017
2 parents 8a0f92a + 9d0d142 commit a9ff2fd
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Assets/FbxExporters/Editor/FbxExportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,15 @@ public override void OnInspectorGUI() {

EditorGUILayout.Space();


// disable button if no 3D application is available
EditorGUI.BeginDisabledGroup (!ExportSettings.CanInstall());
var installIntegrationContent = new GUIContent(
"Install Unity Integration",
"Install and configure the Unity integration for the selected 3D application so that you can import and export directly with this project.");
if (GUILayout.Button (installIntegrationContent)) {
FbxExporters.Editor.IntegrationsUI.InstallDCCIntegration ();
}
EditorGUI.EndDisabledGroup ();

GUILayout.FlexibleSpace ();
GUILayout.EndScrollView ();
Expand Down Expand Up @@ -599,9 +601,8 @@ public static GUIContent[] GetDCCOptions(){
instance.dccOptionNames = new List<string> ();
FindDCCInstalls ();
}

// store the selected app
var prevSelection = instance.dccOptionPaths[instance.selectedDCCApp];
// store the selected app if any
string prevSelection = GetSelectedDCCPath();

// remove options that no longer exist
List<string> pathsToDelete = new List<string>();
Expand Down Expand Up @@ -724,12 +725,21 @@ public static bool IsEarlierThanMax2017(string AppName){

public static string GetSelectedDCCPath()
{
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
return (instance.dccOptionPaths.Count>0 &&
instance.selectedDCCApp >= 0 &&
instance.selectedDCCApp < instance.dccOptionPaths.Count) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
}

public static string GetSelectedDCCName()
{
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
return (instance.dccOptionNames.Count>0 &&
instance.selectedDCCApp >= 0 &&
instance.selectedDCCApp < instance.dccOptionNames.Count) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
}

public static bool CanInstall()
{
return instance.dccOptionPaths.Count > 0;
}

/// <summary>
Expand Down

0 comments on commit a9ff2fd

Please sign in to comment.