mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Fix bone indices not saving and bounding radius.
This commit is contained in:
parent
ba760057dd
commit
5264ec4f5d
12 changed files with 43 additions and 19 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -179,8 +179,6 @@ namespace FirstPlugin
|
|||
public static void ReadShapesVertices(FSHP fshp, Shape shp, VertexBuffer vertexBuffer, FMDL model)
|
||||
{
|
||||
fshp.boundingBoxes.Clear();
|
||||
fshp.boundingRadius.Clear();
|
||||
fshp.BoneIndices.Clear();
|
||||
|
||||
foreach (Bounding bnd in shp.SubMeshBoundings)
|
||||
{
|
||||
|
@ -189,10 +187,8 @@ namespace FirstPlugin
|
|||
box.Extend = new Vector3(bnd.Extent.X, bnd.Extent.Y, bnd.Extent.Z);
|
||||
fshp.boundingBoxes.Add(box);
|
||||
}
|
||||
foreach (float rad in shp.RadiusArray)
|
||||
{
|
||||
fshp.boundingRadius.Add(rad);
|
||||
}
|
||||
|
||||
fshp.boundingRadius = shp.RadiusArray.ToList();
|
||||
|
||||
fshp.VertexBufferIndex = shp.VertexBufferIndex;
|
||||
fshp.Shape = shp;
|
||||
|
@ -203,11 +199,7 @@ namespace FirstPlugin
|
|||
fshp.TargetAttribCount = shp.TargetAttribCount;
|
||||
fshp.MaterialIndex = shp.MaterialIndex;
|
||||
|
||||
if (shp.SkinBoneIndices != null)
|
||||
{
|
||||
foreach (ushort bn in shp.SkinBoneIndices)
|
||||
fshp.BoneIndices.Add(bn);
|
||||
}
|
||||
fshp.BoneIndices = shp.SkinBoneIndices.ToList();
|
||||
|
||||
ReadMeshes(fshp, shp);
|
||||
ReadVertexBuffer(fshp, vertexBuffer, model);
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -15,9 +15,6 @@ namespace Switch_Toolbox.Library.Animations
|
|||
{
|
||||
anim.NextFrame(skeleton);
|
||||
|
||||
//Add frames to the playing animation
|
||||
anim.Frame += 1f;
|
||||
|
||||
//Reset it when it reaches the total frame count
|
||||
if (anim.Frame >= anim.FrameCount)
|
||||
anim.Frame = 0;
|
||||
|
@ -36,6 +33,9 @@ namespace Switch_Toolbox.Library.Animations
|
|||
seAnim.AddRotationKey(boneAnim.Text, frame, rotation.X, rotation.Y, rotation.Z, rotation.W);
|
||||
seAnim.AddScaleKey(boneAnim.Text, frame, scale.X, scale.Y, scale.Z);
|
||||
}
|
||||
|
||||
//Add frames to the playing animation
|
||||
anim.Frame += 1f;
|
||||
}
|
||||
|
||||
seAnim.Write(FileName);
|
||||
|
|
2
Toolbox/GUI/Credits.Designer.cs
generated
2
Toolbox/GUI/Credits.Designer.cs
generated
|
@ -1,4 +1,4 @@
|
|||
namespace Switch_Toolbox
|
||||
namespace Toolbox
|
||||
{
|
||||
partial class CreditsWindow
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Switch_Toolbox
|
||||
namespace Toolbox
|
||||
{
|
||||
public partial class CreditsWindow : Form
|
||||
{
|
||||
|
|
27
Toolbox/MainForm.Designer.cs
generated
27
Toolbox/MainForm.Designer.cs
generated
|
@ -59,6 +59,8 @@
|
|||
this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.stToolStrip1 = new Switch_Toolbox.Library.Forms.STToolStrip();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.creditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.stPanel1.SuspendLayout();
|
||||
this.tabControlContextMenuStrip.SuspendLayout();
|
||||
|
@ -76,12 +78,14 @@
|
|||
this.toolsToolStripMenuItem,
|
||||
this.experimentalToolStripMenuItem,
|
||||
this.windowsToolStripMenuItem,
|
||||
this.settingsToolStripMenuItem});
|
||||
this.settingsToolStripMenuItem,
|
||||
this.aboutToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(1108, 25);
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
this.menuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.menuStrip1_ItemClicked);
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
|
@ -231,7 +235,7 @@
|
|||
// mainSettingsToolStripMenuItem
|
||||
//
|
||||
this.mainSettingsToolStripMenuItem.Name = "mainSettingsToolStripMenuItem";
|
||||
this.mainSettingsToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.mainSettingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.mainSettingsToolStripMenuItem.Text = "Main Settings";
|
||||
this.mainSettingsToolStripMenuItem.Click += new System.EventHandler(this.mainSettingsToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -239,7 +243,7 @@
|
|||
//
|
||||
this.fileAssociationsToolStripMenuItem.Enabled = false;
|
||||
this.fileAssociationsToolStripMenuItem.Name = "fileAssociationsToolStripMenuItem";
|
||||
this.fileAssociationsToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.fileAssociationsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.fileAssociationsToolStripMenuItem.Text = "File Associations";
|
||||
this.fileAssociationsToolStripMenuItem.Click += new System.EventHandler(this.fileAssociationsToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -309,6 +313,21 @@
|
|||
this.toolStripButton1.Text = "toolStripButton1";
|
||||
this.toolStripButton1.ToolTipText = "Save File";
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.creditsToolStripMenuItem});
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 21);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
//
|
||||
// creditsToolStripMenuItem
|
||||
//
|
||||
this.creditsToolStripMenuItem.Name = "creditsToolStripMenuItem";
|
||||
this.creditsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.creditsToolStripMenuItem.Text = "Credits";
|
||||
this.creditsToolStripMenuItem.Click += new System.EventHandler(this.creditsToolStripMenuItem_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -373,6 +392,8 @@
|
|||
private Switch_Toolbox.Library.Forms.STToolStrip stToolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripMenuItem newFromFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem creditsToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -899,5 +899,16 @@ namespace Toolbox
|
|||
FileAssociationForm form = new FileAssociationForm();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
CreditsWindow window = new CreditsWindow();
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue