PyViewer

Synopsis

A PyViewer is a wrapper around a Natron Viewer. See detailed description…

Functions

Detailed Description

This class is a wrapper around a Natron Viewer, exposing all functionalities available as user interaction to the Python API.

To get a PyViewer , use the getViewer(scriptName) function, passing it the script-name of a viewer node.

Member functions description

NatronGui.PyTabWidget.seek(frame)
Parameters:frameint

Seek the timeline to a particular frame. All other viewers in the project will be synchronized to that frame.

NatronGui.PyTabWidget.getCurrentFrame()
Return type:int

Returns the current frame on the timeline.

NatronGui.PyTabWidget.startForward()

Starts playback, playing the video normally.

NatronGui.PyTabWidget.startBackward()

Starts playback backward, like a rewind.

NatronGui.PyTabWidget.pause()

Pauses the viewer if the playback is ongoing.

NatronGui.PyTabWidget.redraw()

Redraws the OpenGL widget without actually re-rendering the internal image. This is provided for convenience as sometimes the viewer might need refreshing for OpenGL overlays.

NatronGui.PyTabWidget.renderCurrentFrame([useCache=True])
Parameters:useCachebool

Renders the current frame on the timeline. If useCache is False, the cache will not be used and the frame will be completely re-rendered.

NatronGui.PyTabWidget.setFrameRange(firstFrame, lastFrame)
Parameters:
  • firstFrameint
  • lastFrameint

Set the frame range on the Viewer to be [firstFrame , lastFrame] (included).

NatronGui.PyTabWidget.getFrameRange()
Return type:Tuple

Returns a 2-dimensional tuple of int containing [firstFrame , lastFrame].

NatronGui.PyTabWidget.setPlaybackMode(mode)
Parameters:modeNatronEngine.Natron.PlaybackModeEnum

Set the playback mode for the Viewer, it can be either bouncing, looping or playing once.

NatronGui.PyTabWidget.getPlaybackMode()
Return type:NatronEngine.Natron.PlaybackModeEnum

Returns the playback mode for this Viewer.

NatronGui.PyTabWidget.getCompositingOperator()
Return type:NatronEngine.Natron.ViewerCompositingOperatorEnum

Returns the current compositing operator applied by the Viewer.

NatronGui.PyTabWidget.setCompositingOperator(operator)
Parameters:operatorNatronEngine.Natron.ViewerCompositingOperatorEnum

Set the current compositing operator applied by the Viewer.

NatronGui.PyTabWidget.getAInput()
Return type:int

Returns the index of the input (the same index used by getInput(index)) used by the A choice of the Viewer.

NatronGui.PyTabWidget.setAInput(index)
Parameters:indexint

Set the index of the input (the same index used by getInput(index)) used by the A choice of the Viewer.

NatronGui.PyTabWidget.getBInput()
Return type:int

Returns the index of the input (the same index used by getInput(index)) used by the B choice of the Viewer.

NatronGui.PyTabWidget.setBInput(index)
Parameters:indexint

Set the index of the input (the same index used by getInput(index)) used by the B choice of the Viewer.

NatronGui.PyTabWidget.setChannels(channels)
Parameters:channelsNatronEngine.Natron.DisplayChannelsEnum

Set the channels to be displayed on the Viewer.

NatronGui.PyTabWidget.getChannels()
Return type:NatronEngine.Natron.DisplayChannelsEnum

Returns the current channels displayed on the Viewer.

NatronGui.PyTabWidget.setProxyModeEnabled(enabled)
Parameters:enabledbool

Set the proxy mode enabled.

NatronGui.PyTabWidget.isProxyModeEnabled(enabled)
Return type:bool

Returns whether the proxy mode is enabled.

NatronGui.PyTabWidget.setProxyIndex(index)
Parameters:indexint

Set the index of the proxy to use. This is the index in the combobox on the graphical user interface, e.g. index = 0 will be 2

NatronGui.PyTabWidget.getProxyIndex()
Return type:int

Returns the index of the proxy in use. This is the index in the combobox on the graphical user interface, e.g. index = 0 will be 2

NatronGui.PyTabWidget.setCurrentView(viewIndex)
Parameters:viewIndexint

Set the view to display the given viewIndex. This is the index in the multi-view combobox visible when the number of views in the project settings has been set to a value greater than 1.

NatronGui.PyTabWidget.getCurrentView()
Parameters:viewIndexint

Returns the currently displayed view index. This is the index in the multi-view combobox visible when the number of views in the project settings has been set to a value greater than 1.