Add multi-select, specifier column, and visibility shortcuts to hierarchy panel
Ctrl+click toggles prim selection; Shift+click range-selects using a per-frame visible-order list. Multi-selection is broadcast to the viewport via a new SetOnPrimsSelected callback so Hydra highlights all selected prims. Adds a 5th table column showing each prim's SdfSpecifier (def/over/class) with colour coding. 'over' prims are shown in orange to make overrides immediately visible. Visibility icon updated: invisible prims show EyeSlash in orange instead of grey. Ctrl+H / Shift+H keyboard shortcuts hide / show all selected prims. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "../core/PropertyManager.h"
|
||||
#include "../core/CommandHistory.h"
|
||||
@@ -62,6 +62,9 @@ public:
|
||||
using PrimSelectCallback = std::function<void(const std::string& path)>;
|
||||
void SetOnPrimSelected(PrimSelectCallback callback) { m_onPrimSelected = callback; }
|
||||
|
||||
using MultiPrimSelectCallback = std::function<void(const std::vector<std::string>&)>;
|
||||
void SetOnPrimsSelected(MultiPrimSelectCallback cb) { m_onPrimsSelected = cb; }
|
||||
|
||||
/// Called when stage-level metadata (e.g. up axis) is changed via the hierarchy panel.
|
||||
using StageMetadataChangedCallback = std::function<void()>;
|
||||
void SetOnStageMetadataChanged(StageMetadataChangedCallback callback) { m_onStageMetadataChanged = callback; }
|
||||
@@ -96,7 +99,12 @@ private:
|
||||
/// NOT layers that came in through references or payloads.
|
||||
std::unordered_set<std::string> m_localLayers;
|
||||
|
||||
/// Visible prim order rebuilt each frame — used for Shift+RMB range select.
|
||||
std::vector<pxr::SdfPath> m_visiblePrimOrder;
|
||||
pxr::SdfPath m_rangeAnchorPath;
|
||||
|
||||
PrimSelectCallback m_onPrimSelected;
|
||||
MultiPrimSelectCallback m_onPrimsSelected;
|
||||
StageMetadataChangedCallback m_onStageMetadataChanged;
|
||||
|
||||
/// Remove-prim confirmation state.
|
||||
@@ -121,6 +129,8 @@ private:
|
||||
bool m_renameJustStarted = false;
|
||||
|
||||
void HandleKeyboardShortcuts();
|
||||
void ToggleSelectionFromClick(const std::string& path);
|
||||
void RangeSelectToPath(const pxr::SdfPath& path);
|
||||
SdfPath FindUniqueChildPath(const SdfPath& parent, const std::string& baseName);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user