mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
Sort bone indices properly to prevent possible stretching.
This commit is contained in:
parent
06a26c586f
commit
4536246d6f
5 changed files with 24 additions and 3 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1027,6 +1027,24 @@ namespace Bfres.Structs
|
|||
}
|
||||
}
|
||||
|
||||
//Sort smooth bones
|
||||
if (v.boneWeights.Count > 0)
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
SortedDictionary<int, float> envelopes = new SortedDictionary<int, float>();
|
||||
for (j = 0; j < v.boneIds.Count; j++)
|
||||
envelopes.Add(v.boneIds[j], v.boneWeights[j]);
|
||||
|
||||
j = 0;
|
||||
foreach (var envelope in envelopes)
|
||||
{
|
||||
v.boneIds[j] = envelope.Key;
|
||||
v.boneWeights[j] = envelope.Value;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (RigidIds.Count > 0)
|
||||
{
|
||||
foreach (int id in RigidIds)
|
||||
|
@ -1238,6 +1256,9 @@ namespace Bfres.Structs
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
indices.Sort();
|
||||
|
||||
STConsole.WriteLine($"Total Indices for {Text} {indices.Count}");
|
||||
|
||||
return indices;
|
||||
|
|
6
Toolbox/GUI/Settings.Designer.cs
generated
6
Toolbox/GUI/Settings.Designer.cs
generated
|
@ -1233,12 +1233,12 @@
|
|||
//
|
||||
this.stLabel17.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.stLabel17.Location = new System.Drawing.Point(25, 11);
|
||||
this.stLabel17.Location = new System.Drawing.Point(3, 3);
|
||||
this.stLabel17.Name = "stLabel17";
|
||||
this.stLabel17.Size = new System.Drawing.Size(457, 47);
|
||||
this.stLabel17.Size = new System.Drawing.Size(495, 55);
|
||||
this.stLabel17.TabIndex = 2;
|
||||
this.stLabel17.Text = "These options can prevent file size restrictions. Check these if you want them t" +
|
||||
"o be adjusted when a file gets saved. ";
|
||||
"o be adjusted when a file gets saved. ";
|
||||
//
|
||||
// chkBotwFileTable
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue