Skip to content

Commit

Permalink
CatalogueUI : Fix update when first image added and last image removed
Browse files Browse the repository at this point in the history
In this case, the `index` plug doesn't change value, but whether or not it maps to an actual image does change. And we use that mapping in `_updateFromValues()`, so the first image added wasn't connected to the `__descriptionWidget` and `__nameWidget`, and the last image removed wasn't disconnected.
  • Loading branch information
johnhaddon committed Aug 5, 2024
1 parent 19e57cb commit 88eea08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ Fixes
- Arnold : Fixed bug preventing UI metadata for Imagers from being loaded for Arnold 7.3.
- WidgetAlgo : Fixed issue preventing `grab()` from capturing popup menus on Windows.
- ShowURL : Fixed opening of "file://" URLs on Windows (#5861).
- Catalogue : Fixed bug which allowed locked Catalogues to be edited.
- Catalogue :
- Fixed bug which allowed locked Catalogues to be edited.
- Fixed NodeEditor update when the first image is added or the last image is removed.
- NameWidget : Fixed bug which allowed plugs on locked nodes to be renamed.

API
Expand Down
9 changes: 9 additions & 0 deletions python/GafferImageUI/CatalogueUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ def __init__( self, plug, **kw ) :
self.__pathListing.dropSignal().connect(
Gaffer.WeakMethod( self.__pathListingDrop ), scoped = False
)
self.__pathListing.getPath().pathChangedSignal().connect(
Gaffer.WeakMethod( self.__pathChanged ), scoped = False
)
self.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False )

with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) as self.__buttonRow :
Expand Down Expand Up @@ -838,6 +841,12 @@ def _updateFromEditable( self ) :
# `self.__descriptionWidget` because they deal with that
# internally.

def __pathChanged( self, path ) :

# `_updateFromValues()` is sensitive to the contents of the image path so
# we need to do an update when it changes.
self._requestUpdateFromValues()

def __plugMetadataValueChanged( self, plug, key, reason ) :

if key == _columnsMetadataKey and plug == self.getPlug() :
Expand Down

0 comments on commit 88eea08

Please sign in to comment.