@@ -27,7 +27,7 @@ public override void OnInspectorGUI() {
27
27
GUILayout . Label ( "Version: " + version , EditorStyles . centeredGreyMiniLabel ) ;
28
28
EditorGUILayout . Space ( ) ;
29
29
}
30
-
30
+ GUILayout . BeginVertical ( ) ;
31
31
exportSettings . mayaCompatibleNames = EditorGUILayout . Toggle (
32
32
new GUIContent ( "Convert to Maya Compatible Naming:" ,
33
33
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
@@ -49,7 +49,6 @@ public override void OnInspectorGUI() {
49
49
GUILayout . Label ( new GUIContent (
50
50
"Export Path:" ,
51
51
"Relative path for saving Model Prefabs." ) ) ;
52
-
53
52
var pathLabel = ExportSettings . GetRelativeSavePath ( ) ;
54
53
if ( pathLabel == "." ) { pathLabel = "(Assets root)" ; }
55
54
EditorGUILayout . SelectableLabel ( pathLabel ,
@@ -93,17 +92,12 @@ public override void OnInspectorGUI() {
93
92
GUILayout . Label ( new GUIContent (
94
93
"3D Application:" ,
95
94
"Select the 3D Application for which you would like to install the Unity integration." ) ) ;
96
-
95
+
97
96
// dropdown to select Maya version to use
98
97
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
- }
103
98
104
- int oldValue = exportSettings . selectedDCCApp ;
105
99
exportSettings . selectedDCCApp = EditorGUILayout . Popup ( exportSettings . selectedDCCApp , options ) ;
106
- if ( exportSettings . selectedDCCApp == options . Length - 1 ) {
100
+ if ( GUILayout . Button ( "Browse" , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
107
101
var ext = "" ;
108
102
switch ( Application . platform ) {
109
103
case RuntimePlatform . WindowsEditor :
@@ -129,7 +123,6 @@ public override void OnInspectorGUI() {
129
123
// Therefore check both executable folder (for Mac) and its parent (for Windows)
130
124
if ( md . Name . ToLower ( ) . StartsWith ( "mayalt" ) || md . Parent . Name . ToLower ( ) . StartsWith ( "mayalt" ) ) {
131
125
Debug . LogError ( string . Format ( "Unity Integration does not support Maya LT: \" {0}\" " , md . FullName ) ) ;
132
- exportSettings . selectedDCCApp = oldValue ;
133
126
return ;
134
127
}
135
128
@@ -143,14 +136,11 @@ public override void OnInspectorGUI() {
143
136
}
144
137
if ( foundDCCPath == null ) {
145
138
Debug . LogError ( string . Format ( "Could not find supported 3D application at: \" {0}\" " , Path . GetDirectoryName ( dccPath ) ) ) ;
146
- exportSettings . selectedDCCApp = oldValue ;
147
139
} else {
148
140
dccPath = foundDCCPath ;
149
141
ExportSettings . AddDCCOption ( dccPath , foundDCC ) ;
150
142
}
151
143
Repaint ( ) ;
152
- } else {
153
- exportSettings . selectedDCCApp = oldValue ;
154
144
}
155
145
}
156
146
GUILayout . EndHorizontal ( ) ;
@@ -164,6 +154,7 @@ public override void OnInspectorGUI() {
164
154
165
155
GUILayout . FlexibleSpace ( ) ;
166
156
GUILayout . EndScrollView ( ) ;
157
+ GUILayout . EndVertical ( ) ;
167
158
168
159
if ( GUI . changed ) {
169
160
EditorUtility . SetDirty ( exportSettings ) ;
@@ -550,19 +541,17 @@ public static GUIContent[] GetDCCOptions(){
550
541
551
542
if ( instance . dccOptionPaths . Count <= 0 ) {
552
543
return new GUIContent [ ] {
553
- new GUIContent ( "<No 3D Application found>" ) ,
554
- new GUIContent ( "Browse..." )
544
+ new GUIContent ( "<No 3D Application found>" )
555
545
} ;
556
546
}
557
547
558
- GUIContent [ ] optionArray = new GUIContent [ instance . dccOptionPaths . Count + 1 ] ;
548
+ GUIContent [ ] optionArray = new GUIContent [ instance . dccOptionPaths . Count ] ;
559
549
for ( int i = 0 ; i < instance . dccOptionPaths . Count ; i ++ ) {
560
550
optionArray [ i ] = new GUIContent (
561
551
instance . dccOptionNames [ i ] ,
562
552
instance . dccOptionPaths [ i ]
563
553
) ;
564
554
}
565
- optionArray [ optionArray . Length - 1 ] = new GUIContent ( "Browse..." ) ;
566
555
567
556
return optionArray ;
568
557
}
0 commit comments