This should eliminate the case of FBX from Unreal with extraneous
FullWeights because those always seem to be negative for some reason.
An alternative check that could be made for these extraneous Unreal
FullWeights is that their absolute values seem to always be far smaller
than the smallest single precision non-zero float (vertex weights are
single-precision). The smallest subnormal single-precision float is
1e-45, but these extraneous FullWeights are usually around 1e-200.
Though if there are systems running Blender where single precision float
is 64 bits, this check wouldn't work.
Fixes a rare cause of #84111, but does not fix the main issue.
Aside from Shape Keys with Vertex Groups exported by Blender, rarely, a
BlendShapeChannel can have more FullWeights than Shapes assigned to it,
which would fail an assertion that the number of FullWeights equals the
number of vertices moved by the Shape with an allowed exception of when
there is only a single FullWeight.
This assertion was not correct because each FullWeight is the
deformation percentage of the BlendShapeChannel that fully activates
each Shape assigned to the BlendShapeChannel.
This patch keeps track of the Shapes assigned to each BlendShapeChannel
so that the number of FullWeights can be correctly compared against the
number of Shapes. FBX appears to ignore any excess FullWeights, so the
updated assertion allows this too.
Blender exported Shape Keys with Vertex Groups are then handled
separately by initially checking if the number of FullWeights equals the
number of vertices moved by the imported Shape.
The main cause of #84111 is when there is more than one Shape assigned
to a BlendShapeChannel. This is still not supported because it requires
larger changes and allowing it now would cause more issues. Because the
assertion is no longer sufficient to cause an error when there is more
than one Shape, an explicitly thrown RuntimeException has been added to
fulfil the same role.