About Python Scripting

 
 
 

Scripting in Composite is implemented by extending the Python language (http://www.python.org). Composite is written in the C++ programming language, so some libraries, known as Python extension modules, allow for a script to invoke the Composite code through Python functions. The result is the Composite Python API.

Note

The Composite Python API documentation can be accessed through the Help, via the Scripting menu (the HTML files are located in the documentation/scripting directory of the Composite installation).

With Python and the Composite Python API installed, you can write scripts to automatically perform certain repetitive managerial tasks and creative work on a project, such as creating compositions, adding nodes to it, importing material, versioning, rendering, and so on.

Composite ships with a number of sample scripts for performing common tasks. These sample scripts are located in the resources/scripts/examplessubfolder of the Composite installation directory.

Note

Example Python scripts are provided with no guarantee of effectiveness or efficiency.

There are also scripts that Composite itself invokes (archiving, rendering, pre-comp import, etc.) in the resource/scriptssufolder of the Composite installation directory. You may find these scripts helpful both as examples and as a starting point for your own scripts. In some cases, the script command that Composite launches to accomplish a given task is specified in the project preferences. For example, the “Render Actions” tab in the project preferences contains the “Render Executable” setting that specifies the Python command line executed each time you render a composition in Composite. By default, that command line launches the “render.py” script. You can edit the command line to launch a different script or change the “render.py script (located in resources/scripts) to modify the default rendering behavior, like performing post-render tasks, for example.