App, app1 and project


When doing python scripting I find it confusing that there is app and also app1. I never know which to use.

Also when i have multiple natron projects open and running scripts, are the scripts contained to the project or can they accidentally cross into the other project?

Natron App instance

app1, app2, app3 respectively indicates the opened projects (in order of opening).
app on the other hand is defined automatically by Natron prior to calling a script within an application instance


numbered in order of opening is not useful, or at least I dont see how it would be useful in scripting.

maybe better if you could change that so it is something like

app = running natron instance,
project = open project by that instance,
name = the project file name



They are mainly used to allow Natron itself to work internally when multiple projects are opened. You may forget all about app1, app2, etc… (in fact they should be removed from any doc).
I don’t see what app.project would bring, and is already available via the corresponding parameters app.projectPath and app.projectName


ah! perfect!

thanks for the explanation, yes best to update the doc.


You may contribute to the doc and also report bugs if at some points the app variable does not work correctly.


OK I will make that update to the doc soon and also add a couple more examples of basic scripting actions.
later you can correct if needed.


I am updating the doc. Couple questions: how to retrieve the list of open project instances? and also could you overload getInstance to allow the project name as parameter instead of index?

curApp = NatronEngine.natron.getInstance(projectname)



Then iterate on each instance using index:

We can add an overload by project name, of course


I had a go at updating the doc but the app1 references are all through it. I dont feel in a position to make changes that big to the doc.