@@ -372,11 +372,6 @@ class MaxIntegration
372
372
private const string ProjectTag = "UnityProject" ;
373
373
private const string ExportSettingsTag = "UnityFbxExportSettings" ;
374
374
375
- // TODO: get this from the export settings
376
- private static string GetMaxExe ( ) {
377
- return "C:/Program Files/Autodesk/3ds Max 2018/3dsmax.exe" ;
378
- }
379
-
380
375
/// <summary>
381
376
/// Gets the absolute Unity path for relative path in Assets folder.
382
377
/// </summary>
@@ -404,8 +399,7 @@ private static string GetInstallScript(){
404
399
return installScript ;
405
400
}
406
401
407
- public static int InstallMaxPlugin ( ) {
408
- var maxExe = GetMaxExe ( ) ;
402
+ public static int InstallMaxPlugin ( string maxExe ) {
409
403
var installScript = GetInstallScript ( ) ;
410
404
411
405
int ExitCode = 0 ;
@@ -449,9 +443,9 @@ public static int InstallMaxPlugin(){
449
443
class IntegrationsUI
450
444
{
451
445
/// <summary>
452
- /// The path of the Maya executable.
446
+ /// The path of the DCC executable.
453
447
/// </summary>
454
- public static string GetMayaExe ( ) {
448
+ public static string GetDCCExe ( ) {
455
449
return FbxExporters . EditorTools . ExportSettings . GetSelectedDCCPath ( ) ;
456
450
}
457
451
@@ -471,13 +465,25 @@ private static void ShowSuccessDialog(string dcc, int exitCode){
471
465
UnityEditor . EditorUtility . DisplayDialog ( title , message , "Ok" ) ;
472
466
}
473
467
474
- public static void InstallMayaIntegration ( )
468
+ public static void InstallDCCIntegration ( )
475
469
{
476
- var mayaExe = GetMayaExe ( ) ;
477
- if ( string . IsNullOrEmpty ( mayaExe ) ) {
470
+ var dccExe = GetDCCExe ( ) ;
471
+ if ( string . IsNullOrEmpty ( dccExe ) ) {
472
+ return ;
473
+ }
474
+ string dccType = System . IO . Path . GetFileNameWithoutExtension ( dccExe ) . ToLower ( ) ;
475
+ if ( dccType . Equals ( "maya" ) ) {
476
+ InstallMayaIntegration ( dccExe ) ;
478
477
return ;
479
478
}
479
+ if ( dccType . Equals ( "3dsmax" ) ) {
480
+ InstallMaxIntegration ( dccExe ) ;
481
+ return ;
482
+ }
483
+ }
480
484
485
+ public static void InstallMayaIntegration ( string mayaExe )
486
+ {
481
487
if ( ! Integrations . InstallMaya ( verbose : true ) ) {
482
488
return ;
483
489
}
@@ -486,9 +492,9 @@ public static void InstallMayaIntegration ()
486
492
ShowSuccessDialog ( "Maya" , exitCode ) ;
487
493
}
488
494
489
- public static void InstallMaxIntegration ( )
495
+ public static void InstallMaxIntegration ( string maxExe )
490
496
{
491
- int exitCode = MaxIntegration . InstallMaxPlugin ( ) ;
497
+ int exitCode = MaxIntegration . InstallMaxPlugin ( maxExe ) ;
492
498
ShowSuccessDialog ( "3DsMax" , exitCode ) ;
493
499
}
494
500
}
0 commit comments