Scene Hierarchy ET switcher + Create Sublayer via Save dialog

- Add edit-target layer combo at top of Scene Hierarchy panel (always
  visible when stage loaded — session, root, sublayers); routes through
  LayerManager::SetEditTarget so StageEditor ET checkboxes stay in sync
- Replace custom Create Sublayer modal with native SaveFile dialog;
  LayerManager::CreateNewSublayer creates the file on disk, inserts it
  at the top of the sublayer stack, and activates it as edit target

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 03:49:35 +08:00
parent e5d7967455
commit a62764397c
7 changed files with 89 additions and 51 deletions
+18
View File
@@ -157,6 +157,24 @@ bool LayerManager::SetEditTarget(const std::string& identifier) {
return true;
}
bool LayerManager::CreateNewSublayer(const std::string& absolutePath) {
if (!m_stage) return false;
SdfLayerHandle rootLayer = m_stage->GetRootLayer();
if (!rootLayer) return false;
auto newLayer = SdfLayer::CreateNew(absolutePath);
if (!newLayer) {
LOG_ERROR("Failed to create layer file: " + absolutePath);
return false;
}
newLayer->Save();
rootLayer->InsertSubLayerPath(absolutePath, 0);
m_stage->SetEditTarget(newLayer);
Refresh();
return true;
}
bool LayerManager::IsLayerMuted(const std::string& layerIdentifier) const {
if (m_stage) {
return m_stage->IsLayerMuted(layerIdentifier);
+3
View File
@@ -44,6 +44,9 @@ public:
// Edit target
bool SetEditTarget(const std::string& identifier);
// Create a new USD file on disk, insert as sublayer, and activate as edit target.
bool CreateNewSublayer(const std::string& absolutePath);
// Muting
void MuteLayer(const std::string& layerIdentifier);
void UnmuteLayer(const std::string& layerIdentifier);