Skip to content

Commit 8e08854

Browse files
committed
don't allow user to install to max 2017 or earlier
1 parent 4b1a836 commit 8e08854

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@ public override void OnInspectorGUI() {
133133
ExportSettings.DCCType foundDCC = ExportSettings.DCCType.Maya;
134134
var foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Maya);
135135
if (foundDCCPath == null && Application.platform == RuntimePlatform.WindowsEditor) {
136-
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
137-
foundDCC = ExportSettings.DCCType.Max;
136+
if (!ExportSettings.IsMax2018OrLater (dccPath)) {
137+
Debug.LogError ("3DsMax 2017 or earlier is not supported");
138+
} else {
139+
foundDCCPath = TryFindDCC (dccPath, ext, ExportSettings.DCCType.Max);
140+
foundDCC = ExportSettings.DCCType.Max;
141+
}
138142
}
139143
if (foundDCCPath == null) {
140144
Debug.LogError (string.Format ("Could not find supported DCC application at: \"{0}\"", Path.GetDirectoryName (dccPath)));
@@ -349,8 +353,12 @@ private static void FindDCCInstalls() {
349353
}
350354

351355
if (product.StartsWith ("3ds max", StringComparison.InvariantCultureIgnoreCase)) {
356+
var exePath = string.Format ("{0}/{1}", productDir.FullName.Replace ("\\", "/"), "3dsmax.exe");
357+
if (!IsMax2018OrLater (exePath)) {
358+
continue;
359+
}
352360
string version = product.Substring ("3ds max ".Length);
353-
dccOptionPath.Add (string.Format ("{0}/{1}", productDir.FullName.Replace ("\\", "/"), "3dsmax.exe"));
361+
dccOptionPath.Add (exePath);
354362
dccOptionName.Add (GetUniqueName ("3ds Max " + version));
355363
}
356364
}
@@ -495,6 +503,13 @@ public static string GetMaxOptionName(string exePath){
495503
return GetUniqueName (Path.GetFileName(Path.GetDirectoryName (exePath)));
496504
}
497505

506+
public static bool IsMax2018OrLater(string exePath){
507+
var name = Path.GetFileName (Path.GetDirectoryName (exePath)).ToLower();
508+
name = name.Replace ("3ds max", "").Trim();
509+
int version;
510+
return int.TryParse (name, out version) && version >= 2018;
511+
}
512+
498513
public static string GetSelectedDCCPath()
499514
{
500515
return instance.dccOptionPaths [instance.selectedDCCApp];

0 commit comments

Comments
 (0)