From c7d1fbaf1daeb164d068f542ec32d0f7f4e1dae8 Mon Sep 17 00:00:00 2001 From: Roman Zulak Date: Tue, 18 Jan 2022 12:10:58 -0500 Subject: [PATCH] [hdx] Expose secondary selection hilight color as a settable value. --- pxr/imaging/hdx/taskController.cpp | 32 ++++++++++++++++++++++++++++++ pxr/imaging/hdx/taskController.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/pxr/imaging/hdx/taskController.cpp b/pxr/imaging/hdx/taskController.cpp index 5e55ff238d..d5c022d76f 100644 --- a/pxr/imaging/hdx/taskController.cpp +++ b/pxr/imaging/hdx/taskController.cpp @@ -1556,6 +1556,38 @@ HdxTaskController::SetSelectionColor(GfVec4f const& color) } } +void +HdxTaskController::SetSelectionLocateColor(GfVec4f const& color) +{ + if (!_selectionTaskId.IsEmpty()) { + HdxSelectionTaskParams params = + _delegate.GetParameter( + _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( + _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) { diff --git a/pxr/imaging/hdx/taskController.h b/pxr/imaging/hdx/taskController.h index 506713ae50..2c24a53528 100644 --- a/pxr/imaging/hdx/taskController.h +++ b/pxr/imaging/hdx/taskController.h @@ -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