1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Sort bone indices properly to prevent possible stretching.

This commit is contained in:
KillzXGaming 2019-06-11 16:44:59 -04:00
parent 06a26c586f
commit 4536246d6f
5 changed files with 24 additions and 3 deletions

Binary file not shown.

View File

@ -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;

View File

@ -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
// //