Add per-viewport cull style option

Exposes UsdImagingGLCullStyle as a Cull Style sub-menu in the gear popup
(Back Unless Double-Sided / Back / Front / Nothing / No Opinion). Defaults
to BackUnlessDoubleSided, matching usdview. Setting persists per-viewport
to viewport_settings.ini.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 08:15:20 +08:00
parent 7586d380e9
commit 781d464f47
5 changed files with 35 additions and 1 deletions
+13
View File
@@ -43,6 +43,15 @@ enum class ShadingMode {
Unlit, ///< Smooth geometry, lighting disabled
};
/// Back-face culling style — maps directly to UsdImagingGLCullStyle.
enum class CullStyle {
NoOpinion = 0,
Nothing = 1,
Back = 2,
Front = 3,
BackUnlessDoubleSided = 4,
};
/// Viewport color correction mode — maps to UsdImagingGLRenderParams::colorCorrectionMode.
enum class ColorCorrectionMode {
Disabled, ///< No correction (raw linear output)
@@ -240,6 +249,9 @@ public:
ShadingMode GetShadingMode() const { return m_shadingMode; }
void SetShadingMode(ShadingMode m) { m_shadingMode = m; m_forceRefresh = true; }
CullStyle GetCullStyle() const { return m_cullStyle; }
void SetCullStyle(CullStyle c) { m_cullStyle = c; m_forceRefresh = true; }
ColorCorrectionMode GetColorCorrectionMode() const { return m_colorCorrectionMode; }
void SetColorCorrectionMode(ColorCorrectionMode m) { m_colorCorrectionMode = m; m_forceRefresh = true; }
@@ -358,6 +370,7 @@ private:
// Lighting settings (mirrors stageView.py viewSettings)
ShadingMode m_shadingMode; // draw mode + lighting flags
CullStyle m_cullStyle; // back/front/none face culling
ColorCorrectionMode m_colorCorrectionMode; // viewport color correction
std::string m_ocioDisplay;
std::string m_ocioView;