Skip to content

Commit d904d75

Browse files
committed
support selecting Maya LT in export settings
1 parent ea31495 commit d904d75

File tree

2 files changed

+19
-28
lines changed

2 files changed

+19
-28
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,11 @@ public override void OnInspectorGUI() {
120120

121121
// check that the path is valid and references the maya executable
122122
if (!string.IsNullOrEmpty (dccPath)) {
123-
// get the directory of the executable
124-
var md = Directory.GetParent (dccPath);
125-
// UNI-29074 TODO: add Maya LT support
126-
// Check that the executable is not in a MayaLT directory (thus being MayaLT instead of Maya executable).
127-
// On Mac path resembles: /Applications/Autodesk/mayaLT2018/Maya.app
128-
// On Windows path resembles: C:\Program Files\Autodesk\MayaLT2018\bin\maya.exe
129-
// Therefore check both executable folder (for Mac) and its parent (for Windows)
130-
if (md.Name.ToLower().StartsWith("mayalt") || md.Parent.Name.ToLower ().StartsWith ("mayalt")) {
131-
Debug.LogError (string.Format("Unity Integration does not support Maya LT: \"{0}\"", md.FullName));
132-
exportSettings.selectedDCCApp = oldValue;
133-
return;
134-
}
135-
136123
ExportSettings.DCCType foundDCC = ExportSettings.DCCType.Maya;
137124
var foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Maya);
138125
if (foundDCCPath == null && Application.platform == RuntimePlatform.WindowsEditor) {
139-
140126
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
141127
foundDCC = ExportSettings.DCCType.Max;
142-
143128
}
144129
if (foundDCCPath == null) {
145130
Debug.LogError (string.Format ("Could not find supported 3D application at: \"{0}\"", Path.GetDirectoryName (dccPath)));
@@ -464,11 +449,6 @@ private static void FindDCCInstalls() {
464449

465450
// Only accept those that start with 'maya' in either case.
466451
if (product.StartsWith ("maya", StringComparison.InvariantCultureIgnoreCase)) {
467-
// UNI-29074 TODO: add Maya LT support
468-
// Reject MayaLT -- it doesn't have plugins.
469-
if (product.StartsWith ("mayalt", StringComparison.InvariantCultureIgnoreCase)) {
470-
continue;
471-
}
472452
string version = product.Substring ("maya".Length);
473453
dccOptionPath.Add (GetMayaExePath (productDir.FullName.Replace ("\\", "/")));
474454
dccOptionName.Add (GetUniqueDCCOptionName(kMayaOptionName + version));
@@ -585,13 +565,6 @@ public static void AddDCCOption(string newOption, DCCType dcc){
585565
switch (dcc) {
586566
case DCCType.Maya:
587567
var version = AskMayaVersion(newOption);
588-
589-
// UNI-29074 TODO: add Maya LT support
590-
// make sure this is not Maya LT
591-
if (version.ToLower ().StartsWith ("lt")) {
592-
Debug.LogError (string.Format("Unity Integration does not support Maya LT: \"{0}\"", newOption));
593-
return;
594-
}
595568
optionName = GetUniqueDCCOptionName("Maya " + version);
596569
break;
597570
case DCCType.Max:
@@ -657,6 +630,11 @@ public static string GetSelectedDCCPath()
657630
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
658631
}
659632

633+
public static string GetSelectedDCCName()
634+
{
635+
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
636+
}
637+
660638
/// <summary>
661639
/// The path where Convert To Model will save the new fbx and prefab.
662640
/// This is relative to the Application.dataPath ; it uses '/' as the

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,14 @@ public static string GetDCCExe () {
694694
return FbxExporters.EditorTools.ExportSettings.GetSelectedDCCPath ();
695695
}
696696

697+
/// <summary>
698+
/// Gets the name of the selected DCC.
699+
/// </summary>
700+
/// <returns>The DCC name.</returns>
701+
public static string GetDCCName() {
702+
return FbxExporters.EditorTools.ExportSettings.GetSelectedDCCName ();
703+
}
704+
697705
/// <summary>
698706
/// Opens a dialog showing whether the installation succeeded.
699707
/// </summary>
@@ -729,7 +737,12 @@ public static void InstallDCCIntegration ()
729737
string dccType = System.IO.Path.GetFileNameWithoutExtension (dccExe).ToLower();
730738
DCCIntegration dccIntegration;
731739
if (dccType.Equals ("maya")) {
732-
dccIntegration = new MayaIntegration ();
740+
// could be Maya or Maya LT
741+
if (GetDCCName ().ToLower ().Contains ("lt")) {
742+
dccIntegration = new MayaLTIntegration ();
743+
} else {
744+
dccIntegration = new MayaIntegration ();
745+
}
733746
} else if (dccType.Equals ("3dsmax")) {
734747
dccIntegration = new MaxIntegration ();
735748
} else {

0 commit comments

Comments
 (0)