Conditionally still check for weights1 even if weights0 is 0

This commit is contained in:
Passive 2024-08-13 22:40:47 +10:00
parent c2085781f4
commit 676f93ce3f

View file

@ -205,17 +205,18 @@ public class MeshImporter(IEnumerable<Node> nodes, IoNotifier notifier)
// Build a set of joints that are referenced by this mesh.
for (var i = 0; i < joints0Accessor.Count; i++)
{
var joints = joints0Accessor[i];
var weights = weights0Accessor[i];
var joints0 = joints0Accessor[i];
var weights0 = weights0Accessor[i];
var joints1 = joints1Accessor?[i];
var weights1 = weights1Accessor?[i];
for (var index = 0; index < 4; index++)
{
// If a joint has absolutely no weight, we omit the bone entirely.
if (weights[index] == 0)
continue;
if (weights0[index] != 0)
{
usedJoints.Add((ushort)joints0[index]);
}
usedJoints.Add((ushort)joints[index]);
if (joints1 != null && weights1 != null && weights1.Value[index] != 0)
{