Some BCRES/BCH adjustments

This commit is contained in:
KillzXGaming 2020-01-16 20:51:23 -05:00
parent fb7017be52
commit 48af05941f
6 changed files with 3 additions and 21 deletions

View file

@ -36,7 +36,7 @@ namespace FirstPlugin.CtrLibrary
{
using (var reader = new Toolbox.Library.IO.FileReader(stream, true)) {
return (reader.CheckSignature(3, "BCH") ||
reader.CheckSignature(4, "CGFX"));
reader.CheckSignature(4, "CGFX"));
// (GFPackage.IsValidPackage(stream));
}
}

View file

@ -59,7 +59,7 @@ namespace FirstPlugin.CtrLibrary
private void ExportAction(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Supported Formats|*.json;*.cmat;";
sfd.Filter = "Supported Formats|*.json;";
sfd.FileName = Text;
sfd.DefaultExt = "json";
if (sfd.ShowDialog() == DialogResult.OK) {
@ -68,11 +68,6 @@ namespace FirstPlugin.CtrLibrary
string json = JsonConvert.SerializeObject(Material, Formatting.Indented);
System.IO.File.WriteAllText(sfd.FileName, json);
}
if (ext == ".cmat") {
var settings = new SPICA.Formats.Generic.CTR.CMDL.CMDLSettings();
settings.TextureFilePath = sfd.FileName.Replace("cmat", "ctex");
SPICA.Formats.Generic.CTR.CMDL.ExportCMAT(Material, settings, sfd.FileName);
}
}
}

View file

@ -30,19 +30,6 @@ namespace FirstPlugin.CtrLibrary
string ext = Utils.GetExtension(FileName);
switch (ext)
{
case ".cmdl":
string ctexPath = FileName.Replace("cmdl", "ctex");
string cltsPath = FileName.Replace("cmdl", "clts");
var settings = new SPICA.Formats.Generic.CTR.CMDL.CMDLSettings();
settings.TextureFilePath = System.IO.Path.GetFileName(ctexPath);
settings.LookupFilePath = System.IO.Path.GetFileName(cltsPath);
Model.Export(FileName, settings);
List<H3DTexture> textures = new List<H3DTexture>();
if (BchParent.H3DFile.Textures?.Count > 0)
SPICA.Formats.Generic.CTR.CTEX.Export(BchParent.H3DFile.Textures, ctexPath);
break;
case ".dae":
ExportModelSettings exportDlg = new ExportModelSettings();
if (exportDlg.ShowDialog() == DialogResult.OK)

View file

@ -41,7 +41,7 @@ namespace FirstPlugin
public static string FSCN = GetFilter(".bfscn", ".yaml", ".json");
public static string FSHA = GetFilter(".bfspa");
public static string CMDL = GetFilter(".dae", ".cmdl");
public static string CMDL = GetFilter(".dae");
public static string NUTEXB = GetFilter(".dds",".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");
public static string XTX = GetFilter(".dds", ".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");

Binary file not shown.

Binary file not shown.