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

Selection highlight disappears when switching variant #524

Merged
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions lib/mayaUsd/render/vp2RenderDelegate/basisCurves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,10 +1438,9 @@ void HdVP2BasisCurves::_InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBit
if (ARCH_UNLIKELY(!subSceneContainer))
return;

// We don't create a repr for the selection token because it serves for
// selection state update only. Mark DirtySelection bit that will be
// automatically propagated to all draw items of the rprim.
if (reprToken == HdVP2ReprTokens->selection) {
// Update selection state on demand or when it is a new Rprim. DirtySelection
// will be propagated to all draw items, to trigger sync for each repr.
if (reprToken == HdVP2ReprTokens->selection || _reprs.empty()) {
const HdVP2SelectionStatus selectionState =
param->GetDrawScene().GetPrimSelectionStatus(GetId());
if (_selectionState != selectionState) {
Expand All @@ -1451,7 +1450,11 @@ void HdVP2BasisCurves::_InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBit
else if (_selectionState == kPartiallySelected) {
*dirtyBits |= DirtySelection;
}
return;

// We don't create a repr for the selection token because it serves for
// selection state update only. Return from here.
if (reprToken == HdVP2ReprTokens->selection)
return;
}

// If the repr has any draw item with the DirtySelection bit, mark the
Expand Down
13 changes: 8 additions & 5 deletions lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,9 @@ void HdVP2Mesh::_InitRepr(const TfToken& reprToken, HdDirtyBits* dirtyBits) {
if (ARCH_UNLIKELY(!subSceneContainer))
return;

// We don't create a repr for the selection token because it serves for
// selection state update only. Mark DirtySelection bit that will be
// automatically propagated to all draw items of the rprim.
if (reprToken == HdVP2ReprTokens->selection) {
// Update selection state on demand or when it is a new Rprim. DirtySelection
// will be propagated to all draw items, to trigger sync for each repr.
if (reprToken == HdVP2ReprTokens->selection || _reprs.empty()) {
const HdVP2SelectionStatus selectionState =
param->GetDrawScene().GetPrimSelectionStatus(GetId());
if (_selectionState != selectionState) {
Expand All @@ -620,7 +619,11 @@ void HdVP2Mesh::_InitRepr(const TfToken& reprToken, HdDirtyBits* dirtyBits) {
else if (_selectionState == kPartiallySelected) {
*dirtyBits |= DirtySelection;
}
return;

// We don't create a repr for the selection token because it serves for
// selection state update only. Return from here.
if (reprToken == HdVP2ReprTokens->selection)
return;
}

// If the repr has any draw item with the DirtySelection bit, mark the
Expand Down