Skip to content

Commit 43639f5

Browse files
author
AJubrey
committed
[REMOVED] the second 'getparentdirectory' as we only need to go up one because of how we trim now
[ADDED] comments
1 parent 1111c3b commit 43639f5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,18 @@ public static string[] DCCVendorLocations {
293293
{
294294
int appIndex = location.IndexOf("Maya.app");
295295

296-
//If we found 'Maya.app' in the location string, we're going to trim it and everything after it out
297-
//This way our possibleLocation will be more uniform between windows and mac
298-
if (appIndex >= 0 &&
299-
Directory.GetParent(location) != null &&
300-
Directory.GetParent(Directory.GetParent(location).ToString()) != null)
296+
//If we found 'Maya.app' in the location string, we're going to trim it and everything after it out.
297+
//This way our possibleLocation will be more uniform between windows and mac.
298+
299+
//get everything up until 'maya.exe'
300+
string subLocation = location.Substring(0, (appIndex - 1));
301+
302+
var parentDirectory = Directory.GetParent(subLocation);
303+
304+
if (appIndex >= 0 && parentDirectory != null)
301305
{
302-
possibleLocation = location.Substring(0, (appIndex - 1));
303-
possibleLocation = Directory.GetParent(Directory.GetParent(possibleLocation).ToString()).ToString();
306+
possibleLocation = parentDirectory.ToString();
307+
Debug.Log(possibleLocation.ToString());
304308
}
305309
}
306310

0 commit comments

Comments
 (0)