Render export errors

This commit is contained in:
ackwell 2024-01-01 13:10:50 +11:00
parent a059942bb2
commit 9f981a3e52
2 changed files with 8 additions and 1 deletions

View file

@ -17,6 +17,7 @@ public partial class ModEditWindow
private readonly List<string>[] _attributes;
public bool PendingIo { get; private set; } = false;
public string? IoException { get; private set; } = null;
// TODO: this can probably be genericised across all of chara
[GeneratedRegex(@"chara/equipment/e(?'Set'\d{4})/model/c(?'Race'\d{4})e\k'Set'_.+\.mdl", RegexOptions.Compiled)]
@ -74,7 +75,10 @@ public partial class ModEditWindow
PendingIo = true;
_edit._models.ExportToGltf(Mdl, sklb, outputPath)
.ContinueWith(_ => PendingIo = false);
.ContinueWith(task => {
IoException = task.Exception?.ToString();
PendingIo = false;
});
}
/// <summary> Try to find the .sklb path for a .mdl file. </summary>

View file

@ -42,6 +42,9 @@ public partial class ModEditWindow
foreach (var gamePath in tab.GamePaths)
ImGui.TextUnformatted(gamePath.ToString());
if (tab.IoException != null)
ImGui.TextUnformatted(tab.IoException);
var ret = false;
ret |= DrawModelMaterialDetails(tab, disabled);