Some BCRES/BCH adjustments
This commit is contained in:
parent
fb7017be52
commit
48af05941f
@ -59,7 +59,7 @@ namespace FirstPlugin.CtrLibrary
|
|||||||
private void ExportAction(object sender, EventArgs e)
|
private void ExportAction(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog();
|
||||||
sfd.Filter = "Supported Formats|*.json;*.cmat;";
|
sfd.Filter = "Supported Formats|*.json;";
|
||||||
sfd.FileName = Text;
|
sfd.FileName = Text;
|
||||||
sfd.DefaultExt = "json";
|
sfd.DefaultExt = "json";
|
||||||
if (sfd.ShowDialog() == DialogResult.OK) {
|
if (sfd.ShowDialog() == DialogResult.OK) {
|
||||||
@ -68,11 +68,6 @@ namespace FirstPlugin.CtrLibrary
|
|||||||
string json = JsonConvert.SerializeObject(Material, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(Material, Formatting.Indented);
|
||||||
System.IO.File.WriteAllText(sfd.FileName, json);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,19 +30,6 @@ namespace FirstPlugin.CtrLibrary
|
|||||||
string ext = Utils.GetExtension(FileName);
|
string ext = Utils.GetExtension(FileName);
|
||||||
switch (ext)
|
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":
|
case ".dae":
|
||||||
ExportModelSettings exportDlg = new ExportModelSettings();
|
ExportModelSettings exportDlg = new ExportModelSettings();
|
||||||
if (exportDlg.ShowDialog() == DialogResult.OK)
|
if (exportDlg.ShowDialog() == DialogResult.OK)
|
||||||
|
@ -41,7 +41,7 @@ namespace FirstPlugin
|
|||||||
public static string FSCN = GetFilter(".bfscn", ".yaml", ".json");
|
public static string FSCN = GetFilter(".bfscn", ".yaml", ".json");
|
||||||
public static string FSHA = GetFilter(".bfspa");
|
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 NUTEXB = GetFilter(".dds",".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");
|
||||||
public static string XTX = 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.
Loading…
x
Reference in New Issue
Block a user