Skip to content

Commit 3a7fddf

Browse files
author
AJubrey
committed
[CHANGED] replaced the seperate LaunchMaya() and LaunchMax() functions for a LaunchDccApplication() function because they did the same thing
1 parent 8660f1e commit 3a7fddf

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ public static string GetProjectPath()
6363
/// <returns><c>true</c> if folder is already unzipped at the specified path; otherwise, <c>false</c>.</returns>
6464
/// <param name="path">Path.</param>
6565
public abstract bool FolderAlreadyUnzippedAtPath (string path);
66+
67+
/// <summary>
68+
/// Launches application at given path
69+
/// </summary>
70+
/// <param name="AppPath"></param>
71+
public static void LaunchDCCApplication(string AppPath)
72+
{
73+
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
74+
myProcess.StartInfo.FileName = AppPath;
75+
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
76+
myProcess.StartInfo.CreateNoWindow = false;
77+
myProcess.StartInfo.UseShellExecute = false;
78+
79+
myProcess.EnableRaisingEvents = false;
80+
myProcess.Start();
81+
}
6682
}
6783

6884

@@ -327,7 +343,7 @@ public static int ConfigureMaya(string mayaPath)
327343

328344
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
329345
{
330-
LaunchMaya(mayaPath);
346+
LaunchDCCApplication(mayaPath);
331347
}
332348
}
333349
catch (Exception e)
@@ -338,18 +354,6 @@ public static int ConfigureMaya(string mayaPath)
338354
return ExitCode;
339355
}
340356

341-
public static void LaunchMaya(string mayaPath)
342-
{
343-
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
344-
myProcess.StartInfo.FileName = mayaPath;
345-
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
346-
myProcess.StartInfo.CreateNoWindow = false;
347-
myProcess.StartInfo.UseShellExecute = false;
348-
349-
myProcess.EnableRaisingEvents = false;
350-
myProcess.Start();
351-
}
352-
353357
public static bool InstallMaya(bool verbose = false)
354358
{
355359
// What's happening here is that we copy the module template to
@@ -551,7 +555,7 @@ public static int InstallMaxPlugin(string maxExe){
551555

552556
if (EditorTools.ExportSettings.instance.launchAfterInstallation)
553557
{
554-
LaunchMax(maxExe);
558+
LaunchDCCApplication(maxExe);
555559
}
556560

557561
// TODO (UNI-29910): figure out what exactly causes this exit code + how to resolve
@@ -571,18 +575,6 @@ public static int InstallMaxPlugin(string maxExe){
571575
return ExitCode;
572576
}
573577

574-
public static void LaunchMax(string maxPath)
575-
{
576-
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
577-
myProcess.StartInfo.FileName = maxPath;
578-
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
579-
myProcess.StartInfo.CreateNoWindow = false;
580-
myProcess.StartInfo.UseShellExecute = false;
581-
582-
myProcess.EnableRaisingEvents = false;
583-
myProcess.Start();
584-
}
585-
586578
public override int InstallIntegration(string maxExe){
587579
return MaxIntegration.InstallMaxPlugin (maxExe);
588580
}

0 commit comments

Comments
 (0)