From 943fae319e93643bfe41b0a1866c6214527e3ea7 Mon Sep 17 00:00:00 2001 From: lobster6 Date: Mon, 17 Jan 2022 22:11:22 +0100 Subject: [PATCH] Fix batch exportation of pokemon models --- .../FileFormats/Pokemon/GFLX/GFBMDL/GFBMDL.cs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/File_Format_Library/FileFormats/Pokemon/GFLX/GFBMDL/GFBMDL.cs b/File_Format_Library/FileFormats/Pokemon/GFLX/GFBMDL/GFBMDL.cs index cb347a34..f397fc7d 100644 --- a/File_Format_Library/FileFormats/Pokemon/GFLX/GFBMDL/GFBMDL.cs +++ b/File_Format_Library/FileFormats/Pokemon/GFLX/GFBMDL/GFBMDL.cs @@ -16,7 +16,7 @@ using Newtonsoft.Json; namespace FirstPlugin { - public class GFBMDL : TreeNodeFile, IContextMenuNode, IFileFormat + public class GFBMDL : TreeNodeFile, IContextMenuNode, IFileFormat, IExportableModel { public FileType FileType { get; set; } = FileType.Model; @@ -761,5 +761,27 @@ namespace FirstPlugin { } + + public IEnumerable ExportableMeshes => Model.GenericMeshes; + public IEnumerable ExportableMaterials => Model.GenericMaterials; + public IEnumerable ExportableTextures => TextureList; + public STSkeleton ExportableSkeleton => Model.Skeleton; + + public List TextureList + { + get + { + //Export all textures that use the same archive + List textures = new List(); + foreach (var bntx in PluginRuntime.bntxContainers) + foreach (var tex in bntx.Textures.Values) + { + if (Model.Textures.Contains(tex.Text)) + textures.Add(tex); + } + + return textures; + } + } } }