@@ -104,6 +104,38 @@ public override void OnInspectorGUI() {
104
104
}
105
105
GUILayout . EndHorizontal ( ) ;
106
106
107
+ GUILayout . BeginHorizontal ( ) ;
108
+ GUILayout . Label ( new GUIContent (
109
+ "Integrations Path:" ,
110
+ "Installation path for 3D application integrations." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
111
+
112
+ var IntegrationsPathLabel = ExportSettings . GetIntegrationSavePath ( ) ;
113
+ EditorGUILayout . SelectableLabel ( IntegrationsPathLabel ,
114
+ EditorStyles . textField ,
115
+ GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
116
+ GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
117
+
118
+ if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new installation path for 3D application integrations" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
119
+ {
120
+ string initialPath = ExportSettings . GetIntegrationSavePath ( ) ;
121
+
122
+ string fullPath = EditorUtility . OpenFolderPanel (
123
+ "Select Integrations Path" , initialPath , null
124
+ ) ;
125
+
126
+ if ( ! string . IsNullOrEmpty ( fullPath ) )
127
+ {
128
+ ExportSettings . SetIntegrationSavePath ( fullPath ) ;
129
+
130
+ // Make sure focus is removed from the selectable label
131
+ // otherwise it won't update
132
+ GUIUtility . hotControl = 0 ;
133
+ GUIUtility . keyboardControl = 0 ;
134
+ }
135
+ }
136
+
137
+ GUILayout . EndHorizontal ( ) ;
138
+
107
139
EditorGUILayout . Space ( ) ;
108
140
109
141
GUILayout . BeginHorizontal ( ) ;
@@ -272,6 +304,8 @@ public static string[] DCCVendorLocations {
272
304
public bool launchAfterInstallation ;
273
305
public int ExportFormatSelection ;
274
306
307
+ public string IntegrationSavePath ;
308
+
275
309
public int selectedDCCApp = 0 ;
276
310
277
311
/// <summary>
@@ -301,6 +335,7 @@ protected override void LoadDefaults()
301
335
launchAfterInstallation = true ;
302
336
ExportFormatSelection = 0 ;
303
337
convertToModelSavePath = kDefaultSavePath ;
338
+ IntegrationSavePath = Directory . GetCurrentDirectory ( ) . ToString ( ) ;
304
339
dccOptionPaths = null ;
305
340
dccOptionNames = null ;
306
341
}
@@ -726,6 +761,22 @@ public static void SetRelativeSavePath(string newPath) {
726
761
instance . convertToModelSavePath = NormalizePath ( newPath , isRelative : true ) ;
727
762
}
728
763
764
+ public static string GetIntegrationSavePath ( )
765
+ {
766
+ //If the save path gets messed up and ends up not being valid, just use the project folder as the default
767
+ if ( string . IsNullOrEmpty ( instance . IntegrationSavePath . Trim ( ) ) || ! Directory . Exists ( instance . IntegrationSavePath ) )
768
+ {
769
+ //The project folder, above the asset folder
770
+ Directory . GetCurrentDirectory ( ) . ToString ( ) ;
771
+ }
772
+ return instance . IntegrationSavePath ;
773
+ }
774
+
775
+ public static void SetIntegrationSavePath ( string newPath )
776
+ {
777
+ instance . IntegrationSavePath = newPath ;
778
+ }
779
+
729
780
/// <summary>
730
781
/// Convert an absolute path into a relative path like what you would
731
782
/// get from GetRelativeSavePath.
0 commit comments