2011

Table Of Contents
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.
How to Run a Composite Python Script
To successfully run a Python script that makes use of the Composite Python
API (or more specifically, a script that imports Composite Python modules),
it is important to run it in the right environment, in order for the Python
interpreter to find the Composite Python modules and libraries, and for the
Composite code to execute properly afterwards.
There are two contexts in which a script can be run. First, in the Composite
embedded Python interpreter, i.e. within the Composite interactive application.
And secondly, in an external Python interpreter, i.e. within a separate Python
process, typically from a shell.
Setting Up the Environment
Setting up the environment involves either an embedded or external
interpreter.
Embedded
In the case of the embedded interpreter, the environment is already set up by
Composite for a Python script to run properly.
868 | Appendix C Python Scripting