Add global Preferences dialog and per-viewport render delegate
Preferences (Edit > Preferences, tabbed General/Animation/Viewport): - Viewport tab: Default Render Delegate and Color Correction settings - Persisted to %APPDATA%\UsdLayerManager\preferences.ini - Render delegate: startup default only (not live-applied to running tiles) - Color correction: global, applied live to all viewports on change Render delegate per-viewport: - Each tile toolbar switches its own delegate independently - Saved per-tile in viewport_settings.ini; restored on next launch - Tiles with no saved delegate get the pref default on startup Color correction global: - Removed from gear popup; lives in Preferences > Viewport only - Applied to all tiles on init and on live change from Preferences Fix InitRenderer always applying m_currentRendererPlugin when set, rather than skipping when UsdImagingGLEngine auto-selects a default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+36
-10
@@ -18,15 +18,25 @@
|
||||
|
||||
namespace UsdLayerManager {
|
||||
|
||||
/// Global (non-per-viewport) rendering preferences persisted to preferences.ini.
|
||||
struct AppPreferences {
|
||||
std::string renderDelegate = "HdStormRendererPlugin";
|
||||
int colorCorrectionMode = 1; ///< ColorCorrectionMode cast to int (1 = sRGB)
|
||||
std::string ocioDisplay;
|
||||
std::string ocioView;
|
||||
std::string ocioColorSpace;
|
||||
std::string ocioLook;
|
||||
};
|
||||
|
||||
class Application {
|
||||
public:
|
||||
Application();
|
||||
~Application();
|
||||
|
||||
|
||||
bool Initialize(const std::string& windowTitle = "USD Layer Manager", int width = 1280, int height = 720);
|
||||
void Run();
|
||||
void Shutdown();
|
||||
|
||||
|
||||
private:
|
||||
void Update();
|
||||
void RenderUI();
|
||||
@@ -34,21 +44,27 @@ private:
|
||||
void RenderStatusBar();
|
||||
void RenderStageInfo();
|
||||
void RefreshManagers();
|
||||
|
||||
|
||||
// File operations
|
||||
void OpenUsdFile();
|
||||
void CreateNewUsdFile(); // creates fresh in-memory stage
|
||||
void CreateNewUsdFile();
|
||||
void SaveUsdFile();
|
||||
void SaveUsdFileAs();
|
||||
void CloseUsdFile(); // closes file-backed stage, falls back to default stage
|
||||
void CloseUsdFile();
|
||||
|
||||
// Stage editing operations (also exposed via Stage menu)
|
||||
// Stage editing operations
|
||||
void AddReferenceToStage();
|
||||
void CreatePrimOnStage(const std::string& typeName);
|
||||
|
||||
// Playblast — called each frame while a capture is in progress.
|
||||
// Playblast
|
||||
void CapturePlayblastFrame();
|
||||
|
||||
|
||||
// Preferences
|
||||
void LoadPreferences();
|
||||
void SavePreferences();
|
||||
void ApplyPrefsToAllViewports();
|
||||
void RenderPreferencesDialog();
|
||||
|
||||
std::unique_ptr<ImGuiContext> m_imguiContext;
|
||||
std::unique_ptr<IconManager> m_iconManager;
|
||||
std::unique_ptr<UsdStageManager> m_stageManager;
|
||||
@@ -71,8 +87,18 @@ private:
|
||||
bool m_showCurveEditor;
|
||||
bool m_running;
|
||||
|
||||
MovieEncoder m_movieEncoder;
|
||||
std::string m_viewportSettingsPath; ///< %APPDATA%\UsdLayerManager\viewport_settings.ini
|
||||
MovieEncoder m_movieEncoder;
|
||||
std::string m_viewportSettingsPath;
|
||||
std::string m_prefsPath;
|
||||
AppPreferences m_prefs;
|
||||
bool m_showPreferences = false;
|
||||
|
||||
// OCIO edit buffers for Preferences dialog
|
||||
char m_prefOcioDisplayBuf[128] = {};
|
||||
char m_prefOcioViewBuf[128] = {};
|
||||
char m_prefOcioColorSpaceBuf[128] = {};
|
||||
char m_prefOcioLookBuf[128] = {};
|
||||
bool m_prefOcioFieldsSynced = false;
|
||||
};
|
||||
|
||||
} // namespace UsdLayerManager
|
||||
|
||||
Reference in New Issue
Block a user