Skip to content

Commit

Permalink
fixup! DisplayTransformPlugValueWidget : Add label and menu items for…
Browse files Browse the repository at this point in the history
… "Default"
  • Loading branch information
johnhaddon committed Oct 16, 2024
1 parent d39ba33 commit 99cc64d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/GafferImageUI/OpenColorIOConfigPlugUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ def _updateFromValues( self, values, exception ) :
# a "set once and forget" affair. The menu shows both for when
# you need to check.
self.__menuButton.setText(
self.__currentView if value else f"Default ({self.__currentView})"
f"Default ({self.__currentView})"
if self.__currentValue == "__default__"
else self.__currentView
)
self.__menuButton.setErrored( not valid )

Expand Down Expand Up @@ -265,7 +267,7 @@ def __menuDefinition( self ) :
result.append(
f"/Default", {
"command" : functools.partial( Gaffer.WeakMethod( self.__setToDefault ) ),
"checkBox" : self.getPlug().isSetToDefault(),
"checkBox" : self.__currentValue == "__default__",
}
)

Expand All @@ -286,7 +288,7 @@ def __setToDefault( self, *unused ) :

with Gaffer.UndoScope( self.scriptNode() ) :
for plug in self.getPlugs() :
self.getPlug().setToDefault()
self.getPlug().setValue( "__default__" )

# Connection between default script config and Widget and View display transforms.
# Calling `connect()` from an application startup file is what makes the UI OpenColorIO-aware.
Expand Down

0 comments on commit 99cc64d

Please sign in to comment.