Skip to content

Commit 50b5e56

Browse files
committed
ensure that the browser always opens to a valid path
Also, default to a path that we know exists (the Asset root)
1 parent 64f98d9 commit 50b5e56

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ public override void OnInspectorGUI() {
5454

5555
if (GUILayout.Button ("Browse", EditorStyles.miniButton, GUILayout.Width (BrowseButtonWidth))) {
5656
string initialPath = ExportSettings.GetAbsoluteSavePath();
57+
58+
// if the directory doesn't exist, set it to the default save path
59+
// so we don't open somewhere unexpected
60+
if (!System.IO.Directory.Exists (initialPath)) {
61+
initialPath = Application.dataPath;
62+
}
63+
5764
string fullPath = EditorUtility.OpenFolderPanel (
5865
"Select Model Prefabs Path", initialPath, null
5966
);
@@ -99,7 +106,7 @@ public override void OnInspectorGUI() {
99106
[FilePath("ProjectSettings/FbxExportSettings.asset",FilePathAttribute.Location.ProjectFolder)]
100107
public class ExportSettings : ScriptableSingleton<ExportSettings>
101108
{
102-
public const string kDefaultSavePath = "Objects";
109+
public const string kDefaultSavePath = ".";
103110

104111
// Note: default values are set in LoadDefaults().
105112
public bool weldVertices;

0 commit comments

Comments
 (0)