Skip to content

Commit 7015d41

Browse files
authored
Merge pull request #206 from Unity-Technologies/UNI-29074-mayalt-plugin
Uni 29074 Maya LT mel plugin
2 parents 79dfbba + f76b4c3 commit 7015d41

23 files changed

+495
-1176
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// ***********************************************************************
2+
// Copyright (c) 2017 Unity Technologies. All rights reserved.
3+
//
4+
// Licensed under the ##LICENSENAME##.
5+
// See LICENSE.md file in the project root for full license information.
6+
// ***********************************************************************
7+
18
using System;
29
using System.IO;
310
using UnityEditorInternal;
@@ -125,25 +132,11 @@ public override void OnInspectorGUI() {
125132

126133
// check that the path is valid and references the maya executable
127134
if (!string.IsNullOrEmpty (dccPath)) {
128-
// get the directory of the executable
129-
var md = Directory.GetParent (dccPath);
130-
// UNI-29074 TODO: add Maya LT support
131-
// Check that the executable is not in a MayaLT directory (thus being MayaLT instead of Maya executable).
132-
// On Mac path resembles: /Applications/Autodesk/mayaLT2018/Maya.app
133-
// On Windows path resembles: C:\Program Files\Autodesk\MayaLT2018\bin\maya.exe
134-
// Therefore check both executable folder (for Mac) and its parent (for Windows)
135-
if (md.Name.ToLower().StartsWith("mayalt") || md.Parent.Name.ToLower ().StartsWith ("mayalt")) {
136-
Debug.LogError (string.Format("Unity Integration does not support Maya LT: \"{0}\"", md.FullName));
137-
return;
138-
}
139-
140135
ExportSettings.DCCType foundDCC = ExportSettings.DCCType.Maya;
141136
var foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Maya);
142137
if (foundDCCPath == null && Application.platform == RuntimePlatform.WindowsEditor) {
143-
144138
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
145139
foundDCC = ExportSettings.DCCType.Max;
146-
147140
}
148141
if (foundDCCPath == null) {
149142
Debug.LogError (string.Format ("Could not find supported 3D application at: \"{0}\"", Path.GetDirectoryName (dccPath)));
@@ -492,17 +485,11 @@ private static void FindDCCInstalls() {
492485
var product = productDir.Name;
493486

494487
// Only accept those that start with 'maya' in either case.
495-
if (product.StartsWith("maya", StringComparison.InvariantCultureIgnoreCase))
496-
{
497-
// UNI-29074 TODO: add Maya LT support
498-
// Reject MayaLT -- it doesn't have plugins.
499-
if (product.StartsWith("mayalt", StringComparison.InvariantCultureIgnoreCase))
500-
{
501-
continue;
502-
}
503-
string version = product.Substring("maya".Length);
504-
dccOptionPath.Add(GetMayaExePath(productDir.FullName.Replace("\\", "/")));
505-
dccOptionName.Add(GetUniqueDCCOptionName(kMayaOptionName + version));
488+
if (product.StartsWith ("maya", StringComparison.InvariantCultureIgnoreCase)) {
489+
string version = product.Substring ("maya".Length);
490+
dccOptionPath.Add (GetMayaExePath (productDir.FullName.Replace ("\\", "/")));
491+
dccOptionName.Add (GetUniqueDCCOptionName(kMayaOptionName + version));
492+
continue;
506493
}
507494

508495
if (product.StartsWith("3ds max", StringComparison.InvariantCultureIgnoreCase))
@@ -637,13 +624,6 @@ public static void AddDCCOption(string newOption, DCCType dcc){
637624
switch (dcc) {
638625
case DCCType.Maya:
639626
var version = AskMayaVersion(newOption);
640-
641-
// UNI-29074 TODO: add Maya LT support
642-
// make sure this is not Maya LT
643-
if (version.ToLower ().StartsWith ("lt")) {
644-
Debug.LogError (string.Format("Unity Integration does not support Maya LT: \"{0}\"", newOption));
645-
return;
646-
}
647627
optionName = GetUniqueDCCOptionName("Maya " + version);
648628
break;
649629
case DCCType.Max:
@@ -709,6 +689,11 @@ public static string GetSelectedDCCPath()
709689
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionPaths [instance.selectedDCCApp] : "";
710690
}
711691

692+
public static string GetSelectedDCCName()
693+
{
694+
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
695+
}
696+
712697
/// <summary>
713698
/// The path where Convert To Model will save the new fbx and prefab.
714699
/// This is relative to the Application.dataPath ; it uses '/' as the

0 commit comments

Comments
 (0)