Quick implimentation so bfres models can be batched exported
This commit is contained in:
parent
245dc010a7
commit
65532046c0
@ -20,7 +20,7 @@ using OpenTK;
|
|||||||
|
|
||||||
namespace FirstPlugin
|
namespace FirstPlugin
|
||||||
{
|
{
|
||||||
public class BFRES : BFRESWrapper, IFileFormat, ITextureContainer
|
public class BFRES : BFRESWrapper, IFileFormat, ITextureContainer, IExportableModel
|
||||||
{
|
{
|
||||||
public FileType FileType { get; set; } = FileType.Resource;
|
public FileType FileType { get; set; } = FileType.Resource;
|
||||||
|
|
||||||
@ -58,6 +58,31 @@ namespace FirstPlugin
|
|||||||
set { }
|
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());
|
public override string ExportFilter => Utils.GetAllFilters(new BFRES());
|
||||||
|
|
||||||
//Stores the skeleton and models in this
|
//Stores the skeleton and models in this
|
||||||
|
@ -1497,7 +1497,7 @@ namespace Toolbox
|
|||||||
var textures = ((IExportableModel)fileFormat).ExportableTextures.ToList();
|
var textures = ((IExportableModel)fileFormat).ExportableTextures.ToList();
|
||||||
var skeleton = ((IExportableModel)fileFormat).ExportableSkeleton;
|
var skeleton = ((IExportableModel)fileFormat).ExportableSkeleton;
|
||||||
string name = Path.GetFileNameWithoutExtension(fileFormat.FileName);
|
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();
|
fileFormat.Unload();
|
||||||
|
Loading…
Reference in New Issue
Block a user