Skip to content

Commit

Permalink
UfbxImporter: Add comment about weight sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
bqqbarbhg committed Feb 7, 2023
1 parent b549031 commit f2fae90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MagnumPlugins/UfbxImporter/UfbxImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,8 @@ Containers::Optional<MeshData> UfbxImporter::doMesh(UnsignedInt id, UnsignedInt
UnsignedInt weightCount = Utility::min(vertex.num_weights, jointWeightCount);
Float totalWeight = 0.0f;

/* We can simply take the first N weights from the skin as they
are sorted in descending order by ufbx. */
for(UnsignedInt j = 0; j < weightCount; ++j) {
ufbx_skin_weight weight = skin->weights[vertex.weight_begin + j];
jointIds[dstIx][j] = weight.cluster_index;
Expand Down

0 comments on commit f2fae90

Please sign in to comment.