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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user