About Python Scripting
 
 
 

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

NoteThe Toxik 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 Toxik installation).

With Python and the Toxik 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.

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

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

There are also scripts that Toxik itself invokes (archiving, rendering, pre-comp import, etc.) in the resource/scriptssufolder of the Toxik 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 Toxik 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 Toxik. 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.