Skip to content

Commit

Permalink
Fix FBX-to-GR2 obtaining incorrect folder, fix FBX-to-GR2 throwing ex…
Browse files Browse the repository at this point in the history
…ceptions when optional folders not found
  • Loading branch information
Pepper-Man committed Aug 6, 2024
1 parent eb0f037 commit ee05552
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Launcher/ToolkitInterface/HRToolkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,23 +223,30 @@ string getFilepath(string file)

void ConvertAllInFolder(string folder)
{
IEnumerable<string> files = Directory.EnumerateFiles(folder, "*.fbx");
try
{
IEnumerable<string> files = Directory.EnumerateFiles(folder, "*.fbx");

foreach (var f in files)
foreach (var f in files)
{
Task toolTask = GR2FromFBX(
f,
getFilepath(f) + ".json",
getFilepath(f) + ".gr2",
json_rebuild,
show_output);
dispatchedTasks.Add(toolTask);
}
}
catch (DirectoryNotFoundException)
{
Task toolTask = GR2FromFBX(
f,
getFilepath(f) + ".json",
getFilepath(f) + ".gr2",
json_rebuild,
show_output);
dispatchedTasks.Add(toolTask);
Trace.WriteLine($"{folder} does not exist");
}
}

foreach (var folder in Directory.EnumerateDirectories(fbx_search_path))
{
string folderName = Path.GetDirectoryName(folder);
string folderName = Path.GetFileName(folder);

string[] assetFolders = new[] { "animations", "collision", "markers", "physics", "render", "skeleton" };

Expand Down

0 comments on commit ee05552

Please sign in to comment.