From 46162e537990299c8fd660345aeec1a40b0be51c Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Tue, 30 May 2023 20:27:57 -0400 Subject: [PATCH] Support loading txtg into gui and exporting them --- File_Format_Library/FileFormats/BFRES/BFRES.cs | 8 ++++++++ .../FileFormats/BFRES/Bfres Structs/SubFiles/FMDL.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/File_Format_Library/FileFormats/BFRES/BFRES.cs b/File_Format_Library/FileFormats/BFRES/BFRES.cs index ab0934b1..8a100eea 100644 --- a/File_Format_Library/FileFormats/BFRES/BFRES.cs +++ b/File_Format_Library/FileFormats/BFRES/BFRES.cs @@ -835,7 +835,15 @@ namespace FirstPlugin } if (isMeshCodec) + { MeshCodec.PrepareTexToGo(resFile); + STTextureFolder texfolder = new STTextureFolder("TexToGo"); + this.Nodes.Add(texfolder); + foreach (var tex in MeshCodec.TextureList) + { + texfolder.Nodes.Add(tex); + } + } DrawableContainer.Drawables.Add(BFRESRender); diff --git a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL.cs b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL.cs index 7c6a5651..55ecbd54 100644 --- a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL.cs +++ b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL.cs @@ -588,6 +588,8 @@ namespace Bfres.Structs if (ftexCont.ResourceNodes.ContainsKey(texref)) textures.Add((FTEX)ftexCont.ResourceNodes[texref]); } + if (PluginRuntime.TextureCache.ContainsKey(texref)) + textures.Add(PluginRuntime.TextureCache[texref]); } return textures;