Skip to content

Commit 850b50a

Browse files
author
AJubrey
committed
[ADDED] variables for the default vendor locations
[ADDED] checks to make sure we don't have duplicate locations checked
1 parent 3a4c146 commit 850b50a

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ public static string[] DCCVendorLocations {
259259
get{
260260
var environmentVariable = Environment.GetEnvironmentVariable("UNITY_FBX_3DAPP_VENDOR_LOCATIONS");
261261
List<string> locationsList = new List<string>();
262+
List<string> WindowsDefaultLocations = new List<string>() { "C:/Program Files/Autodesk", "D:/Program Files/Autodesk" };
263+
List<string> OSXDefaultLocations = new List<string>() { "/Applications/Autodesk" };
262264

263265
if (environmentVariable != null)
264266
{
@@ -285,6 +287,15 @@ public static string[] DCCVendorLocations {
285287
if (Directory.GetParent(location) != null)
286288
{
287289
possibleLocation = Directory.GetParent(location).ToString();
290+
291+
//Make sure the user defined path is not included in the default paths
292+
for (int i = 0; i < WindowsDefaultLocations.Count; i++)
293+
{
294+
if (WindowsDefaultLocations[i].Equals(possibleLocation))
295+
{
296+
possibleLocation = null;
297+
}
298+
}
288299
}
289300

290301
if (Application.platform == RuntimePlatform.OSXEditor)
@@ -301,6 +312,15 @@ public static string[] DCCVendorLocations {
301312
if (autoDeskFolder != null)
302313
{
303314
possibleLocation = autoDeskFolder.ToString();
315+
316+
//Make sure the user defined path is not included in the default paths
317+
for (int i = 0; i < OSXDefaultLocations.Count; i++)
318+
{
319+
if (OSXDefaultLocations[i].Equals(possibleLocation))
320+
{
321+
possibleLocation = null;
322+
}
323+
}
304324
}
305325
}
306326
}
@@ -315,10 +335,10 @@ public static string[] DCCVendorLocations {
315335
switch (Application.platform)
316336
{
317337
case RuntimePlatform.WindowsEditor:
318-
locationsList.AddRange(new string[] { "C:/Program Files/Autodesk", "D:/Program Files/Autodesk" });
338+
locationsList.AddRange(WindowsDefaultLocations);
319339
break;
320340
case RuntimePlatform.OSXEditor:
321-
locationsList.AddRange(new string[] { "/Applications/Autodesk" });
341+
locationsList.AddRange(OSXDefaultLocations);
322342
break;
323343
default:
324344
throw new NotImplementedException();

0 commit comments

Comments
 (0)