From 5f3cde8d57d1fabde9aaf8f611136e6dbac8b0a0 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 22 Oct 2022 11:13:21 -0400 Subject: [PATCH] Add toggle to export textures or not for batch exporting models --- .../Forms/BatchFormatExport.Designer.cs | 21 ++++++++++++++++--- .../Forms/BatchFormatExport.cs | 2 ++ Toolbox/MainForm.cs | 2 ++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Switch_Toolbox_Library/Forms/BatchFormatExport.Designer.cs b/Switch_Toolbox_Library/Forms/BatchFormatExport.Designer.cs index ac9f4f21..b96bc2f5 100644 --- a/Switch_Toolbox_Library/Forms/BatchFormatExport.Designer.cs +++ b/Switch_Toolbox_Library/Forms/BatchFormatExport.Designer.cs @@ -34,6 +34,7 @@ this.OkButton = new Toolbox.Library.Forms.STButton(); this.button1 = new Toolbox.Library.Forms.STButton(); this.comboBox1 = new Toolbox.Library.Forms.STComboBox(); + this.chkExportTextures = new Toolbox.Library.Forms.STCheckBox(); this.SuspendLayout(); // // chkChannelComponents @@ -76,7 +77,7 @@ // this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.OkButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.OkButton.Location = new System.Drawing.Point(82, 121); + this.OkButton.Location = new System.Drawing.Point(83, 138); this.OkButton.Name = "OkButton"; this.OkButton.Size = new System.Drawing.Size(63, 23); this.OkButton.TabIndex = 2; @@ -88,7 +89,7 @@ // this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Location = new System.Drawing.Point(167, 121); + this.button1.Location = new System.Drawing.Point(168, 138); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(63, 23); this.button1.TabIndex = 1; @@ -108,11 +109,24 @@ this.comboBox1.TabIndex = 0; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // + // chkExportTextures + // + this.chkExportTextures.AutoSize = true; + this.chkExportTextures.Checked = true; + this.chkExportTextures.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkExportTextures.Location = new System.Drawing.Point(11, 108); + this.chkExportTextures.Name = "chkExportTextures"; + this.chkExportTextures.Size = new System.Drawing.Size(100, 17); + this.chkExportTextures.TabIndex = 6; + this.chkExportTextures.Text = "Export Textures"; + this.chkExportTextures.UseVisualStyleBackColor = true; + // // BatchFormatExport // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(246, 156); + this.ClientSize = new System.Drawing.Size(246, 173); + this.Controls.Add(this.chkExportTextures); this.Controls.Add(this.chkChannelComponents); this.Controls.Add(this.chkSeperateArchives); this.Controls.Add(this.chkSeperateTextureContainers); @@ -134,5 +148,6 @@ private Forms.STCheckBox chkSeperateTextureContainers; private Forms.STCheckBox chkSeperateArchives; private Forms.STCheckBox chkChannelComponents; + private Forms.STCheckBox chkExportTextures; } } \ No newline at end of file diff --git a/Switch_Toolbox_Library/Forms/BatchFormatExport.cs b/Switch_Toolbox_Library/Forms/BatchFormatExport.cs index 8d398648..a9e4decd 100644 --- a/Switch_Toolbox_Library/Forms/BatchFormatExport.cs +++ b/Switch_Toolbox_Library/Forms/BatchFormatExport.cs @@ -22,6 +22,7 @@ namespace Toolbox.Library public bool SeperateTextureContainers; public bool SeperateArchiveFiles; public bool UseTextureChannelComponents; + public bool ExportTextures; } public BatchFormatExport(List Formats) @@ -63,6 +64,7 @@ namespace Toolbox.Library BatchSettings.SeperateTextureContainers = chkSeperateTextureContainers.Checked; BatchSettings.SeperateArchiveFiles = chkSeperateArchives.Checked; BatchSettings.UseTextureChannelComponents = chkChannelComponents.Checked; + BatchSettings.ExportTextures = chkExportTextures.Checked; this.Close(); } diff --git a/Toolbox/MainForm.cs b/Toolbox/MainForm.cs index d0315c9b..53078713 100644 --- a/Toolbox/MainForm.cs +++ b/Toolbox/MainForm.cs @@ -1521,6 +1521,7 @@ namespace Toolbox DAE.ExportSettings daesettings = new DAE.ExportSettings(); daesettings.SuppressConfirmDialog = true; + daesettings.ExportTextures = settings.ExportTextures; var textures = ((IExportableModelContainer)fileFormat).ExportableTextures.ToList(); foreach (var model in ((IExportableModelContainer)fileFormat).ExportableModels) @@ -1543,6 +1544,7 @@ namespace Toolbox DAE.ExportSettings daesettings = new DAE.ExportSettings(); daesettings.SuppressConfirmDialog = true; + daesettings.ExportTextures = settings.ExportTextures; var model = new STGenericModel(); model.Materials = ((IExportableModel)fileFormat).ExportableMaterials;