@@ -10,9 +10,9 @@ 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 = 225 ;
14
- const float SelectableLabelMinWidth = 100 ;
15
- const float BrowseButtonWidth = 55 ;
13
+ const float LabelWidth = 130 ;
14
+ const float SelectableLabelMinWidth = 90 ;
15
+ const float BrowseButtonWidth = 25 ;
16
16
17
17
public override void OnInspectorGUI ( ) {
18
18
ExportSettings exportSettings = ( ExportSettings ) target ;
@@ -27,9 +27,9 @@ 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
- new GUIContent ( "Convert to Maya Compatible Naming:" ,
32
+ new GUIContent ( "Compatible Naming:" ,
33
33
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
34
34
"(e.g. \" foo bar\" becomes \" fooFBXASC032bar\" ). " +
35
35
"On export, convert the names of GameObjects so they are Maya compatible." +
@@ -48,7 +48,7 @@ public override void OnInspectorGUI() {
48
48
GUILayout . BeginHorizontal ( ) ;
49
49
GUILayout . Label ( new GUIContent (
50
50
"Export Path:" ,
51
- "Relative path for saving Model Prefabs." ) ) ;
51
+ "Relative path for saving Model Prefabs." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
52
52
53
53
var pathLabel = ExportSettings . GetRelativeSavePath ( ) ;
54
54
if ( pathLabel == "." ) { pathLabel = "(Assets root)" ; }
@@ -57,7 +57,7 @@ public override void OnInspectorGUI() {
57
57
GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
58
58
GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
59
59
60
- if ( GUILayout . Button ( " Browse" , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
60
+ if ( GUILayout . Button ( new GUIContent ( "..." , " Browse to a new location for saving model prefabs" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
61
61
string initialPath = ExportSettings . GetAbsoluteSavePath ( ) ;
62
62
63
63
// if the directory doesn't exist, set it to the default save path
@@ -92,18 +92,13 @@ public override void OnInspectorGUI() {
92
92
GUILayout . BeginHorizontal ( ) ;
93
93
GUILayout . Label ( new GUIContent (
94
94
"3D Application:" ,
95
- "Select the 3D Application for which you would like to install the Unity integration." ) ) ;
96
-
95
+ "Select the 3D Application for which you would like to install the Unity integration." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
96
+
97
97
// dropdown to select Maya version to use
98
98
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
99
104
- int oldValue = exportSettings . selectedDCCApp ;
105
100
exportSettings . selectedDCCApp = EditorGUILayout . Popup ( exportSettings . selectedDCCApp , options ) ;
106
- if ( exportSettings . selectedDCCApp == options . Length - 1 ) {
101
+ if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a 3D application in a non-default location" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) ) {
107
102
var ext = "" ;
108
103
switch ( Application . platform ) {
109
104
case RuntimePlatform . WindowsEditor :
@@ -128,14 +123,11 @@ public override void OnInspectorGUI() {
128
123
}
129
124
if ( foundDCCPath == null ) {
130
125
Debug . LogError ( string . Format ( "Could not find supported 3D application at: \" {0}\" " , Path . GetDirectoryName ( dccPath ) ) ) ;
131
- exportSettings . selectedDCCApp = oldValue ;
132
126
} else {
133
127
dccPath = foundDCCPath ;
134
128
ExportSettings . AddDCCOption ( dccPath , foundDCC ) ;
135
129
}
136
130
Repaint ( ) ;
137
- } else {
138
- exportSettings . selectedDCCApp = oldValue ;
139
131
}
140
132
}
141
133
GUILayout . EndHorizontal ( ) ;
@@ -147,8 +139,15 @@ public override void OnInspectorGUI() {
147
139
FbxExporters . Editor . IntegrationsUI . InstallDCCIntegration ( ) ;
148
140
}
149
141
142
+ exportSettings . launchAfterInstallation = EditorGUILayout . Toggle (
143
+ new GUIContent ( "Launch 3D Application:" ,
144
+ "Launch the selected application after unity integration is completed." ) ,
145
+ exportSettings . launchAfterInstallation
146
+ ) ;
147
+
150
148
GUILayout . FlexibleSpace ( ) ;
151
149
GUILayout . EndScrollView ( ) ;
150
+ GUILayout . EndVertical ( ) ;
152
151
153
152
if ( GUI . changed ) {
154
153
EditorUtility . SetDirty ( exportSettings ) ;
@@ -232,6 +231,7 @@ public static string kDefaultAdskRoot {
232
231
// Note: default values are set in LoadDefaults().
233
232
public bool mayaCompatibleNames ;
234
233
public bool centerObjects ;
234
+ public bool launchAfterInstallation ;
235
235
236
236
public int selectedDCCApp = 0 ;
237
237
@@ -259,6 +259,7 @@ protected override void LoadDefaults()
259
259
{
260
260
mayaCompatibleNames = true ;
261
261
centerObjects = true ;
262
+ launchAfterInstallation = true ;
262
263
convertToModelSavePath = kDefaultSavePath ;
263
264
dccOptionPaths = null ;
264
265
dccOptionNames = null ;
@@ -530,19 +531,17 @@ public static GUIContent[] GetDCCOptions(){
530
531
531
532
if ( instance . dccOptionPaths . Count <= 0 ) {
532
533
return new GUIContent [ ] {
533
- new GUIContent ( "<No 3D Application found>" ) ,
534
- new GUIContent ( "Browse..." )
534
+ new GUIContent ( "<No 3D Application found>" )
535
535
} ;
536
536
}
537
537
538
- GUIContent [ ] optionArray = new GUIContent [ instance . dccOptionPaths . Count + 1 ] ;
538
+ GUIContent [ ] optionArray = new GUIContent [ instance . dccOptionPaths . Count ] ;
539
539
for ( int i = 0 ; i < instance . dccOptionPaths . Count ; i ++ ) {
540
540
optionArray [ i ] = new GUIContent (
541
541
instance . dccOptionNames [ i ] ,
542
542
instance . dccOptionPaths [ i ]
543
543
) ;
544
544
}
545
- optionArray [ optionArray . Length - 1 ] = new GUIContent ( "Browse..." ) ;
546
545
547
546
return optionArray ;
548
547
}
0 commit comments