@@ -11,11 +11,20 @@ class Integrations
11
11
private const string PACKAGE_NAME = "FbxExporters" ;
12
12
private const string VERSION_FILENAME = "README.txt" ;
13
13
private const string VERSION_FIELD = "**Version**" ;
14
- private const string VERSION_TAG = "{Version}" ;
15
14
private const string PROJECT_TAG = "{UnityProject}" ;
16
15
17
16
private const string FBX_EXPORT_SETTINGS_PATH = "Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel" ;
18
17
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
+
19
28
public class MayaException : System . Exception {
20
29
public MayaException ( ) { }
21
30
public MayaException ( string message ) : base ( message ) { }
@@ -182,16 +191,6 @@ private static string MAYA_COMMANDS { get {
182
191
} }
183
192
private static Char [ ] FIELD_SEPARATORS = new Char [ ] { ':' } ;
184
193
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
-
195
194
private static string GetUserFolder ( )
196
195
{
197
196
#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
@@ -208,27 +207,12 @@ public static bool IsHeadlessInstall ()
208
207
209
208
public static string GetModulePath ( string version )
210
209
{
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 ) ;
214
211
}
215
212
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
-
224
213
public static string GetModuleTemplatePath ( string version )
225
214
{
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 ) ;
232
216
}
233
217
234
218
public static string GetAppPath ( )
@@ -468,7 +452,6 @@ public static bool InstallMaya(MayaVersion version = null, bool verbose = false)
468
452
{
469
453
Dictionary < string , string > Tokens = new Dictionary < string , string > ( )
470
454
{
471
- { VERSION_TAG , GetPackageVersion ( ) } ,
472
455
{ PROJECT_TAG , GetProjectPath ( ) }
473
456
} ;
474
457
0 commit comments