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

[hdx] Expose secondary selection hilight color as a settable value. #1771

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
32 changes: 32 additions & 0 deletions pxr/imaging/hdx/taskController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,38 @@ HdxTaskController::SetSelectionColor(GfVec4f const& color)
}
}

void
HdxTaskController::SetSelectionLocateColor(GfVec4f const& color)
{
if (!_selectionTaskId.IsEmpty()) {
HdxSelectionTaskParams params =
_delegate.GetParameter<HdxSelectionTaskParams>(
_selectionTaskId, HdTokens->params);

if (params.locateColor != color) {
params.locateColor = color;
_delegate.SetParameter(_selectionTaskId,
HdTokens->params, params);
GetRenderIndex()->GetChangeTracker().MarkTaskDirty(
_selectionTaskId, HdChangeTracker::DirtyParams);
}
}

if (!_colorizeSelectionTaskId.IsEmpty()) {
HdxColorizeSelectionTaskParams params =
_delegate.GetParameter<HdxColorizeSelectionTaskParams>(
_colorizeSelectionTaskId, HdTokens->params);

if (params.locateColor != color) {
params.locateColor = color;
_delegate.SetParameter(_colorizeSelectionTaskId,
HdTokens->params, params);
GetRenderIndex()->GetChangeTracker().MarkTaskDirty(
_colorizeSelectionTaskId, HdChangeTracker::DirtyParams);
}
}
}

void
HdxTaskController::SetSelectionEnableOutline(bool enableOutline)
{
Expand Down
4 changes: 4 additions & 0 deletions pxr/imaging/hdx/taskController.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ class HdxTaskController final
HDX_API
void SetSelectionColor(GfVec4f const& color);

/// Set the selection locate (over) color.
HDX_API
void SetSelectionLocateColor(GfVec4f const& color);

/// Set if the selection highlight should be rendered as an outline around
/// the selected objects or as a solid color overlaid on top of them.
HDX_API
Expand Down