Sort bone indices properly to prevent possible stretching.
This commit is contained in:
parent
06a26c586f
commit
4536246d6f
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)
|
if (RigidIds.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (int id in RigidIds)
|
foreach (int id in RigidIds)
|
||||||
@ -1238,6 +1256,9 @@ namespace Bfres.Structs
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indices.Sort();
|
||||||
|
|
||||||
STConsole.WriteLine($"Total Indices for {Text} {indices.Count}");
|
STConsole.WriteLine($"Total Indices for {Text} {indices.Count}");
|
||||||
|
|
||||||
return indices;
|
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)
|
this.stLabel17.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| 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.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.TabIndex = 2;
|
||||||
this.stLabel17.Text = "These options can prevent file size restrictions. Check these if you want them t" +
|
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
|
// chkBotwFileTable
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user