Skip to content

Commit

Permalink
Tweaks UIs : Fix editability bug
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Feb 24, 2023
1 parent 121b3cc commit 7f7e265
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.1.9.x (relative to 1.1.9.1)
=======

Fixes
-----

- Tweak nodes : Fixed bugs which prevented the creation of new tweaks when an existing tweak had an input connection.

1.1.9.1 (relative to 1.1.9.0)
=======

Expand Down
5 changes: 4 additions & 1 deletion python/GafferSceneUI/AttributeTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def __init__( self, plug ) :

def _updateFromPlug( self ) :

self.__button.setEnabled( self._editable() )
# Not using `_editable()` as it considers the whole plug to be non-editable if
# any child has an input connection, but that shouldn't prevent us adding a new
# tweak.
self.__button.setEnabled( self.getPlug().getInput() is None and not Gaffer.MetadataAlgo.readOnly( self.getPlug() ) )

def __menuDefinition( self ) :

Expand Down
5 changes: 4 additions & 1 deletion python/GafferSceneUI/CameraTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def __init__( self, plug ) :

def _updateFromPlug( self ) :

self.__button.setEnabled( self._editable() )
# Not using `_editable()` as it considers the whole plug to be non-editable if
# any child has an input connection, but that shouldn't prevent us adding a new
# tweak.
self.__button.setEnabled( self.getPlug().getInput() is None and not Gaffer.MetadataAlgo.readOnly( self.getPlug() ) )

def __menuDefinition( self ) :

Expand Down
5 changes: 4 additions & 1 deletion python/GafferSceneUI/OptionTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ def __init__( self, plug ) :

def _updateFromPlug( self ) :

self.__button.setEnabled( self._editable() )
# Not using `_editable()` as it considers the whole plug to be non-editable if
# any child has an input connection, but that shouldn't prevent us adding a new
# tweak.
self.__button.setEnabled( self.getPlug().getInput() is None and not Gaffer.MetadataAlgo.readOnly( self.getPlug() ) )

def __menuDefinition( self ) :

Expand Down
5 changes: 4 additions & 1 deletion python/GafferSceneUI/ShaderTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ def __init__( self, plug ) :

def _updateFromPlug( self ) :

self.__button.setEnabled( self._editable() )
# Not using `_editable()` as it considers the whole plug to be non-editable if
# any child has an input connection, but that shouldn't prevent us adding a new
# tweak.
self.__button.setEnabled( self.getPlug().getInput() is None and not Gaffer.MetadataAlgo.readOnly( self.getPlug() ) )

def __menuDefinition( self ) :

Expand Down
5 changes: 4 additions & 1 deletion python/GafferUI/ContextVariableTweaksUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ def __init__( self, plug ) :

def _updateFromPlug( self ) :

self.__button.setEnabled( self._editable() )
# Not using `_editable()` as it considers the whole plug to be non-editable if
# any child has an input connection, but that shouldn't prevent us adding a new
# tweak.
self.__button.setEnabled( self.getPlug().getInput() is None and not Gaffer.MetadataAlgo.readOnly( self.getPlug() ) )

def __menuDefinition( self ) :

Expand Down

0 comments on commit 7f7e265

Please sign in to comment.