@@ -16,6 +16,8 @@ class Integrations
16
16
17
17
private const string FBX_EXPORT_SETTINGS_PATH = "Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel" ;
18
18
19
+ public static string INTEGRATION_FOLDER_PATH = Application . dataPath ;
20
+
19
21
public class MayaException : System . Exception {
20
22
public MayaException ( ) { }
21
23
public MayaException ( string message ) : base ( message ) { }
@@ -223,7 +225,7 @@ public static string GetModulePath(string version)
223
225
224
226
public static string GetModuleTemplatePath ( string version )
225
227
{
226
- string result = System . IO . Path . Combine ( Application . dataPath , MODULE_TEMPLATE_PATH ) ;
228
+ string result = System . IO . Path . Combine ( INTEGRATION_FOLDER_PATH , MODULE_TEMPLATE_PATH ) ;
227
229
if ( ! ModuleTemplateCompatibility . TryGetValue ( version , out version ) ) {
228
230
throw new MayaException ( "FbxExporters does not support Maya version " + version ) ;
229
231
}
@@ -508,8 +510,12 @@ class IntegrationsUI
508
510
509
511
public static void InstallMayaIntegration ( )
510
512
{
511
- DecompressIntegrationZipFile ( ) ;
512
- return ;
513
+ // decompress zip file if it exists, otherwise try using default location
514
+ if ( System . IO . File . Exists ( GetIntegrationZipFullPath ( ) ) ) {
515
+ DecompressIntegrationZipFile ( ) ;
516
+ } else {
517
+ Integrations . INTEGRATION_FOLDER_PATH = DefaultIntegrationSavePath ;
518
+ }
513
519
514
520
var mayaVersion = new Integrations . MayaVersion ( ) ;
515
521
if ( ! Integrations . InstallMaya ( mayaVersion , verbose : true ) ) {
@@ -564,14 +570,25 @@ private static void DecompressIntegrationZipFile()
564
570
) ;
565
571
566
572
if ( result == 0 ) {
567
- DecompressZip ( Application . dataPath + "/" + IntegrationZipPath , unzipFolder ) ;
573
+ DecompressZip ( GetIntegrationZipFullPath ( ) , unzipFolder ) ;
568
574
} else if ( result == 2 ) {
569
575
return ;
570
576
}
571
577
} else {
572
578
// unzip Integration folder
573
- DecompressZip ( Application . dataPath + "/" + IntegrationZipPath , unzipFolder ) ;
579
+ DecompressZip ( GetIntegrationZipFullPath ( ) , unzipFolder ) ;
574
580
}
581
+
582
+ Integrations . INTEGRATION_FOLDER_PATH = unzipFolder ;
583
+ }
584
+
585
+ /// <summary>
586
+ /// Gets the integration zip full path as an absolute Unity-style path.
587
+ /// </summary>
588
+ /// <returns>The integration zip full path.</returns>
589
+ private static string GetIntegrationZipFullPath ( )
590
+ {
591
+ return Application . dataPath + "/" + IntegrationZipPath ;
575
592
}
576
593
577
594
/// <summary>
0 commit comments