Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Improvements
- PlugPopup : Improved default popup title. Plugs and non-viewable nodes are no longer included in the title.
- Viewer : Added <kbd>D</kbd> hotkey for toggling between denoised and undenoised layers.

Fixes
-----

- PlugLayout :
- Fixed `Internal C++ object already deleted` errors when removing "layout:accessory" metadata from plugs currently visible in the Node Editor.
- Fixed layout issues when combining "layout:divider" and "layout:accessory" metadata.

API
---

Expand Down
20 changes: 16 additions & 4 deletions python/GafferUI/PlugLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,26 @@ def __updateLayout( self ) :
section = section.subsection( sectionName )

if len( section.widgets ) and self.__itemMetadataValue( item, "accessory" ) :
if isinstance( section.widgets[-1], _AccessoryRow ) :
section.widgets[-1].append( widget )
primaryIndex = -1
for i in range( len( section.widgets ) - 1, -1, -1 ) :
if not isinstance( section.widgets[i], GafferUI.Divider ) :
primaryIndex = i
break

if isinstance( section.widgets[primaryIndex], _AccessoryRow ) :
section.widgets[primaryIndex].append( widget )
else :
row = _AccessoryRow()
row.append( section.widgets[-1] )
row.append( section.widgets[primaryIndex] )
row.append( widget )
section.widgets[-1] = row
section.widgets[primaryIndex] = row
else :
parent = widget.parent()
if isinstance( parent, _AccessoryRow ) :
# Widget is no longer an accessory or no longer has an accessory, reparent to
# grandparent to prevent the widget from being deleted with the old _AccessoryRow.
parent.parent().addChild( widget )

section.widgets.append( widget )

if self.__itemMetadataValue( item, "divider" ) :
Expand Down