From 9f981a3e52268c6b1c98959c9eb4c0d398ef8837 Mon Sep 17 00:00:00 2001 From: ackwell Date: Mon, 1 Jan 2024 13:10:50 +1100 Subject: [PATCH] Render export errors --- Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs | 6 +++++- Penumbra/UI/AdvancedWindow/ModEditWindow.Models.cs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs index 99c32761..31f2f7e0 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.MdlTab.cs @@ -17,6 +17,7 @@ public partial class ModEditWindow private readonly List[] _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; + }); } /// Try to find the .sklb path for a .mdl file. diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.cs index ff2c1ae5..57c47b8f 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Models.cs @@ -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);