1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Quick implimentation so bfres models can be batched exported

This commit is contained in:
KillzXGaming 2020-04-10 17:22:45 -04:00
parent 245dc010a7
commit 65532046c0
2 changed files with 27 additions and 2 deletions

View File

@ -20,7 +20,7 @@ using OpenTK;
namespace FirstPlugin
{
public class BFRES : BFRESWrapper, IFileFormat, ITextureContainer
public class BFRES : BFRESWrapper, IFileFormat, ITextureContainer, IExportableModel
{
public FileType FileType { get; set; } = FileType.Resource;
@ -58,6 +58,31 @@ namespace FirstPlugin
set { }
}
public IEnumerable<STGenericObject> ExportableMeshes => BFRESRender.Meshes;
public IEnumerable<STGenericMaterial> ExportableMaterials
{
get
{
List<FMAT> materials = new List<FMAT>();
foreach (var model in BFRESRender.models)
materials.AddRange(model.materials.Values);
return materials;
}
}
public IEnumerable<STGenericTexture> ExportableTextures => TextureList;
public STSkeleton ExportableSkeleton
{
get
{
STSkeleton skeleton = new STSkeleton();
foreach (var model in BFRESRender.models)
skeleton.bones.AddRange(model.Skeleton.bones);
return skeleton;
}
}
public override string ExportFilter => Utils.GetAllFilters(new BFRES());
//Stores the skeleton and models in this

View File

@ -1497,7 +1497,7 @@ namespace Toolbox
var textures = ((IExportableModel)fileFormat).ExportableTextures.ToList();
var skeleton = ((IExportableModel)fileFormat).ExportableSkeleton;
string name = Path.GetFileNameWithoutExtension(fileFormat.FileName);
// DAE.Export($"{outputFolder}/{name}.{extension}", daesettings, model, textures, skeleton);
DAE.Export($"{outputFolder}/{name}.{extension}", daesettings, model, textures, skeleton);
}
fileFormat.Unload();