Skip to content

Commit

Permalink
RenderPassEditor : Allow active render pass to be toggled
Browse files Browse the repository at this point in the history
  • Loading branch information
murraystevenson authored and johnhaddon committed Jul 9, 2024
1 parent bd88e03 commit 5c5b27b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Improvements
- The `data_seed`, `proc_seed`, `obj_seed`, and `face_seed` parameters of the `color_jitter` shader.
- EditScope : Added summaries of set membership edits in the NodeEditor.
- LightEditor : Mute and solo columns now accurately reflect the presence of the `light:mute` attribute (for the Mute column) and membership in the `soloLights` set (for the Solo column) for all scene locations, not just for lights.
- RenderPassEditor : The currently active render pass can now be unset by double clicking on its green dot in the "Active" column.

Fixes
-----
Expand Down
2 changes: 1 addition & 1 deletion doc/source/Interface/ControlsAndShortcuts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ Extend cell selection | {kbd}`Shift` + {{leftClic
Toggle cell selection | {kbd}`Ctrl` + {{leftClick}}<br>or<br>{kbd}`Ctrl` + {kbd}``, {kbd}``, {kbd}``, {kbd}``
Edit selected cells | {kbd}`Return`<br>or<br>{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
5 changes: 4 additions & 1 deletion python/GafferSceneUI/RenderPassEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/GafferSceneUIModule/RenderPassEditorBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5c5b27b

Please sign in to comment.