@@ -10,9 +10,11 @@ namespace FbxExporters.EditorTools {
10
10
[ CustomEditor ( typeof ( ExportSettings ) ) ]
11
11
public class ExportSettingsEditor : UnityEditor . Editor {
12
12
Vector2 scrollPos = Vector2 . zero ;
13
- const float LabelWidth = 130 ;
13
+ const float LabelWidth = 144 ;
14
14
const float SelectableLabelMinWidth = 90 ;
15
15
const float BrowseButtonWidth = 25 ;
16
+ const float FieldOffset = 18 ;
17
+ const float BrowseButtonOffset = 5 ;
16
18
17
19
public override void OnInspectorGUI ( ) {
18
20
ExportSettings exportSettings = ( ExportSettings ) target ;
@@ -27,6 +29,8 @@ public override void OnInspectorGUI() {
27
29
GUILayout . Label ( "Version: " + version , EditorStyles . centeredGreyMiniLabel ) ;
28
30
EditorGUILayout . Space ( ) ;
29
31
}
32
+ EditorGUILayout . LabelField ( "Export Options" , EditorStyles . boldLabel ) ;
33
+ EditorGUI . indentLevel ++ ;
30
34
GUILayout . BeginVertical ( ) ;
31
35
exportSettings . mayaCompatibleNames = EditorGUILayout . Toggle (
32
36
new GUIContent ( "Compatible Naming:" ,
@@ -45,47 +49,53 @@ public override void OnInspectorGUI() {
45
49
exportSettings . centerObjects
46
50
) ;
47
51
48
- EditorGUILayout . Space ( ) ;
49
-
50
52
GUILayout . BeginHorizontal ( ) ;
51
- GUILayout . Label ( new GUIContent ( "Export Format:" , "Export the FBX file in the standard binary format." +
52
- " Select ASCII to export the FBX file in ASCII format." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
53
+ EditorGUILayout . LabelField ( new GUIContent ( "Export Format:" , "Export the FBX file in the standard binary format." +
54
+ " Select ASCII to export the FBX file in ASCII format." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
53
55
exportSettings . ExportFormatSelection = EditorGUILayout . Popup ( exportSettings . ExportFormatSelection , new string [ ] { "Binary" , "ASCII" } ) ;
54
56
GUILayout . EndHorizontal ( ) ;
55
57
56
- EditorGUILayout . Space ( ) ;
57
-
58
- GUILayout . BeginHorizontal ( ) ;
59
- GUILayout . Label ( new GUIContent (
58
+ GUILayout . BeginHorizontal ( ) ;
59
+ EditorGUILayout . LabelField ( new GUIContent (
60
60
"Export Path:" ,
61
- "Relative path for saving Model Prefabs." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
61
+ "Relative path for saving Model Prefabs." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
62
62
63
63
var pathLabel = ExportSettings . GetRelativeSavePath ( ) ;
64
64
if ( pathLabel == "." ) { pathLabel = "(Assets root)" ; }
65
65
EditorGUILayout . SelectableLabel ( pathLabel ,
66
66
EditorStyles . textField ,
67
67
GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
68
68
GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
69
+ GUILayout . EndHorizontal ( ) ;
70
+ GUILayout . BeginHorizontal ( ) ;
69
71
70
- if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new location for saving model prefabs" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
72
+ GUILayout . Space ( LabelWidth + BrowseButtonOffset ) ;
73
+
74
+ if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new location for saving model prefabs" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
75
+ {
71
76
string initialPath = ExportSettings . GetAbsoluteSavePath ( ) ;
72
77
73
78
// if the directory doesn't exist, set it to the default save path
74
79
// so we don't open somewhere unexpected
75
- if ( ! System . IO . Directory . Exists ( initialPath ) ) {
80
+ if ( ! System . IO . Directory . Exists ( initialPath ) )
81
+ {
76
82
initialPath = Application . dataPath ;
77
83
}
78
84
79
- string fullPath = EditorUtility . OpenFolderPanel (
85
+ string fullPath = EditorUtility . OpenFolderPanel (
80
86
"Select Model Prefabs Path" , initialPath , null
81
87
) ;
82
88
83
89
// Unless the user canceled, make sure they chose something in the Assets folder.
84
- if ( ! string . IsNullOrEmpty ( fullPath ) ) {
90
+ if ( ! string . IsNullOrEmpty ( fullPath ) )
91
+ {
85
92
var relativePath = ExportSettings . ConvertToAssetRelativePath ( fullPath ) ;
86
- if ( string . IsNullOrEmpty ( relativePath ) ) {
87
- Debug . LogWarning ( "Please select a location in the Assets folder" ) ;
88
- } else {
93
+ if ( string . IsNullOrEmpty ( relativePath ) )
94
+ {
95
+ Debug . LogWarning ( "Please select a location in the Assets folder" ) ;
96
+ }
97
+ else
98
+ {
89
99
ExportSettings . SetRelativeSavePath ( relativePath ) ;
90
100
91
101
// Make sure focus is removed from the selectable label
@@ -95,18 +105,28 @@ public override void OnInspectorGUI() {
95
105
}
96
106
}
97
107
}
98
- GUILayout . EndHorizontal ( ) ;
108
+ GUILayout . EndHorizontal ( ) ;
109
+
110
+ EditorGUILayout . Space ( ) ;
111
+ EditorGUILayout . Space ( ) ;
112
+ EditorGUI . indentLevel -- ;
113
+ EditorGUILayout . LabelField ( "Integration" , EditorStyles . boldLabel ) ;
114
+ EditorGUI . indentLevel ++ ;
99
115
100
116
GUILayout . BeginHorizontal ( ) ;
101
- GUILayout . Label ( new GUIContent (
117
+ EditorGUILayout . LabelField ( new GUIContent (
102
118
"Integrations Path:" ,
103
- "Installation path for 3D application integrations." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
119
+ "Installation path for 3D application integrations." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
104
120
105
121
var IntegrationsPathLabel = ExportSettings . GetIntegrationSavePath ( ) ;
106
122
EditorGUILayout . SelectableLabel ( IntegrationsPathLabel ,
107
123
EditorStyles . textField ,
108
124
GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
109
125
GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
126
+ GUILayout . EndHorizontal ( ) ;
127
+ GUILayout . BeginHorizontal ( ) ;
128
+
129
+ GUILayout . Space ( LabelWidth + BrowseButtonOffset ) ;
110
130
111
131
if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new installation path for 3D application integrations" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
112
132
{
@@ -129,17 +149,21 @@ public override void OnInspectorGUI() {
129
149
130
150
GUILayout . EndHorizontal ( ) ;
131
151
132
- EditorGUILayout . Space ( ) ;
133
-
134
152
GUILayout . BeginHorizontal ( ) ;
135
- GUILayout . Label ( new GUIContent (
153
+ EditorGUILayout . LabelField ( new GUIContent (
136
154
"3D Application:" ,
137
- "Select the 3D Application for which you would like to install the Unity integration." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
155
+ "Select the 3D Application for which you would like to install the Unity integration." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
138
156
139
157
// dropdown to select Maya version to use
140
158
var options = ExportSettings . GetDCCOptions ( ) ;
141
159
142
160
exportSettings . selectedDCCApp = EditorGUILayout . Popup ( exportSettings . selectedDCCApp , options ) ;
161
+
162
+ GUILayout . EndHorizontal ( ) ;
163
+ GUILayout . BeginHorizontal ( ) ;
164
+
165
+ GUILayout . Space ( LabelWidth + BrowseButtonOffset ) ;
166
+
143
167
if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a 3D application in a non-default location" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
144
168
var ext = "" ;
145
169
switch ( Application . platform ) {
0 commit comments