Render layer overrides only reached disk on an explicit File > Save --
SaveDirtyRenderLayers() was called from SaveUsdFile/SaveUsdFileAs and nowhere
else. Everything a user authored after switching to a render layer (property
values, shader parameters, material assignments) sat in a dirty in-memory
SdfLayer marked with an orange asterisk, and a crash took the whole layer's
overrides with it.
Application::Update() now polls the active render layer's IsDirty() and saves
it 0.5s after the user goes idle, gated on IsAnyItemActive() and the left mouse
button so a slider or gizmo drag produces one write on release rather than one
per frame.
Polling rather than hooking CommandHistory::Push/Undo/Redo is deliberate: many
of the writes this is meant to catch never build a command and author straight
to the ambient edit target -- PropertyPanel's live WriteTranslate/Rotate/Scale
and its generic attribute widgets, TransformManipulator's gizmo drags, and
MaterialEditorPanel::RenderInputWidget's shader input writes. A command hook
would have silently missed exactly the property and shader-parameter edits at
issue. IsDirty() catches every path, commanded or not.
Scope is the active layer only. Muted render layers still rely on
SaveDirtyRenderLayers() at save time, and the root layer is never auto-written
-- so the persisted active-layer choice (custom layer data on the root layer)
still only survives a reopen once the stage itself is saved. Auto-writing the
user's main scene file was ruled out.
- SaveRenderLayerIfDirty() refreshes LayerManager after a successful save, or
the cached isDirty snapshot leaves a stale asterisk in StageEditorPanel and
the Scene Hierarchy sublayer list. A failed save latches the layer id so a
read-only file can't spam the log twice a second.
- Switching layers flushes the outgoing one, and Shutdown() flushes before the
panels are destroyed, so edits inside the debounce window aren't stranded.
- RefreshManagers() clears the auto-save state, whose layer ids belong to the
outgoing stage.
- New "Auto-save active layer" checkbox in the Render Layer panel, on by
default, persisted as AutoSaveRenderLayer in preferences.ini.
See docs/adr/0002-render-layer.md D9-D11 for the rationale.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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>
Remove the custom GL post-process (ViewportColorCorrector) that bypassed
HdxColorCorrectionTask. Instead pass colorCorrectionMode, ocioDisplay,
ocioView, ocioColorSpace, and ocioLook directly to UsdImagingGLRenderParams
and SetColorCorrectionSettings(), delegating correction to Hydra —
the same approach used in usdview's stageView.renderSinglePass().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document the decision to replace HdxColorCorrectionTask with a custom GL
post-process (linear render + sRGB/OCIO correction via the OCIO GPU API),
including rationale, pipeline, consequences, and alternatives considered.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>