mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 14:30:26 +00:00
Add option to use previous exporter incase something breaks
This commit is contained in:
parent
f8a1e1f82d
commit
2d217b6b94
3 changed files with 30 additions and 0 deletions
|
@ -18,6 +18,8 @@ namespace Toolbox.Library
|
||||||
{
|
{
|
||||||
public class ExportSettings
|
public class ExportSettings
|
||||||
{
|
{
|
||||||
|
public bool UseOldExporter = false;
|
||||||
|
|
||||||
public bool FlipTexCoordsVertical = true;
|
public bool FlipTexCoordsVertical = true;
|
||||||
|
|
||||||
public Version FileVersion = new Version();
|
public Version FileVersion = new Version();
|
||||||
|
@ -55,6 +57,15 @@ namespace Toolbox.Library
|
||||||
if (Materials == null)
|
if (Materials == null)
|
||||||
Materials = new List<STGenericMaterial>();
|
Materials = new List<STGenericMaterial>();
|
||||||
|
|
||||||
|
if (settings.UseOldExporter)
|
||||||
|
{
|
||||||
|
AssimpSaver saver = new AssimpSaver();
|
||||||
|
STGenericModel model = new STGenericModel();
|
||||||
|
model.Objects = Meshes;
|
||||||
|
model.Materials = Materials;
|
||||||
|
saver.SaveFromModel(model, FileName, Textures, skeleton, NodeArray);
|
||||||
|
}
|
||||||
|
|
||||||
string TexturePath = System.IO.Path.GetDirectoryName(FileName);
|
string TexturePath = System.IO.Path.GetDirectoryName(FileName);
|
||||||
|
|
||||||
using (ColladaWriter writer = new ColladaWriter(FileName, settings))
|
using (ColladaWriter writer = new ColladaWriter(FileName, settings))
|
||||||
|
|
|
@ -32,11 +32,13 @@
|
||||||
this.stButton1 = new Toolbox.Library.Forms.STButton();
|
this.stButton1 = new Toolbox.Library.Forms.STButton();
|
||||||
this.stButton2 = new Toolbox.Library.Forms.STButton();
|
this.stButton2 = new Toolbox.Library.Forms.STButton();
|
||||||
this.chkFlipUvsVertical = new Toolbox.Library.Forms.STCheckBox();
|
this.chkFlipUvsVertical = new Toolbox.Library.Forms.STCheckBox();
|
||||||
|
this.chkOldExporter = new Toolbox.Library.Forms.STCheckBox();
|
||||||
this.contentContainer.SuspendLayout();
|
this.contentContainer.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// contentContainer
|
// contentContainer
|
||||||
//
|
//
|
||||||
|
this.contentContainer.Controls.Add(this.chkOldExporter);
|
||||||
this.contentContainer.Controls.Add(this.chkFlipUvsVertical);
|
this.contentContainer.Controls.Add(this.chkFlipUvsVertical);
|
||||||
this.contentContainer.Controls.Add(this.stButton2);
|
this.contentContainer.Controls.Add(this.stButton2);
|
||||||
this.contentContainer.Controls.Add(this.stButton1);
|
this.contentContainer.Controls.Add(this.stButton1);
|
||||||
|
@ -46,6 +48,7 @@
|
||||||
this.contentContainer.Controls.SetChildIndex(this.stButton1, 0);
|
this.contentContainer.Controls.SetChildIndex(this.stButton1, 0);
|
||||||
this.contentContainer.Controls.SetChildIndex(this.stButton2, 0);
|
this.contentContainer.Controls.SetChildIndex(this.stButton2, 0);
|
||||||
this.contentContainer.Controls.SetChildIndex(this.chkFlipUvsVertical, 0);
|
this.contentContainer.Controls.SetChildIndex(this.chkFlipUvsVertical, 0);
|
||||||
|
this.contentContainer.Controls.SetChildIndex(this.chkOldExporter, 0);
|
||||||
//
|
//
|
||||||
// exportTexturesChkBox
|
// exportTexturesChkBox
|
||||||
//
|
//
|
||||||
|
@ -93,6 +96,17 @@
|
||||||
this.chkFlipUvsVertical.UseVisualStyleBackColor = true;
|
this.chkFlipUvsVertical.UseVisualStyleBackColor = true;
|
||||||
this.chkFlipUvsVertical.CheckedChanged += new System.EventHandler(this.chkFlipUvsVertical_CheckedChanged);
|
this.chkFlipUvsVertical.CheckedChanged += new System.EventHandler(this.chkFlipUvsVertical_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// chkOldExporter
|
||||||
|
//
|
||||||
|
this.chkOldExporter.AutoSize = true;
|
||||||
|
this.chkOldExporter.Location = new System.Drawing.Point(23, 104);
|
||||||
|
this.chkOldExporter.Name = "chkOldExporter";
|
||||||
|
this.chkOldExporter.Size = new System.Drawing.Size(200, 17);
|
||||||
|
this.chkOldExporter.TabIndex = 15;
|
||||||
|
this.chkOldExporter.Text = "Use Old Exporter (If new one breaks)";
|
||||||
|
this.chkOldExporter.UseVisualStyleBackColor = true;
|
||||||
|
this.chkOldExporter.CheckedChanged += new System.EventHandler(this.stCheckBox1_CheckedChanged);
|
||||||
|
//
|
||||||
// ExportModelSettings
|
// ExportModelSettings
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -112,5 +126,6 @@
|
||||||
private STButton stButton2;
|
private STButton stButton2;
|
||||||
private STButton stButton1;
|
private STButton stButton1;
|
||||||
private STCheckBox chkFlipUvsVertical;
|
private STCheckBox chkFlipUvsVertical;
|
||||||
|
protected STCheckBox chkOldExporter;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,5 +29,9 @@ namespace Toolbox.Library.Forms
|
||||||
private void chkFlipUvsVertical_CheckedChanged(object sender, EventArgs e) {
|
private void chkFlipUvsVertical_CheckedChanged(object sender, EventArgs e) {
|
||||||
Settings.FlipTexCoordsVertical = chkFlipUvsVertical.Checked;
|
Settings.FlipTexCoordsVertical = chkFlipUvsVertical.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stCheckBox1_CheckedChanged(object sender, EventArgs e) {
|
||||||
|
Settings.UseOldExporter = chkOldExporter.Checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue