diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 93f9ff9c..f8f83621 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 61cbdfa9..4e74952b 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 6a78547a..29166757 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs index 6cf16623..0011a838 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMAA.cs @@ -499,19 +499,28 @@ namespace Bfres.Structs public override STGenericTexture GetActiveTexture(int index) { + string name = ""; + try + { + name = MatAnimWrapper.Textures[(int)index]; + } + catch + { + throw new Exception("Index out of range " + index); + } + + var bfres = (BFRES)MatAnimWrapper.Parent.Parent.Parent; + var BfresTextures = bfres.GetBNTX; + if (BfresTextures != null) + { + if (BfresTextures.Textures.ContainsKey(name)) + return BfresTextures.Textures[name]; + } + foreach (var bntx in PluginRuntime.bntxContainers) { - try - { - string name = MatAnimWrapper.Textures[(int)index]; - - if (bntx.Textures.ContainsKey(name)) - return bntx.Textures[name]; - } - catch - { - throw new Exception("Index out of range " + index); - } + if (bntx.Textures.ContainsKey(name)) + return bntx.Textures[name]; } return null; } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs index 898e3512..2953eddf 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FTXP.cs @@ -149,6 +149,15 @@ namespace Bfres.Structs public override STGenericTexture GetActiveTexture(int index) { string name = GetActiveTextureNameByIndex(index); + + var bfres = (BFRES)AnimWrapper.Parent.Parent.Parent; + var BfresTextures = bfres.GetFTEXContainer; + if (BfresTextures != null) + { + if (BfresTextures.ResourceNodes.ContainsKey(name)) + return (STGenericTexture)BfresTextures.ResourceNodes[name]; + } + foreach (var ftexFolder in PluginRuntime.ftexContainers) { if (ftexFolder.ResourceNodes.ContainsKey(name)) diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index f1cfd99a..3d44d56a 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ