Skip to content

Commit

Permalink
Merge branch '1.4_maintenance'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Oct 1, 2024
2 parents 53315d0 + dfde607 commit 82a71d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Improvements
- Reduced scene generation time for encapsulated instancers by around 20%.
- NodeEditor : Added <kbd>Alt</kbd> + middle-click action for showing context variable substitutions in strings.
- LightEditor, RenderPassEditor : History windows now use a context determined relative to the current focus node.
- NumericWidget : Added the ability to use <kbd>Ctrl</kbd> + scroll wheel to adjust values in the same manner as <kbd>Up</kbd> and <kbd>Down</kbd> (#6009). [^1]
- NodeEditor : Improved performance when showing a node with many colour plugs. Showing the Arnold `standard_surface` shader is now almost 2x faster. [^1]

Fixes
-----
Expand Down Expand Up @@ -187,6 +189,7 @@ Improvements
------------

- NumericWidget : Added the ability to use <kbd>Ctrl</kbd> + scroll wheel to adjust values in the same manner as <kbd>Up</kbd> and <kbd>Down</kbd> (#6009).
- NodeEditor : Improved performance when showing a node with many colour plugs. Showing the Arnold `standard_surface` shader is now almost 2x faster.

Fixes
-----
Expand Down
20 changes: 13 additions & 7 deletions python/GafferUI/ColorPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__( self, plugs, **kw ) :
self.__chooserButton = GafferUI.Button( image = "colorPlugValueWidgetSlidersOff.png", hasFrame = False )
self.__chooserButton.clickedSignal().connect( Gaffer.WeakMethod( self.__chooserButtonClicked ) )

self.__colorChooser = GafferUI.ColorChooserPlugValueWidget( plugs )
self.__colorChooser = None

self.setColorChooserVisible(
sole( Gaffer.Metadata.value( plug, "colorPlugValueWidget:colorChooserVisible" ) for plug in self.getPlugs() )
Expand All @@ -78,25 +78,31 @@ def setColorChooserVisible( self, visible ) :

self.__colorChooserVisible = visible

self.__colorChooser.setVisible(
self.__colorChooserVisible and
not any( p.direction() == Gaffer.Plug.Direction.Out for p in self.getPlugs() )
)
if visible and self.__colorChooser is None :
self.__colorChooser = GafferUI.ColorChooserPlugValueWidget( self.getPlugs() )
self.__column.append( self.__colorChooser )

if self.__colorChooser is not None :
self.__colorChooser.setVisible(
self.__colorChooserVisible and
not any( p.direction() == Gaffer.Plug.Direction.Out for p in self.getPlugs() )
)

self.__chooserButton.setImage(
"colorPlugValueWidgetSliders{}.png".format( "On" if visible else "Off" )
)

def getColorChooserVisible( self ) :

return self.__colorChooser.getVisible()
return self.__colorChooser.getVisible() if self.__colorChooser is not None else False

def setPlugs( self, plugs ) :

GafferUI.PlugValueWidget.setPlugs( self, plugs )

self.__compoundNumericWidget.setPlugs( plugs )
self.__colorChooser.setPlugs( plugs )
if self.__colorChooser is not None :
self.__colorChooser.setPlugs( plugs )
self.__swatch.setPlugs( plugs )

# Update widget visibility if the plug directions changed
Expand Down

0 comments on commit 82a71d5

Please sign in to comment.