Skip to content

Commit 6b343cd

Browse files
author
AJubrey
committed
[CHANGED] moved the browse button out of the dropdown menu
1 parent 3acb38b commit 6b343cd

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override void OnInspectorGUI() {
2727
GUILayout.Label ("Version: " + version, EditorStyles.centeredGreyMiniLabel);
2828
EditorGUILayout.Space ();
2929
}
30-
30+
GUILayout.BeginVertical();
3131
exportSettings.mayaCompatibleNames = EditorGUILayout.Toggle (
3232
new GUIContent ("Convert to Maya Compatible Naming:",
3333
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
@@ -49,7 +49,6 @@ public override void OnInspectorGUI() {
4949
GUILayout.Label (new GUIContent (
5050
"Export Path:",
5151
"Relative path for saving Model Prefabs."));
52-
5352
var pathLabel = ExportSettings.GetRelativeSavePath();
5453
if (pathLabel == ".") { pathLabel = "(Assets root)"; }
5554
EditorGUILayout.SelectableLabel(pathLabel,
@@ -93,17 +92,13 @@ public override void OnInspectorGUI() {
9392
GUILayout.Label (new GUIContent (
9493
"3D Application:",
9594
"Select the 3D Application for which you would like to install the Unity integration."));
96-
95+
9796
// dropdown to select Maya version to use
9897
var options = ExportSettings.GetDCCOptions();
99-
// make sure we never initially have browse selected
100-
if (exportSettings.selectedDCCApp == options.Length - 1) {
101-
exportSettings.selectedDCCApp = exportSettings.GetPreferredDCCApp();
102-
}
10398

10499
int oldValue = exportSettings.selectedDCCApp;
105100
exportSettings.selectedDCCApp = EditorGUILayout.Popup(exportSettings.selectedDCCApp, options);
106-
if (exportSettings.selectedDCCApp == options.Length - 1) {
101+
if (GUILayout.Button("Browse", EditorStyles.miniButton, GUILayout.Width(BrowseButtonWidth))) {
107102
var ext = "";
108103
switch (Application.platform) {
109104
case RuntimePlatform.WindowsEditor:
@@ -149,8 +144,6 @@ public override void OnInspectorGUI() {
149144
ExportSettings.AddDCCOption (dccPath, foundDCC);
150145
}
151146
Repaint ();
152-
} else {
153-
exportSettings.selectedDCCApp = oldValue;
154147
}
155148
}
156149
GUILayout.EndHorizontal ();
@@ -164,6 +157,7 @@ public override void OnInspectorGUI() {
164157

165158
GUILayout.FlexibleSpace ();
166159
GUILayout.EndScrollView ();
160+
GUILayout.EndVertical();
167161

168162
if (GUI.changed) {
169163
EditorUtility.SetDirty (exportSettings);
@@ -550,19 +544,17 @@ public static GUIContent[] GetDCCOptions(){
550544

551545
if (instance.dccOptionPaths.Count <= 0) {
552546
return new GUIContent[]{
553-
new GUIContent("<No 3D Application found>"),
554-
new GUIContent("Browse...")
547+
new GUIContent("<No 3D Application found>")
555548
};
556549
}
557550

558-
GUIContent[] optionArray = new GUIContent[instance.dccOptionPaths.Count+1];
551+
GUIContent[] optionArray = new GUIContent[instance.dccOptionPaths.Count];
559552
for(int i = 0; i < instance.dccOptionPaths.Count; i++){
560553
optionArray [i] = new GUIContent(
561554
instance.dccOptionNames[i],
562555
instance.dccOptionPaths[i]
563556
);
564557
}
565-
optionArray [optionArray.Length - 1] = new GUIContent("Browse...");
566558

567559
return optionArray;
568560
}

0 commit comments

Comments
 (0)