how to get the value for playback in and out point in python

How to get the value for playback in and out point in Natron with python?

We have this:
https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronEngine/App.html?highlight=timeline#NatronEngine.NatronEngine.App.timelineGetLeftBound

But I need the red range of the timeline where it will loop (playback in and out point).

Thanks in advance.

https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronGui/PyViewer.html#pyviewer

1 Like

Thanks man. Here is the code for reference:

app=app1
pane1 = app.getViewer("Viewer1")
range= pane1.getFrameRange()
print (range) # Tuple Range
print (range[0]) #First frame in range
print (range[1]) #Last frame in range

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

If you were to use this piece of code in a python tool, you would have to tweak it a bit.
’ app =app1’ is useless for example.
Plus, you don’t know what the viewer’s name would be.
So you’d better use the ‘getPluginID()’ function.

1 Like

Here an example :

1 Like

Thanks. Will be very valuable for my research