Commit Graph

9 Commits

Author SHA1 Message Date
indigo fac4ca0c74 Auto-save the active render layer's sublayer file
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>
2026-08-05 09:47:58 +08:00
indigo b5c1e50438 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>
2026-08-03 10:02:33 +08:00
indigo 27c619c518 Add screenshots verifying Arnold node thumbnail convergence fix
Material Editor with Arnold-shaded RustMetalMat: node thumbnails
(texture and standard_surface shader ball) now render converged
under the Arnold delegate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 17:39:56 +08:00
indigo a59b3a5405 Replace custom ViewportColorCorrector with stageView.py color correction
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>
2026-06-30 01:35:06 +08:00
indigo 45d1cc4391 Add screen shot for MaterialX display 2026-06-29 08:25:19 +08:00
indigo 46d83d300d Add ADR for custom viewport color correction
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>
2026-06-27 17:13:46 +08:00
indigo 08f4bd351b Add Screen Shot for Render Delegate 2026-06-24 09:34:20 +08:00
indigo e0597ae31d Add screen shot for curve editor 2026-06-24 08:26:13 +08:00
indigo 9be48d8b9e Init Repo 2026-06-03 09:00:11 +08:00