@@ -372,7 +372,7 @@ public static bool InstallMaya(bool verbose = false)
372
372
373
373
class MaxIntegration
374
374
{
375
- private const string MaxScriptsPath = "FbxExporters/ Integrations/Autodesk/max/scripts/" ;
375
+ private const string MaxScriptsPath = "Integrations/Autodesk/max/scripts/" ;
376
376
377
377
private const string PluginName = "UnityFbxForMaxPlugin.ms" ;
378
378
private const string PluginPath = MaxScriptsPath + PluginName ;
@@ -387,12 +387,12 @@ class MaxIntegration
387
387
private const string ExportSettingsTag = "UnityFbxExportSettings" ;
388
388
389
389
/// <summary>
390
- /// Gets the absolute Unity path for relative path in Assets folder.
390
+ /// Gets the absolute Unity path for relative path in Integrations folder.
391
391
/// </summary>
392
392
/// <returns>The absolute path.</returns>
393
393
/// <param name="relPath">Relative path.</param>
394
394
public static string GetAbsPath ( string relPath ) {
395
- return Application . dataPath + "/" + relPath ;
395
+ return Integrations . INTEGRATION_FOLDER_PATH + "/" + relPath ;
396
396
}
397
397
398
398
private static string GetInstallScript ( ) {
@@ -496,15 +496,6 @@ public static void InstallDCCIntegration ()
496
496
if ( string . IsNullOrEmpty ( dccExe ) ) {
497
497
return ;
498
498
}
499
- string dccType = System . IO . Path . GetFileNameWithoutExtension ( dccExe ) . ToLower ( ) ;
500
- if ( dccType . Equals ( "maya" ) ) {
501
- InstallMayaIntegration ( dccExe ) ;
502
- return ;
503
- }
504
- if ( dccType . Equals ( "3dsmax" ) ) {
505
- InstallMaxIntegration ( dccExe ) ;
506
- return ;
507
- }
508
499
509
500
// decompress zip file if it exists, otherwise try using default location
510
501
if ( System . IO . File . Exists ( GetIntegrationZipFullPath ( ) ) ) {
@@ -517,27 +508,36 @@ public static void InstallDCCIntegration ()
517
508
Integrations . INTEGRATION_FOLDER_PATH = DefaultIntegrationSavePath ;
518
509
}
519
510
511
+ string dccType = System . IO . Path . GetFileNameWithoutExtension ( dccExe ) . ToLower ( ) ;
512
+ if ( dccType . Equals ( "maya" ) ) {
513
+ InstallMayaIntegration ( dccExe ) ;
514
+ return ;
515
+ }
516
+ if ( dccType . Equals ( "3dsmax" ) ) {
517
+ InstallMaxIntegration ( dccExe ) ;
518
+ return ;
519
+ }
520
+ }
521
+
522
+ public static void InstallMayaIntegration ( string mayaExe )
523
+ {
520
524
if ( ! Integrations . InstallMaya ( verbose : true ) ) {
521
525
return ;
522
526
}
523
527
524
528
int exitCode = Integrations . ConfigureMaya ( mayaExe ) ;
529
+ ShowSuccessDialog ( "Maya" , exitCode ) ;
530
+ }
525
531
526
- string title , message ;
527
- if ( exitCode != 0 ) {
528
- title = "Failed to install Maya Integration." ;
529
- message = string . Format ( "Failed to configure Maya, please check logs (exitcode={0})." , exitCode ) ;
530
- } else {
531
- title = "Completed installation of Maya Integration." ;
532
- message = "Enjoy the new \" Unity\" menu in Maya." ;
533
- }
534
- UnityEditor . EditorUtility . DisplayDialog ( title , message , "Ok" ) ;
532
+ public static void InstallMaxIntegration ( string maxExe ) {
533
+ int exitCode = MaxIntegration . InstallMaxPlugin ( maxExe ) ;
534
+ ShowSuccessDialog ( "3DsMax" , exitCode ) ;
535
535
}
536
536
537
537
private static bool DecompressIntegrationZipFile ( )
538
538
{
539
539
// prompt user to enter location to unzip file
540
- var unzipFolder = EditorUtility . OpenFolderPanel ( "Select Location to Save Maya Integration" , LastIntegrationSavePath , "" ) ;
540
+ var unzipFolder = EditorUtility . OpenFolderPanel ( "Select Location to Save DCC Integration" , LastIntegrationSavePath , "" ) ;
541
541
if ( string . IsNullOrEmpty ( unzipFolder ) ) {
542
542
// user has cancelled, do nothing
543
543
return false ;
@@ -553,7 +553,7 @@ private static bool DecompressIntegrationZipFile()
553
553
) ;
554
554
555
555
if ( result ) {
556
- InstallMayaIntegration ( ) ;
556
+ InstallDCCIntegration ( ) ;
557
557
} else {
558
558
return false ;
559
559
}
@@ -595,16 +595,6 @@ private static string GetIntegrationZipFullPath()
595
595
return Application . dataPath + "/" + IntegrationZipPath ;
596
596
}
597
597
598
- public static void InstallMayaIntegration ( string mayaExe )
599
- {
600
- if ( ! Integrations . InstallMaya ( verbose : true ) ) {
601
- return ;
602
- }
603
-
604
- int exitCode = Integrations . ConfigureMaya ( mayaExe ) ;
605
- ShowSuccessDialog ( "Maya" , exitCode ) ;
606
- }
607
-
608
598
/// <summary>
609
599
/// Determines if folder is already unzipped at the specified path
610
600
/// by checking if unityoneclick.txt exists at expected location.
@@ -645,11 +635,6 @@ public static bool DirectoryHasWritePermission(string path)
645
635
}
646
636
}
647
637
648
- public static void InstallMaxIntegration ( string maxExe ) {
649
- int exitCode = MaxIntegration . InstallMaxPlugin ( maxExe ) ;
650
- ShowSuccessDialog ( "3DsMax" , exitCode ) ;
651
- }
652
-
653
638
public static void DecompressZip ( string zipPath , string destPath ) {
654
639
System . Diagnostics . Process myProcess = new System . Diagnostics . Process ( ) ;
655
640
var ZIPAPP = "7z.exe" ;
0 commit comments