Inherited by: PyGuiApplication


This object represents a background instance of Natron. See detailed description


Detailed Description

When running Natron there’s a unique instance of the PyCoreApplication object. It holds general information about the process.

Generally, throughout your scripts, you can access this object with the variable natron that Natron pre-declared for you, e.g.:



The variable natron belongs to the module NatronEngine, hence make sure to make the following import:

from NatronEngine import*

Otherwise with a regular import you can still access natron by prepending the module:



The variable stored in the module NatronEngine contains a reference to a PyCoreApplication. If you need to have the GUI functionalities provided by PyGuiApplication, you must then use the variable natron belonging to the module NatronGui. Hence make sure to make the following import to have access to natron:

from NatronGui import*

With a regular import you can access it using NatronGui.natron.


Make sure to not make the 2 following imports, otherwise the natron variable will not point to something expected:

#This you should not do!
from NatronEngine import *
from NatronGui import *

#This is OK
import NatronEngine
import NatronGui

#This can also be done for convenience
from NatronEngine import NatronEngine.natron as NE
from NatronGui import NatronGui.natron as NG

This class is used only for background (command-line) runs of Natron, that is when you launch Natron in the following ways:

Natron -b ...
Natron -t

For interactive runs of Natron (with the user interface displayed), the derived class PyGuiApplication is used instead, which gives access to more GUI specific functionalities.

You should never need to make a new instance of this object yourself. Note that even if you did, internally the same object will be used and they will all refer to the same Natron application.

In GUI mode, a :doc`PyGuiApplication` can have several projects opened. For each project you can refer to them with pre-declared variables app1 , app2, etc…

In background mode, there would be only 1 project opened, so Natron does the following assignment for you before calling any scripts:

app = app1

See App to access different opened projects.

Member functions description

class NatronEngine.PyCoreApplication

Defines a new variable pointing to the same underlying application that the natron variable points to. This is equivalent to calling:

myVar = natron

Adds a new path to the Natron search paths. See this section for a detailed explanation of Natron search paths.

Return type:AppSettings

Returns an object containing all Natron settings. The settings are what can be found in the preferences of Natron.

Return type:int

Returns the build-number of the current version of Natron. Generally this is used for release candidates, e.g.:

Natron v1.0.0-RC1 : build number = 1 Natron v1.0.0-RC2 : build number = 2 Natron v1.0.0-RC3 : build number = 3
Return type:App

Returns the App instance at the given idx. Note that idx is 0-based, e.g.: 0 would return what’s pointed to by app1.

Return type:App

Returns the App instance corresponding to the last project the user interacted with.

Return type:str

Returns a string describing the development status of Natron. This can be one of the following values:

  • Alpha : Meaning the software has unimplemented functionalities and probably many bugs left
  • Beta : Meaning the software has all features that were planned are implemented but there may be bugs
  • RC : Meaning the software seems in a good shape and should be ready for release unless some last minute show-stoppers are found
  • Release : Meaning the software is ready for production
Return type:sequence

Returns a sequence of string with all natron search paths.

Return type:int

Returns an int with the version of Natron encoded so that you can compare versions of Natron like this:

if natron.getNatronVersionEncoded() >= 20101:

In that example, Natron’s version would be 2.1.1

Return type:int

Returns the major version of Natron. If the version is 1.0.0, that would return 1.

Return type:int

Get the minor version of Natron. If the version is 1.2.0, that would return 2.

Return type:int

Returns the revision number of the version. If the version is 1.2.3, that would return 3.

Return type:str

Returns the version of Natron as a string, e.g.: “1.1.0”

Return type:int

Returns the maximum hardware concurrency of the computer. If the computer has 8 hyper-threaded cores, that would return 16.

Return type:int

Returns the number of :doc`App` instances currently active.

Return type:sequence

Returns a sequence of strings with all plugin-IDs currently loaded.

Return type:sequence

Same as getPluginIDs() but returns only plug-ins containing the given filter. Comparison is done without case-sensitivity.

Return type:bool

Returns True if Natron is executed in background mode, i.e: from the command-line, without any graphical user interface displayed.

Return type:bool

Returns True if Natron is executed on a 64 bit computer.

Return type:bool

Returns True if Natron is executed on a Linux or FreeBSD distribution.

Return type:bool

Returns True if Natron is executed on MacOSX.

Return type:bool

Returns True if Natron is executed on Unix. Basically this is equivalent to:

if natron.isLinux() or natron.isMacOSX():
Return type:bool

Returns True if Natron is executed on Windows.


Convenience function to set the After Project Created callback. Note that this will override any callback set in the Preferences–>Python–>After Project created. This is exactly the same as calling:



Clever use of this function can be made in the script to do generic stuff for all projects (whether they are new projects or loaded projects). For instance one might want to add a list of Formats to the project. See the example here


Convenience function to set the Default After Project Loaded callback. Note that this will override any callback set in the Preferences–>Python–>Default After Project Loaded. This is exactly the same as calling: