Skip to content

Commit 98f9c7a

Browse files
Fixed accidental export size increase in Maya after changes made to support models with more than 256 bones (#1143)
1 parent ea9a3c5 commit 98f9c7a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Maya/Exporter/GlobalVertex.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public override bool Equals(object obj)
5959
return
6060
other.BaseIndex == BaseIndex &&
6161
other.Position.IsAlmostEqualTo(Position, Tools.Epsilon) &&
62-
other.Normal.IsAlmostEqualTo(Normal, Tools.Epsilon) &
62+
other.Normal.IsAlmostEqualTo(Normal, Tools.Epsilon) &&
6363
other.UV.IsAlmostEqualTo(UV, Tools.Epsilon) &&
6464
other.UV2.IsAlmostEqualTo(UV2, Tools.Epsilon) &&
6565
other.UV3.IsAlmostEqualTo(UV3, Tools.Epsilon) &&
@@ -71,7 +71,8 @@ public override bool Equals(object obj)
7171
other.Weights.IsAlmostEqualTo(Weights, Tools.Epsilon) &&
7272
other.WeightsExtra.IsAlmostEqualTo(WeightsExtra, Tools.Epsilon) &&
7373
other.Color.IsAlmostEqualTo(Color, Tools.Epsilon) &&
74-
other.BonesIndices == BonesIndices;
74+
Tools.IsArrayEqual(other.BonesIndices, BonesIndices) &&
75+
Tools.IsArrayEqual(other.BonesIndicesExtra, BonesIndicesExtra);
7576
}
7677
return false;
7778
}

Maya/Tools/Tools.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,21 @@ public static bool IsAlmostEqualTo(this float[] current, float[] other, float ep
120120
return true;
121121
}
122122

123+
public static bool IsArrayEqual<T>(IEnumerable<T> current, IEnumerable<T> other)
124+
{
125+
if (other == null)
126+
{
127+
return current == null;
128+
}
129+
130+
if (current == null)
131+
{
132+
return other == null;
133+
}
134+
135+
return current.SequenceEqual(other);
136+
}
137+
123138
public static string toString<T>(this T[] array, bool withBrackets = true)
124139
{
125140
if (array == null)

0 commit comments

Comments
 (0)