Skip to content

Commit 229e9c9

Browse files
committed
share GetProjectPath() with all DCCs
move into abstract class so that we can use this for max as well as maya
1 parent 95e3bb6 commit 229e9c9

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public string GetIntegrationZipFullPath()
4141
return Application.dataPath + "/" + IntegrationZipPath;
4242
}
4343

44+
/// <summary>
45+
/// Gets the project path.
46+
/// </summary>
47+
/// <returns>The project path.</returns>
48+
public static string GetProjectPath()
49+
{
50+
return System.IO.Directory.GetParent(Application.dataPath).FullName.Replace("\\","/");
51+
}
52+
4453
/// <summary>
4554
/// Installs the integration using the provided executable.
4655
/// </summary>
@@ -129,11 +138,6 @@ public static string GetAppPath()
129138
return EditorApplication.applicationPath.Replace("\\","/");
130139
}
131140

132-
public static string GetProjectPath()
133-
{
134-
return System.IO.Directory.GetParent(Application.dataPath).FullName.Replace("\\","/");
135-
}
136-
137141
public static string GetPackagePath()
138142
{
139143
return System.IO.Path.Combine(Application.dataPath, PACKAGE_NAME);
@@ -463,7 +467,7 @@ private static string GetInstallScript(){
463467
{
464468
{PluginSourceTag, GetAbsPath(PluginPath) },
465469
{PluginNameTag, PluginName },
466-
{ProjectTag, Application.dataPath },
470+
{ProjectTag, GetProjectPath() },
467471
{ExportSettingsTag, GetAbsPath(ExportSettingsFile) }
468472
};
469473

Assets/Integrations/Autodesk/max/scripts/UnityFbxForMaxPlugin.ms

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ macroScript UnityImport category:"File-Import"
2626
pluginManager.loadClass FbxImporter
2727

2828
unityProjectPath = getINISetting (GetMAXIniFile()) "Unity" "UnityProject"
29-
fbxFileName = getOpenFileName caption:"Import FBX from Unity" filename:unityProjectPath types:"FBX (*.fbx)|*.fbx|"
29+
fbxFileName = getOpenFileName caption:"Import FBX from Unity" filename:(unityProjectPath + "/Assets/") types:"FBX (*.fbx)|*.fbx|"
3030
if fbxFileName != undefined then
3131
(
3232
-- reset persistent values, in case import fails
@@ -72,6 +72,7 @@ macroScript UnityExport category:"File-Export"
7272
else(
7373
unityProjectPath = getINISetting (GetMAXIniFile()) "Unity" "UnityProject"
7474
exportFileName = getSaveFileName caption:"Export FBX to Unity" filename:unityProjectPath types:"FBX (*.fbx)|*.fbx|"
75+
exportFileName = getSaveFileName caption:"Export FBX to Unity" filename:(unityProjectPath + "/Assets/") types:"FBX (*.fbx)|*.fbx|"
7576
)
7677

7778
if exportFileName != undefined then (

0 commit comments

Comments
 (0)