#NEWLINE# def __addFilter( self , filterType ) : #NEWLINE# #INDENT# filterNode = filterType ( ) #NEWLINE# with Gaffer . UndoContext ( self . getPlug ( ) . node ( ) . scriptNode ( ) ) : #NEWLINE# #INDENT# self . getPlug ( ) . node ( ) . parent ( ) . addChild ( filterNode ) #NEWLINE# self . getPlug ( ) . setInput ( filterNode [ 'out' ] ) #NEWLINE# #UNINDENT# scriptWindow = self . ancestor ( GafferUI . ScriptWindow ) #NEWLINE# if ( scriptWindow is not None ) : #NEWLINE# #INDENT# nodeGraphs = scriptWindow . getLayout ( ) . editors ( GafferUI . NodeGraph ) #NEWLINE# if nodeGraphs : #NEWLINE# #INDENT# graphGadget = nodeGraphs [ 0 ] . graphGadget ( ) #NEWLINE# graphGadget . getLayout ( ) . positionNode ( graphGadget , graphGadget )