Skip to content

Commit 05519ee

Browse files
author
AJubrey
committed
[FIXED] error with deleting file
[ADDED] fucntion for copying name list to export settings
1 parent 6826e82 commit 05519ee

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ public void SetDCCOptionNames(List<string> newList)
379379
dccOptionNames = newList;
380380
}
381381

382+
public void SetDCCOptionPaths(List<string> newList)
383+
{
384+
dccOptionPaths = newList;
385+
}
386+
382387
public void ClearDCCOptionNames()
383388
{
384389
dccOptionNames.Clear();

Assets/FbxExporters/Editor/UnitTests/FbxExportSettingsTest.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,26 @@ public void TestFindPreferredProgram()
217217
public void TestGetDCCOptions()
218218
{
219219
string projectPath = Application.dataPath;
220-
Debug.Log(projectPath);
221220
var firstPath = Directory.CreateDirectory(projectPath + "/GetDCCOptionsTestFolder/3ds max 3000");
222221
var secondPath = Directory.CreateDirectory(projectPath + "/GetDCCOptionsTestFolder/3ds max 3001");
223-
FileInfo firstExe = new FileInfo(projectPath + "/GetDCCOptionsTestFolder/3ds max 3000/3dsmax.exe");
224-
firstExe.Create();
225-
firstExe.Open(FileMode.Open);
226-
222+
FileInfo firstExe = new FileInfo(projectPath + "/GetDCCOptionsTestFolder/3ds max 3000/3dsmax.exe");
223+
using (FileStream s = firstExe.Create()) {}
227224

228225
List<string> testPathList = new List<string>();
229226
testPathList.Add(projectPath + "/GetDCCOptionsTestFolder/3ds max 3001"); //bogus path which should be removed
230227
testPathList.Add(projectPath + "/GetDCCOptionsTestFolder/3ds max 3000");
231-
testPathList.Add("C:/Program Files/Autodesk/3ds Max 2018/3dsmax.exe");
232228

233-
firstExe.Delete();
234-
firstPath.Delete();
235-
secondPath.Delete();
229+
List<string> testNameList = new List<string>();
230+
testNameList.Add("3ds max 3001");
231+
232+
ExportSettings.instance.SetDCCOptionNames(testNameList);
233+
ExportSettings.instance.SetDCCOptionPaths(testPathList);
234+
235+
GUIContent[] options = ExportSettings.GetDCCOptions();
236+
Debug.Log(options.Length);
237+
238+
firstPath.Delete(true);
239+
secondPath.Delete(true);
236240
}
237241

238242
}

0 commit comments

Comments
 (0)