Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check skin cluster weights #2971

Merged
merged 3 commits into from
Apr 18, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/mayaUsd/fileio/utils/jointWriteUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ int UsdMayaJointUtil::getCompressedSkinWeights(
unsigned int numInfluences;
skinCluster.getWeights(outputDagPath, components.object(), weights, numInfluences);

if (weights.length() < numVertices * numInfluences) {
MString msg("Number of weights (");
msg += weights.length();
msg += ") exceeds number of influences * number of vertices (";
msg += numInfluences * numVertices;
msg += ") - skin binding will not be written";
MGlobal::displayError(msg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add to this message a way to fix the problem or a workaround for problem?

throw std::runtime_error(msg.asChar());
}

// Determine how many influence/weight "slots" we actually need per point.
// For example, if there are the joints /a, /a/b, and /a/c, but each point
// only has non-zero weighting for a single joint, then we only need one
Expand Down