Skip to content

Commit

Permalink
Selection hi-lite items respect purpose.
Browse files Browse the repository at this point in the history
  • Loading branch information
krickw committed Jun 3, 2020
1 parent 4346939 commit 0a07070
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,16 +1332,19 @@ void HdVP2Mesh::_UpdateDrawItem(
}
}

auto drawItemVisible = [&]() {
return drawItem->GetVisible() && drawScene.DrawRenderTag(renderIndex.GetRenderTag(GetId()));
};

if (itemDirtyBits & (HdChangeTracker::DirtyVisibility | HdChangeTracker::DirtyRenderTag)) {
drawItemData._enabled
= drawItem->GetVisible() && drawScene.DrawRenderTag(renderIndex.GetRenderTag(GetId()));
drawItemData._enabled = drawItemVisible();
stateToCommit._enabled = &drawItemData._enabled;
}

if (isDedicatedSelectionHighlightItem) {
if (itemDirtyBits & DirtySelectionHighlight) {
const bool enable =
(_selectionState != kUnselected) && drawItem->GetVisible();
(_selectionState != kUnselected) && drawItemVisible();
if (drawItemData._enabled != enable) {
drawItemData._enabled = enable;
stateToCommit._enabled = &drawItemData._enabled;
Expand All @@ -1350,7 +1353,7 @@ void HdVP2Mesh::_UpdateDrawItem(
}
else if (isBBoxItem) {
if (itemDirtyBits & HdChangeTracker::DirtyExtent) {
const bool enable = !range.IsEmpty() && drawItem->GetVisible();
const bool enable = !range.IsEmpty() && drawItemVisible();
if (drawItemData._enabled != enable) {
drawItemData._enabled = enable;
stateToCommit._enabled = &drawItemData._enabled;
Expand Down

0 comments on commit 0a07070

Please sign in to comment.