Scene hierarchy: add Inherit, Specialize, and VariantSet composition arc menus
Prim right-click context menu now exposes all five USD composition arc types: - Inherit▶ Add... (modal for SdfPath input) | Remove▶ (lists via GetAllDirectInherits()) | Clear All - Specialize▶ Add... | Remove▶ (lists via UsdPrimCompositionQuery + ArcTypeFilter::Specialize) | Clear All - VariantSet▶ Add... | per-set sub-menu: Add Variant... + selectable variant list (SetVariantSelection) All text-input operations share a single RenderArcModal() driven by ArcModalMode enum. VariantSet/Variant names go through SanitizeUsdName(); Inherit/Specialize paths are passed as-is to SdfPath. OK button is disabled until input is non-empty; Enter key also confirms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,12 +66,15 @@ public:
|
||||
using StageMetadataChangedCallback = std::function<void()>;
|
||||
void SetOnStageMetadataChanged(StageMetadataChangedCallback callback) { m_onStageMetadataChanged = callback; }
|
||||
|
||||
enum class ArcModalMode { None, Inherit, Specialize, VariantSet, Variant };
|
||||
|
||||
private:
|
||||
void RenderPrimNode(const UsdPrim& prim);
|
||||
const char* GetPrimTypeIcon(const UsdPrim& prim) const;
|
||||
Icon GetPrimTypeIconEnum(const UsdPrim& prim) const;
|
||||
void RenderContextMenu(const UsdPrim& prim);
|
||||
void RenderRemovePrimModal();
|
||||
void RenderArcModal();
|
||||
void ProcessPendingReplaceRef();
|
||||
|
||||
PropertyManager* m_propertyManager;
|
||||
@@ -104,6 +107,13 @@ private:
|
||||
bool m_doReplaceRefPick = false;
|
||||
SdfPath m_pendingReplaceRefPrim;
|
||||
pxr::SdfReference m_pendingReplaceRef;
|
||||
|
||||
/// Arc modal state (Inherit / Specialize / VariantSet / Variant).
|
||||
ArcModalMode m_arcModalMode = ArcModalMode::None;
|
||||
SdfPath m_arcModalTargetPrim;
|
||||
std::string m_arcModalVarSetName;
|
||||
char m_arcModalBuf[512] = {};
|
||||
bool m_openArcModal = false;
|
||||
};
|
||||
|
||||
} // namespace UsdLayerManager
|
||||
|
||||
Reference in New Issue
Block a user