Skip to content

Commit 017dc79

Browse files
author
AJubrey
committed
[CHANGED] a few places in the code were passing in the path into the find version function instead of the app name
1 parent 7381ff8 commit 017dc79

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,10 @@ public override void OnInspectorGUI() {
136136
ExportSettings.DCCType foundDCC = ExportSettings.DCCType.Maya;
137137
var foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Maya);
138138
if (foundDCCPath == null && Application.platform == RuntimePlatform.WindowsEditor) {
139-
if (ExportSettings.IsEarlierThanMax2017 (dccPath)) {
140-
Debug.LogError ("Earlier than 3ds Max 2017 is not supported");
141-
UnityEditor.EditorUtility.DisplayDialog (
142-
"Error adding 3D Application",
143-
"Unity Integration only supports 3ds Max 2017 or later",
144-
"Ok");
145-
} else {
146-
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
147-
foundDCC = ExportSettings.DCCType.Max;
148-
}
139+
140+
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
141+
foundDCC = ExportSettings.DCCType.Max;
142+
149143
}
150144
if (foundDCCPath == null) {
151145
Debug.LogError (string.Format ("Could not find supported 3D application at: \"{0}\"", Path.GetDirectoryName (dccPath)));
@@ -482,12 +476,16 @@ private static void FindDCCInstalls() {
482476

483477
if (product.StartsWith ("3ds max", StringComparison.InvariantCultureIgnoreCase)) {
484478
var exePath = string.Format ("{0}/{1}", productDir.FullName.Replace ("\\", "/"), "3dsmax.exe");
485-
if (IsEarlierThanMax2017 (exePath)) {
479+
480+
string version = product.Substring("3ds max ".Length);
481+
var maxOptionName = GetUniqueDCCOptionName(kMaxOptionName + version);
482+
483+
if (IsEarlierThanMax2017 (maxOptionName)) {
486484
continue;
487485
}
488-
string version = product.Substring ("3ds max ".Length);
486+
489487
dccOptionPath.Add (exePath);
490-
dccOptionName.Add (GetUniqueDCCOptionName(kMaxOptionName + version));
488+
dccOptionName.Add (maxOptionName);
491489
}
492490
}
493491
instance.selectedDCCApp = instance.GetPreferredDCCApp();
@@ -598,7 +596,16 @@ public static void AddDCCOption(string newOption, DCCType dcc){
598596
break;
599597
case DCCType.Max:
600598
optionName = GetMaxOptionName (newOption);
601-
break;
599+
if (ExportSettings.IsEarlierThanMax2017(optionName))
600+
{
601+
Debug.LogError("Earlier than 3ds Max 2017 is not supported");
602+
UnityEditor.EditorUtility.DisplayDialog(
603+
"Error adding 3D Application",
604+
"Unity Integration only supports 3ds Max 2017 or later",
605+
"Ok");
606+
return;
607+
}
608+
break;
602609
default:
603610
throw new System.NotImplementedException();
604611
}

0 commit comments

Comments
 (0)