From 2d217b6b943ae5e61f9e11a82018228c9f645193 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 16 Nov 2019 08:58:10 -0500 Subject: [PATCH] Add option to use previous exporter incase something breaks --- Switch_Toolbox_Library/FileFormats/DAE/DAE.cs | 11 +++++++++++ .../Forms/Dialogs/ExportModelSettings.Designer.cs | 15 +++++++++++++++ .../Forms/Dialogs/ExportModelSettings.cs | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs b/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs index bcc3534b..cd5ad655 100644 --- a/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs +++ b/Switch_Toolbox_Library/FileFormats/DAE/DAE.cs @@ -18,6 +18,8 @@ namespace Toolbox.Library { public class ExportSettings { + public bool UseOldExporter = false; + public bool FlipTexCoordsVertical = true; public Version FileVersion = new Version(); @@ -55,6 +57,15 @@ namespace Toolbox.Library if (Materials == null) Materials = new List(); + 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); using (ColladaWriter writer = new ColladaWriter(FileName, settings)) diff --git a/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.Designer.cs b/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.Designer.cs index ea587eb9..e072faac 100644 --- a/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.Designer.cs +++ b/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.Designer.cs @@ -32,11 +32,13 @@ this.stButton1 = new Toolbox.Library.Forms.STButton(); this.stButton2 = new Toolbox.Library.Forms.STButton(); this.chkFlipUvsVertical = new Toolbox.Library.Forms.STCheckBox(); + this.chkOldExporter = new Toolbox.Library.Forms.STCheckBox(); this.contentContainer.SuspendLayout(); this.SuspendLayout(); // // contentContainer // + this.contentContainer.Controls.Add(this.chkOldExporter); this.contentContainer.Controls.Add(this.chkFlipUvsVertical); this.contentContainer.Controls.Add(this.stButton2); this.contentContainer.Controls.Add(this.stButton1); @@ -46,6 +48,7 @@ this.contentContainer.Controls.SetChildIndex(this.stButton1, 0); this.contentContainer.Controls.SetChildIndex(this.stButton2, 0); this.contentContainer.Controls.SetChildIndex(this.chkFlipUvsVertical, 0); + this.contentContainer.Controls.SetChildIndex(this.chkOldExporter, 0); // // exportTexturesChkBox // @@ -93,6 +96,17 @@ this.chkFlipUvsVertical.UseVisualStyleBackColor = true; 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 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -112,5 +126,6 @@ private STButton stButton2; private STButton stButton1; private STCheckBox chkFlipUvsVertical; + protected STCheckBox chkOldExporter; } } \ No newline at end of file diff --git a/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.cs b/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.cs index 8571f5a4..56596e40 100644 --- a/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.cs +++ b/Switch_Toolbox_Library/Forms/Dialogs/ExportModelSettings.cs @@ -29,5 +29,9 @@ namespace Toolbox.Library.Forms private void chkFlipUvsVertical_CheckedChanged(object sender, EventArgs e) { Settings.FlipTexCoordsVertical = chkFlipUvsVertical.Checked; } + + private void stCheckBox1_CheckedChanged(object sender, EventArgs e) { + Settings.UseOldExporter = chkOldExporter.Checked; + } } }