Skip to content

Commit 3d1ea86

Browse files
committed
remove version tag
1 parent 635c8b4 commit 3d1ea86

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ class Integrations
1111
private const string PACKAGE_NAME = "FbxExporters";
1212
private const string VERSION_FILENAME = "README.txt";
1313
private const string VERSION_FIELD = "**Version**";
14-
private const string VERSION_TAG = "{Version}";
1514
private const string PROJECT_TAG = "{UnityProject}";
1615

1716
private const string FBX_EXPORT_SETTINGS_PATH = "Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel";
1817

18+
private const string MODULE_TEMPLATE_PATH = "Integrations/Autodesk/maya/" + MODULE_FILENAME + ".txt";
19+
20+
#if UNITY_EDITOR_OSX
21+
private const string MAYA_MODULES_PATH = "Library/Preferences/Autodesk/Maya/modules";
22+
#elif UNITY_EDITOR_LINUX
23+
private const string MAYA_MODULES_PATH = "Maya/modules";
24+
#else
25+
private const string MAYA_MODULES_PATH = "maya/modules";
26+
#endif
27+
1928
public class MayaException : System.Exception {
2029
public MayaException() { }
2130
public MayaException(string message) : base(message) { }
@@ -182,16 +191,6 @@ private static string MAYA_COMMANDS { get {
182191
}}
183192
private static Char[] FIELD_SEPARATORS = new Char[] {':'};
184193

185-
private const string MODULE_TEMPLATE_PATH = "Integrations/Autodesk/maya/" + MODULE_FILENAME + ".txt";
186-
187-
#if UNITY_EDITOR_OSX
188-
private const string MAYA_MODULES_PATH = "Library/Preferences/Autodesk/Maya/modules";
189-
#elif UNITY_EDITOR_LINUX
190-
private const string MAYA_MODULES_PATH = "Maya/modules";
191-
#else
192-
private const string MAYA_MODULES_PATH = "maya/modules";
193-
#endif
194-
195194
private static string GetUserFolder()
196195
{
197196
#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
@@ -208,27 +207,12 @@ public static bool IsHeadlessInstall ()
208207

209208
public static string GetModulePath(string version)
210209
{
211-
string result = System.IO.Path.Combine(GetUserFolder(), MAYA_MODULES_PATH);
212-
213-
return result.Replace(VERSION_TAG,version);
210+
return System.IO.Path.Combine(GetUserFolder(), MAYA_MODULES_PATH);
214211
}
215212

216-
// GetModuleTemplatePath can support multiple versions of Maya in case
217-
// of changes in API. But most versions are compatible with each
218-
// other, so just register one and make a mapping.
219-
static Dictionary<string, string> ModuleTemplateCompatibility = new Dictionary<string, string>() {
220-
{ "2017", "2017" },
221-
{ "2018", "2017" },
222-
};
223-
224213
public static string GetModuleTemplatePath(string version)
225214
{
226-
string result = System.IO.Path.Combine(Application.dataPath, MODULE_TEMPLATE_PATH);
227-
if (!ModuleTemplateCompatibility.TryGetValue(version, out version)) {
228-
throw new MayaException("FbxExporters does not support Maya version " + version);
229-
}
230-
231-
return result.Replace(VERSION_TAG,version);
215+
return System.IO.Path.Combine(Application.dataPath, MODULE_TEMPLATE_PATH);
232216
}
233217

234218
public static string GetAppPath()
@@ -468,7 +452,6 @@ public static bool InstallMaya(MayaVersion version = null, bool verbose = false)
468452
{
469453
Dictionary<string,string> Tokens = new Dictionary<string,string>()
470454
{
471-
{VERSION_TAG, GetPackageVersion() },
472455
{PROJECT_TAG, GetProjectPath() }
473456
};
474457

0 commit comments

Comments
 (0)