From 995cd25bc469adb74711967dfc9f04c4c775861e Mon Sep 17 00:00:00 2001 From: GMatrixGames Date: Thu, 9 Feb 2023 17:54:49 -0500 Subject: [PATCH] Fix soft crash on "blank" shop assets --- CUE4Parse | 2 +- FModel/Creator/Bases/FN/BaseMaterialInstance.cs | 5 +++++ FModel/Views/Snooper/SnimGui.cs | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index dd9a2706..f91288c2 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit dd9a2706022676a8bf529a31e6d311124e58942f +Subproject commit f91288c261ecf9cd5a276683a9812fe920265eb7 diff --git a/FModel/Creator/Bases/FN/BaseMaterialInstance.cs b/FModel/Creator/Bases/FN/BaseMaterialInstance.cs index 55e06923..c9776b8b 100644 --- a/FModel/Creator/Bases/FN/BaseMaterialInstance.cs +++ b/FModel/Creator/Bases/FN/BaseMaterialInstance.cs @@ -47,7 +47,12 @@ public override void ParseForInfo() } if (Preview == null) + { + if (material.TryGetValue(out FPackageIndex parent, "Parent")) + Utils.TryGetPackageIndexExport(parent, out material); + goto texture_finding; + } foreach (var vectorParameter in material.VectorParameterValues) { diff --git a/FModel/Views/Snooper/SnimGui.cs b/FModel/Views/Snooper/SnimGui.cs index 6dc35745..b64fd4f6 100644 --- a/FModel/Views/Snooper/SnimGui.cs +++ b/FModel/Views/Snooper/SnimGui.cs @@ -634,9 +634,9 @@ private void DrawMaterialInspector(Dictionary icons, Model mode ImGui.TreePop(); } ImGui.SetNextItemOpen(true, ImGuiCond.Appearing); - if (ImGui.TreeNode("Switchs")) + if (ImGui.TreeNode("Switches")) { - material.ImGuiDictionaries("switchs", material.Parameters.Switchs, true); + material.ImGuiDictionaries("switches", material.Parameters.Switches, true); ImGui.TreePop(); } ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);