Project Class

From TouchDesigner Documentation
Jump to: navigation, search

The Project class describes the current session. It can be accessed with the project object, found in the automatically imported td module.


folderstr (Read Only):

The folder at which the project resides.

namestr (Read Only):

The filename under which the project is saved.

saveVersionstr (Read Only):

The App version number when the project was last saved.

saveBuildstr (Read Only):

The App build number when the project was last saved.

saveTimestr (Read Only):

The time and date the project was last saved.

saveOsNamestr (Read Only):

The App operating system name when the project was last saved.

saveOsVersionstr (Read Only):

The App operating system version when the project was last saved.

pathsdict (Read Only):

A dictionary which can be used to define URL-syntax path prefixes, enabling you to move your media to different locations easily. This dictionary is saved and loaded in the .toe file. Example: Run project.paths['movies'] = 'C:/MyMovies', and reference it with a parameter expression: movies://butterfly.jpg. To manually convert between expanded and collapsed paths, use tdu.collapsePath() and tdu.expandPath from the Tdu Module, for example tdu.expandPath('movies://butterfly.jpg') expands to C:/MyMovies/butterfly.jpg. Alternately, to enable you to have different media locations on different machines, you can put a JSON file in the same folder as your .toe that gets read on startup. It would contain something like { "project.paths": { "movies": "M:/MyMovies" } }. If your .toe file is called MyProject.10.toe, the JSON file must be called MyProject.Settings.json. (Setting project.paths with python in your .toe overrides the JSON file.)

cookRatefloat :

Get or set the maximum number of frames processed each second. In general you should not need to use this. It is preferred to look at the FPS of the root component to know the cooking rate. Individual components may have their own rates, specified by rate.

a = project.cookRate # get the current cook rate 
project.cookRate = 30 # set the cook rate to 30 FPS

Note: This is displayed and set in the user interface at the bottom-left: the "FPS" field.

realTimebool :

Get or set the real time cooking state. When True, frames may be skipped in order to maintain the cookRate. When False, all frames are processed sequentially regardless of duration. This is useful to render movies out using the Movie File Out TOP without dropping any frames for example.

a = project.realTime
project.realTime = False # turn off real time playback.

isPrivatebool (Read Only):

True when the project networks cannot be directly viewed.

isPrivateKeybool (Read Only):

True when the private networks are accessible by a pass phrase.

cacheParametersbool :

Cache parameter values instead of always evaluating.

externalToxModifiedInProjectbool (Read Only):

Callback for when an external tox has been modified in the current project and there are other instances of the same tox loaded elsewhere in the project.

externalToxModifiedOnDiskbool (Read Only):

Callback for when an external tox file has been modified on disk.



Load a specific .toe file from disk.

  • path - (Optional) The path of the file to load. If not specified, loads the default.toe file, as specified in preferences.

save(path, saveExternalToxs=False)bool:

Save the current session to disk. Returns True if a file was saved, False otherwise (eg, if the file exists, and when prompted, the user selects to not overwrite).

  • path - (Optional) If not provided the default/current filename is incremented and used. The current file is under folder project.folder.
  • saveExternalToxs - (Keyword, Optional) If set to True, will save out the contents of any COMP that references an external .tox into the referenced .tox file.'test_demo.toe')

quit(force=False, crash=False)None:

Quit the project.

  • force - (Keyword, Optional) If set to True, unsaved changes will be discarded without prompting.
  • crash - (Keyword, Optional) If set to True, the application will terminate unexpectedly. This is used for system testing.
project.quit()  #quit project, possibly prompting for unsaved changes if 'Prompt to Save on Exit' in Preferences dialog is enabled.
project.quit(force=True)  #quit project immediately.


Add privacy to a toe file with the given key.

Privacy can only be added to toes that currently have no privacy, and are using a Pro license.

  • key - The key phrase. This should resolve to a non-blank string.


Completely remove privacy from a toe file.

  • key - The current privacy key phrase.


Gain access to a private file. The file will still be private the next time it is saved or re-opened.

  • key - The current privacy key phrase.


Formatted contents of current cook and parameter evaluation stack.



Formatted contents of current python stack.


TouchDesigner Build:

TOuch Environment file, the file type used by TouchDesigner to save your project.

The frame rate that TouchDesigner's Timeline uses. Equal to the Frames per Second value project.cookRate.

An Operator Family that creates, composites and modifies images, and reads/writes images and movies to/from files and the network. TOPs run on the graphics card's GPU.

Some operators have a DAT docked to them that contains some python functions. These functions, called "callbacks", get called when something in the operator changes.

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

TouchDesigner Component file, the file type used to save a Component from TouchDesigner.

Privacy of Components or .toe files is the protection of networks to enable using them but not accessing them internally.