From 0cd665a77248e37365e998d3165731488da747e2 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:14:23 -0700 Subject: [PATCH] RenderPassEditor : Allow active render pass to be toggled --- Changes.md | 1 + doc/source/Interface/ControlsAndShortcuts/index.md | 2 +- python/GafferSceneUI/RenderPassEditor.py | 5 ++++- src/GafferSceneUIModule/RenderPassEditorBinding.cpp | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Changes.md b/Changes.md index ba339dcbf71..91265627848 100644 --- a/Changes.md +++ b/Changes.md @@ -6,6 +6,7 @@ Improvements - Cryptomatte : Renamed `__manifestScene` plug to `manifestScene` so it is no longer considered to be private. - EditScopePlugValueWidget : Width can now be configured via `:width` metadata. This enables customisation of the Edit Scope menu width by registering metadata in a startup file, such as `Gaffer.Metadata.registerValue( GafferSceneUI.RenderPassEditor.Settings, "editScope", "layout:width", 450 )` to double the standard width of the Edit Scope menu in the Render Pass Editor. +- RenderPassEditor : The currently active render pass can now be unset by double clicking on its green dot in the "Active" column. Fixes ----- diff --git a/doc/source/Interface/ControlsAndShortcuts/index.md b/doc/source/Interface/ControlsAndShortcuts/index.md index 7e50fe9a1be..d758a346a8a 100644 --- a/doc/source/Interface/ControlsAndShortcuts/index.md +++ b/doc/source/Interface/ControlsAndShortcuts/index.md @@ -437,4 +437,4 @@ Extend cell selection | {kbd}`Shift` + {{leftClic Toggle cell selection | {kbd}`Ctrl` + {{leftClick}}
or
{kbd}`Ctrl` + {kbd}`↑`, {kbd}`↓`, {kbd}`←`, {kbd}`→` Edit selected cells | {kbd}`Return`
or
{kbd}`Enter` Disable edit | {kbd}`D` -Set a render pass as active | {kbd}`Return` or {{leftClick}} {{leftClick}} a cell within the {{activeRenderPass}} column +Toggle a render pass as active | {kbd}`Return` or {{leftClick}} {{leftClick}} a cell within the {{activeRenderPass}} column diff --git a/python/GafferSceneUI/RenderPassEditor.py b/python/GafferSceneUI/RenderPassEditor.py index 010fd66c5df..a1ce4002ff0 100644 --- a/python/GafferSceneUI/RenderPassEditor.py +++ b/python/GafferSceneUI/RenderPassEditor.py @@ -452,7 +452,10 @@ def __setActiveRenderPass( self, pathListing ) : else : renderPassPlug = script["variables"]["renderPass"] - renderPassPlug["value"].setValue( selectedPassNames[0] ) + with Gaffer.Context( self.getContext() ) : + currentRenderPass = renderPassPlug["value"].getValue() + + renderPassPlug["value"].setValue( selectedPassNames[0] if selectedPassNames[0] != currentRenderPass else "" ) ## \todo Consider consolidating this with `LightEditor.__editSelectedCells()`. # The main difference being the name of the context variable that is set before inspection, diff --git a/src/GafferSceneUIModule/RenderPassEditorBinding.cpp b/src/GafferSceneUIModule/RenderPassEditorBinding.cpp index e356f752348..4f4c1333ec0 100644 --- a/src/GafferSceneUIModule/RenderPassEditorBinding.cpp +++ b/src/GafferSceneUIModule/RenderPassEditorBinding.cpp @@ -527,7 +527,7 @@ class RenderPassActiveColumn : public PathColumn iconData->writable()["state:normal"] = g_activeRenderPassIcon; /// \todo This is only to allow sorting, replace with `CellData::sortValue` in Gaffer 1.4 result.value = new StringData( " " ); - result.toolTip = new StringData( fmt::format( "{} is the currently active render pass.", renderPassName->readable() ) ); + result.toolTip = new StringData( fmt::format( "{} is the currently active render pass.\n\nDouble-click to unset.", renderPassName->readable() ) ); return result; }