Skip to content

Commit

Permalink
_HistoryWindow : Remove unnecessary member
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Sep 24, 2024
1 parent a8fd2ca commit f2cb10b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
19 changes: 6 additions & 13 deletions python/GafferSceneUI/_HistoryWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,17 @@ def headerData( self, canceller = None ) :

class _NodeNameColumn( GafferUI.PathColumn ) :

def __init__( self, title, property, scriptNode ) :
def __init__( self, title, property ) :

GafferUI.PathColumn.__init__( self )

self.__title = title
self.__property = property
self.__scriptNode = scriptNode

def cellData( self, path, canceller = None ) :

cellValue = path.property( self.__property )

data = self.CellData( cellValue.relativeName( self.__scriptNode ) )

return data
node = path.property( self.__property )
return self.CellData( node.relativeName( node.scriptNode() ) )

def headerData( self, canceller = None ) :

Expand Down Expand Up @@ -136,9 +132,7 @@ def headerData( self, canceller = None ) :

class _HistoryWindow( GafferUI.Window ) :

def __init__( self, inspector, scenePath, context, scriptNode, title=None, **kw ) :

assert( isinstance( scriptNode, Gaffer.ScriptNode ) )
def __init__( self, inspector, scenePath, context, title=None, **kw ) :

if title is None :
title = "History"
Expand All @@ -147,13 +141,12 @@ def __init__( self, inspector, scenePath, context, scriptNode, title=None, **kw

self.__inspector = inspector
self.__scenePath = scenePath
self.__scriptNode = scriptNode

with self :
self.__pathListingWidget = GafferUI.PathListingWidget(
Gaffer.DictPath( {}, "/" ),
columns = (
_NodeNameColumn( "Node", "history:node", self.__scriptNode ),
_NodeNameColumn( "Node", "history:node" ),
_ValueColumn( "Value", "history:value", "history:fallbackValue" ),
_OperationIconColumn( "Operation", "history:operation" ),
),
Expand Down Expand Up @@ -291,7 +284,7 @@ def __updateFinished( self, pathListing ) :
# The node and all of its parents up to the script node
# contribute to the path name.

while node is not self.__scriptNode and node is not None :
while node is not None and not isinstance( node, Gaffer.ScriptNode ) :
self.__nodeNameChangedSignals.append(
node.nameChangedSignal().connect(
Gaffer.WeakMethod( self.__nodeNameChanged ),
Expand Down
1 change: 0 additions & 1 deletion python/GafferSceneUI/_InspectorColumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ def __showHistory( pathListing ) :
column.inspector(),
pathString,
inspectionContext,
pathListing.ancestor( GafferUI.Editor ).scriptNode(),
"History : {} : {}".format( pathString, column.headerData().value )
)
pathListing.ancestor( GafferUI.Window ).addChildWindow( window, removeOnClose = True )
Expand Down

0 comments on commit f2cb10b

Please sign in to comment.