Skip to content

Commit a9ff2fd

Browse files
authored
Merge pull request #238 from Unity-Technologies/UNI-32157-fix-empty-vendor-location-folder-error
Uni 32157 fix empty vendor location folder error
2 parents 8a0f92a + 9d0d142 commit a9ff2fd

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ public override void OnInspectorGUI() {
178178

179179
EditorGUILayout.Space();
180180

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

189191
GUILayout.FlexibleSpace ();
190192
GUILayout.EndScrollView ();
@@ -599,9 +601,8 @@ public static GUIContent[] GetDCCOptions(){
599601
instance.dccOptionNames = new List<string> ();
600602
FindDCCInstalls ();
601603
}
602-
603-
// store the selected app
604-
var prevSelection = instance.dccOptionPaths[instance.selectedDCCApp];
604+
// store the selected app if any
605+
string prevSelection = GetSelectedDCCPath();
605606

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

725726
public static string GetSelectedDCCPath()
726727
{
727-
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
728+
return (instance.dccOptionPaths.Count>0 &&
729+
instance.selectedDCCApp >= 0 &&
730+
instance.selectedDCCApp < instance.dccOptionPaths.Count) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
728731
}
729732

730733
public static string GetSelectedDCCName()
731734
{
732-
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
735+
return (instance.dccOptionNames.Count>0 &&
736+
instance.selectedDCCApp >= 0 &&
737+
instance.selectedDCCApp < instance.dccOptionNames.Count) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
738+
}
739+
740+
public static bool CanInstall()
741+
{
742+
return instance.dccOptionPaths.Count > 0;
733743
}
734744

735745
/// <summary>

0 commit comments

Comments
 (0)