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

MAYA-113027 prevent crash when nonexistant instance is selected #1718

Merged
Changes from all 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
12 changes: 10 additions & 2 deletions lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,11 @@ void HdVP2Mesh::_UpdateDrawItem(
if (const auto state = drawScene.GetActiveSelectionState(id)) {
for (const auto& indexArray : state->instanceIndices) {
for (const auto index : indexArray) {
instanceInfo[index] = modeActive;
// This bounds check is necessary because of Pixar USD Issue 1516
// Logged as MAYA-113682
if (index >= 0 && index < (const int)instanceCount) {
instanceInfo[index] = modeActive;
}
}
}
}
Expand All @@ -2016,7 +2020,11 @@ void HdVP2Mesh::_UpdateDrawItem(
if (const auto state = drawScene.GetLeadSelectionState(id)) {
for (const auto& indexArray : state->instanceIndices) {
for (const auto index : indexArray) {
instanceInfo[index] = modeLead;
// This bounds check is necessary because of Pixar USD Issue 1516
// Logged as MAYA-113682
if (index >= 0 && index < (const int)instanceCount) {
instanceInfo[index] = modeLead;
}
}
}
}
Expand Down