Skip to content

Commit fe5af82

Browse files
author
AJubrey
committed
[CHANGED] how we check conflicting options against our preferences to be more general and work for MayaLT (and concievably other DCCs in the future)
1 parent 7acea4a commit fe5af82

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public class ExportSettings : ScriptableSingleton<ExportSettings>
243243
//Any additional names require a space after the name
244244
public const string kMaxOptionName = "3ds Max ";
245245
public const string kMayaOptionName = "Maya ";
246-
public const string kMayaLtOptionName = "MayaLT ";
246+
public const string kMayaLtOptionName = "Maya LT";
247247

248248
private static string DefaultIntegrationSavePath {
249249
get{
@@ -447,10 +447,24 @@ private int ChoosePreferredDCCApp(int optionA, int optionB)
447447
return -1;
448448
}
449449

450-
//We assume that the option names have a
451-
int scoreA = s_PreferenceList.IndexOf(appA.Split(' ')[0]);
452-
int scoreB = s_PreferenceList.IndexOf(appB.Split(' ')[0]);
450+
int scoreA = -1;
451+
int scoreB = -1;
453452

453+
for( int i = 0; i < s_PreferenceList.Count; i++ )
454+
{
455+
if (appA.StartsWith(s_PreferenceList[i]))
456+
{
457+
scoreA = i;
458+
}
459+
}
460+
461+
for (int i = 0; i < s_PreferenceList.Count; i++)
462+
{
463+
if (appB.StartsWith(s_PreferenceList[i]))
464+
{
465+
scoreB = i;
466+
}
467+
}
454468
return scoreA < scoreB ? optionA : optionB;
455469
}
456470

@@ -479,13 +493,18 @@ private static int FindDCCVersion(string AppName)
479493
{
480494
return version;
481495
}
496+
else if (AppName.Contains("LT"))
497+
{
498+
int.TryParse(number.Substring(2), out version);
499+
return version;
500+
}
482501
else
483502
{
484503
float fVersion;
485504
//In case we are looking at something with a decimal based version- the int parse will fail so we'll need to parse it as a float.
486505
if (float.TryParse(number, out fVersion))
487506
{
488-
return (int)fVersion;
507+
return (int)fVersion;
489508
}
490509
return -1;
491510
}

0 commit comments

Comments
 (0)