mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 15:14:55 +00:00
Add LOD counter option for dummy LODs
This commit is contained in:
parent
2c754d3009
commit
a3bfa61275
4 changed files with 53 additions and 21 deletions
|
@ -1212,7 +1212,7 @@ namespace Bfres.Structs
|
|||
shape.BoneIndices = shape.GetIndices(Skeleton);
|
||||
|
||||
if (settings.CreateDummyLODs)
|
||||
shape.GenerateDummyLODMeshes();
|
||||
shape.GenerateDummyLODMeshes(settings.DummyLODCount);
|
||||
|
||||
if (ForceSkinInfluence)
|
||||
shape.VertexSkinCount = (byte)ForceSkinInfluenceMax;
|
||||
|
|
|
@ -371,12 +371,12 @@ namespace Bfres.Structs
|
|||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
||||
public void GenerateDummyLODMeshes()
|
||||
public void GenerateDummyLODMeshes(int count = 2)
|
||||
{
|
||||
var mesh = lodMeshes.FirstOrDefault();
|
||||
while (true)
|
||||
{
|
||||
if (lodMeshes.Count >= 3)
|
||||
if (lodMeshes.Count >= count + 1)
|
||||
break;
|
||||
|
||||
LOD_Mesh lod = new LOD_Mesh();
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
this.chkBoxFlipUvsY = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.chkBoxImportBones = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.panel8 = new Toolbox.Library.Forms.STPanel();
|
||||
this.chkCreateDummyLODs = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.stLabel3 = new Toolbox.Library.Forms.STLabel();
|
||||
this.gamePresetCB = new Toolbox.Library.Forms.STComboBox();
|
||||
this.chkResetColorParams = new Toolbox.Library.Forms.STCheckBox();
|
||||
|
@ -102,7 +103,8 @@
|
|||
this.stCheckBox1 = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.chkMapOriginalMaterials = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.ogSkinCountChkBox = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.chkCreateDummyLODs = new Toolbox.Library.Forms.STCheckBox();
|
||||
this.lodCountUD = new Toolbox.Library.Forms.NumericUpDownUint();
|
||||
this.stLabel4 = new Toolbox.Library.Forms.STLabel();
|
||||
this.contentContainer.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
|
@ -119,12 +121,13 @@
|
|||
this.tabPageAdvanced.SuspendLayout();
|
||||
this.stPanel1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.lodCountUD)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// contentContainer
|
||||
//
|
||||
this.contentContainer.Controls.Add(this.tabControl1);
|
||||
this.contentContainer.Size = new System.Drawing.Size(541, 396);
|
||||
this.contentContainer.Size = new System.Drawing.Size(541, 410);
|
||||
this.contentContainer.Controls.SetChildIndex(this.tabControl1, 0);
|
||||
//
|
||||
// panel1
|
||||
|
@ -457,6 +460,8 @@
|
|||
//
|
||||
// panel8
|
||||
//
|
||||
this.panel8.Controls.Add(this.stLabel4);
|
||||
this.panel8.Controls.Add(this.lodCountUD);
|
||||
this.panel8.Controls.Add(this.chkCreateDummyLODs);
|
||||
this.panel8.Controls.Add(this.stLabel3);
|
||||
this.panel8.Controls.Add(this.gamePresetCB);
|
||||
|
@ -484,9 +489,19 @@
|
|||
this.panel8.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel8.Location = new System.Drawing.Point(3, 3);
|
||||
this.panel8.Name = "panel8";
|
||||
this.panel8.Size = new System.Drawing.Size(524, 327);
|
||||
this.panel8.Size = new System.Drawing.Size(524, 341);
|
||||
this.panel8.TabIndex = 11;
|
||||
//
|
||||
// chkCreateDummyLODs
|
||||
//
|
||||
this.chkCreateDummyLODs.AutoSize = true;
|
||||
this.chkCreateDummyLODs.Location = new System.Drawing.Point(240, 263);
|
||||
this.chkCreateDummyLODs.Name = "chkCreateDummyLODs";
|
||||
this.chkCreateDummyLODs.Size = new System.Drawing.Size(210, 17);
|
||||
this.chkCreateDummyLODs.TabIndex = 37;
|
||||
this.chkCreateDummyLODs.Text = "Create Dummy LODs (always first level)";
|
||||
this.chkCreateDummyLODs.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// stLabel3
|
||||
//
|
||||
this.stLabel3.AutoSize = true;
|
||||
|
@ -674,7 +689,7 @@
|
|||
this.button1.Cursor = System.Windows.Forms.Cursors.Default;
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.button1.Location = new System.Drawing.Point(446, 302);
|
||||
this.button1.Location = new System.Drawing.Point(446, 318);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 17;
|
||||
|
@ -780,7 +795,7 @@
|
|||
this.tabControl1.myBackColor = System.Drawing.Color.Empty;
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(538, 362);
|
||||
this.tabControl1.Size = new System.Drawing.Size(538, 376);
|
||||
this.tabControl1.TabIndex = 18;
|
||||
//
|
||||
// tabPage2
|
||||
|
@ -789,7 +804,7 @@
|
|||
this.tabPage2.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(530, 333);
|
||||
this.tabPage2.Size = new System.Drawing.Size(530, 347);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Model Settings";
|
||||
//
|
||||
|
@ -799,7 +814,7 @@
|
|||
this.tabPageAdvanced.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPageAdvanced.Name = "tabPageAdvanced";
|
||||
this.tabPageAdvanced.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageAdvanced.Size = new System.Drawing.Size(192, 71);
|
||||
this.tabPageAdvanced.Size = new System.Drawing.Size(530, 333);
|
||||
this.tabPageAdvanced.TabIndex = 0;
|
||||
this.tabPageAdvanced.Text = "Advanced Settings";
|
||||
//
|
||||
|
@ -816,7 +831,7 @@
|
|||
this.stPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel1.Location = new System.Drawing.Point(3, 3);
|
||||
this.stPanel1.Name = "stPanel1";
|
||||
this.stPanel1.Size = new System.Drawing.Size(186, 65);
|
||||
this.stPanel1.Size = new System.Drawing.Size(524, 327);
|
||||
this.stPanel1.TabIndex = 17;
|
||||
//
|
||||
// tabPage1
|
||||
|
@ -833,7 +848,7 @@
|
|||
this.tabPage1.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(192, 71);
|
||||
this.tabPage1.Size = new System.Drawing.Size(530, 333);
|
||||
this.tabPage1.TabIndex = 2;
|
||||
this.tabPage1.Text = "Inject Mode";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
|
@ -944,19 +959,30 @@
|
|||
this.ogSkinCountChkBox.Text = "Keep Original Skin Count (can help crashes)";
|
||||
this.ogSkinCountChkBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkCreateDummyLODs
|
||||
// lodCountUD
|
||||
//
|
||||
this.chkCreateDummyLODs.AutoSize = true;
|
||||
this.chkCreateDummyLODs.Location = new System.Drawing.Point(240, 263);
|
||||
this.chkCreateDummyLODs.Name = "chkCreateDummyLODs";
|
||||
this.chkCreateDummyLODs.Size = new System.Drawing.Size(210, 17);
|
||||
this.chkCreateDummyLODs.TabIndex = 37;
|
||||
this.chkCreateDummyLODs.Text = "Create Dummy LODs (always first level)";
|
||||
this.chkCreateDummyLODs.UseVisualStyleBackColor = true;
|
||||
this.lodCountUD.Location = new System.Drawing.Point(319, 289);
|
||||
this.lodCountUD.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.lodCountUD.Name = "lodCountUD";
|
||||
this.lodCountUD.Size = new System.Drawing.Size(120, 20);
|
||||
this.lodCountUD.TabIndex = 38;
|
||||
//
|
||||
// stLabel4
|
||||
//
|
||||
this.stLabel4.AutoSize = true;
|
||||
this.stLabel4.Location = new System.Drawing.Point(237, 291);
|
||||
this.stLabel4.Name = "stLabel4";
|
||||
this.stLabel4.Size = new System.Drawing.Size(63, 13);
|
||||
this.stLabel4.TabIndex = 39;
|
||||
this.stLabel4.Text = "LOD Count:";
|
||||
//
|
||||
// BfresModelImportSettings
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(547, 398);
|
||||
this.ClientSize = new System.Drawing.Size(547, 412);
|
||||
this.Name = "BfresModelImportSettings";
|
||||
this.Text = "Import Settings";
|
||||
this.Load += new System.EventHandler(this.BfresModelImportSettings_Load);
|
||||
|
@ -986,6 +1012,7 @@
|
|||
this.stPanel1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.lodCountUD)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -1067,5 +1094,7 @@
|
|||
private Toolbox.Library.Forms.STLabel stLabel3;
|
||||
private Toolbox.Library.Forms.STComboBox gamePresetCB;
|
||||
private Toolbox.Library.Forms.STCheckBox chkCreateDummyLODs;
|
||||
private Toolbox.Library.Forms.STLabel stLabel4;
|
||||
private Toolbox.Library.Forms.NumericUpDownUint lodCountUD;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace FirstPlugin
|
|||
ogSkinCountChkBox.Checked = false;
|
||||
chkMapOriginalMaterials.Checked = true;
|
||||
|
||||
lodCountUD.Value = 2;
|
||||
|
||||
tabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
|
||||
foreach (GamePreset val in Enum.GetValues(typeof(GamePreset))) {
|
||||
|
@ -73,6 +75,7 @@ namespace FirstPlugin
|
|||
}
|
||||
|
||||
public bool CreateDummyLODs => chkCreateDummyLODs.Checked;
|
||||
public int DummyLODCount => (int)lodCountUD.Value;
|
||||
|
||||
public bool UseOriginalAttributes => chkOriginalAttributesFormats.Checked;
|
||||
public bool UseOriginalAttributeFormats => chkOriginalAttributesFormats.Checked;
|
||||
|
|
Loading…
Reference in a new issue