Add Maya-style Render Layer panel
Render layers built on the existing USD sublayer architecture: each layer is a file-backed SdfLayer mounted as a sublayer and tagged via custom layer data, with membership stored in a UsdCollectionAPI on a hidden /RenderLayerData prim. Activating a layer applies its overrides and isolates it to its members. "Default" is virtual -- it means all render-layer sublayers muted. See docs/adr/0002-render-layer.md for the design and rationale. - RenderLayerManager: create/delete/rename/activate, membership, mute-based isolation. Sdf-level APIs are used while a layer is muted (Usd-level APIs can't see muted layers) and Usd-level APIs when active. - Commands: create/delete/rename/activate and add/remove members, all undoable. - RenderLayerPanel: layer list with one-click activation and a membership editor for the selected prims. - StageEditorPanel / SceneHierarchyPanel: badge render-layer-owned sublayers, disable their mute/remove controls (they're managed from the Render Layer panel so the two can't desync), and lock the edit target while a non-Default layer is active. - ConnectShaderAttrs/DisconnectShaderAttr: take an explicit editLayer captured at construction, so undo targets the same layer as execute even if the ambient edit target changed in between (e.g. a render-layer switch). Note: SceneHierarchyPanel.h also carries declarations for the sublayers section added in the following commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <pxr/usd/usd/stage.h>
|
||||
#include <pxr/usd/sdf/path.h>
|
||||
#include <pxr/usd/sdf/valueTypeName.h>
|
||||
#include <pxr/usd/sdf/layer.h>
|
||||
#include <string>
|
||||
|
||||
namespace UsdLayerManager {
|
||||
@@ -14,13 +15,19 @@ namespace UsdLayerManager {
|
||||
/// Undo can restore it exactly rather than merely disconnecting.
|
||||
class ConnectShaderAttrsCommand : public ICommand {
|
||||
public:
|
||||
/// editLayer: layer to author into (mirrors TransformCommand's pattern).
|
||||
/// Captured at construction time so Undo() targets the same layer as
|
||||
/// Execute() even if the stage's ambient edit target changes in between
|
||||
/// (e.g. a render-layer switch) — pass null/empty to fall back to
|
||||
/// whatever the ambient edit target is at call time (today's behavior).
|
||||
ConnectShaderAttrsCommand(pxr::UsdStageRefPtr stage,
|
||||
const pxr::SdfPath& destNode,
|
||||
const std::string& destInput,
|
||||
const pxr::SdfValueTypeName& destType,
|
||||
const pxr::SdfPath& sourceNode,
|
||||
const std::string& sourceOutput,
|
||||
const pxr::SdfValueTypeName& sourceType);
|
||||
const pxr::SdfValueTypeName& sourceType,
|
||||
pxr::SdfLayerHandle editLayer = pxr::SdfLayerHandle());
|
||||
|
||||
void Execute() override;
|
||||
void Undo() override;
|
||||
@@ -34,6 +41,7 @@ private:
|
||||
pxr::SdfPath m_sourceNode;
|
||||
std::string m_sourceOutput;
|
||||
pxr::SdfValueTypeName m_sourceType;
|
||||
pxr::SdfLayerHandle m_editLayer;
|
||||
std::string m_description;
|
||||
|
||||
bool m_hadPriorConnection = false;
|
||||
|
||||
Reference in New Issue
Block a user