UI Class

From TouchDesigner Documentation
Revision as of 10:27, 9 August 2017 by Admin (talk | contribs) (UI Class Auto Create)
Jump to: navigation, search

The UI class describes access to the UI elements of the application, found in the automatically imported td module.


clipboard(Read Only):

Get or set the operating system clipboard text contents.

colors(Read Only):

Access to the application colors.

dpiBiCubicFilter(Read Only):

Get or set the global DPI scale filtering mode of TouchDesigner windows. True means bi-cubic, False means linear.

masterVolume(Read Only):

Get or set the master audio output volume. A value of 0 is no output, while a value of 1 is full output.

options(Read Only):

Access to the application options.

panes(Read Only):

Access to the set of all panes.

performMode(Read Only):

Get or set Perform Mode. Set to True to go into Perform Mode, False to go into Designer Mode.

preferences(Read Only):

Access to the application preferences, which can also be access through the Preferences Dialog.

redrawMainWindow(Read Only):

Get or set whether the main window should redraw. The main window is either the main network editor, or the perform window.

rolloverOp(Read Only):

Node currently under the mouse in the network editor.

rolloverPar(Read Only):

Parameter currently under the mouse a parameter dialog.

showPaletteBrowser(Read Only):

Get or set display of the palette browser.

status(Read Only):

Get or set the status message. Example: ui.status = 'Operation Complete'

undo(Read Only):

Acess to application undo functions.



: Open the MIDI Device Mapper Dialog.


: Open the Key Manager Dialog.



View a url or file in the default external application. url_or_path - url or path to launch.

a = ui.viewFile('output.txt')


: Open an Explorer window.


: Open the Performance Monitor Dialog.



Update and redraw all viewports, nodes, UI elements etc immediately. This update is otherwise done once per frame at the end of all script executions. For example, if the current frame is manually changed during a script, a call to refresh will cause all dependent data to update immediately. for i in range(100): ui.status = str(i)



: Open the Palette.

messageBox(title, message, buttons=['Ok']):

: -> int

This method will open a message dialog box with the specified message. Returns the index of the button clicked. title - Specifies the window title. message - Specifies the content of the dialog. buttons - (Keyword, Optional) Specifies a list button labels to show in the dialog.

  1. basic usage

ui.messageBox('Warning', 'Have a nice day.')

  1. specify options and report result

a = ui.messageBox('Please select:', 'Buttons:', buttons=['a', 'b', 'c']) ui.messageBox('Results', 'You selected item: ' + str(a))

  1. pick a node from their paths

ui.messageBox('Please select:', 'Nodes:', buttons=me.parent().children)

  1. pick a node from their first names (list comprehension)

ui.messageBox('Please select:', 'Nodes:', buttons=[x.name for x in me.parent().children])

  1. pick a cell

ui.messageBox('Please select:', 'Cells:', buttons=op('table1').cells('*','*'))



Open a dialog displaying current version information.

See also: App.version


: Open the Textport.

chooseFolder(title='Select Folder', start=None, asExpression=False):

: -> str or None

Open a dialog box for selecting a folder. Returns the folder selected or None if the dialog is cancelled. title - (Keyword, Optional) If provided, specifies the window title. start - (Keyword, Optional) If provided, specifies an initial folder location and/or filename selection. asExpression - (Keyword, Optional) If set to true, the results are provided as an expression, suitable for a Parameter expression or as input to an eval() call. App Class member constants such as samplesFolder may be included in the result. a = ui.chooseFolder()

a = ui.chooseFolder(title='Select a folder location.')


: Open the Preferences Dialog.


: Open the Beat Dialog.


: Open dialog to the Ableton controller.



Open help page for the specific dialog. title - Specifies the help page to open.

ui.openDialogHelp('Window Placement Dialog')


: Open the Import File Dialog.


: Open the Help Dialog.


: Open the Console Window.


: Open the Errors Dialog.


: Open the Bookmarks Dialog.

chooseFile(load=True, start=None, fileTypes=None, title=None, asExpression=False):

: -> str or None

Open a dialog box for loading or saving a file. Returns the filename selected or None if the dialog is cancelled. load - (Keyword, Optional) If set to True, the dialog will be a Load dialog, otherwise it's a Save dialog. start - (Keyword, Optional) If provided, specifies an initial folder location and/or filename selection. fileTypes - (Keyword, Optional) If provided, specifies a list of file extensions that can be used as filters. Otherwise '*.*' is the only filter. asExpression - (Keyword, Optional) If set to true, the results are provided as an expression, suitable for a Parameter expression or as input to an eval() call. App Class member constants such as samplesFolder may be included in the result. title (Keyword, Optional) If provided, will override the default window title. a = ui.chooseFile(start='python_examples.toe', fileTypes=['toe'], title='Select a toe') #specify extension a = ui.chooseFile(fileTypes=tdu.fileTypes['image'], title='Select an image') #any support image extension path = ui.chooseFile(load=False,fileTypes=['txt'],title='Save table as:') if (path)



: Open the Window Placement Dialog.


: Open the Search Dialog.


: Open the New Project Dialog.



Open the Export Movie Dialog.

path - Specifies the operator content to export.

TouchDesigner Build:


Mode where the network editing window is not open, your performance interface window(s) is open and you are running your application as fast as possible. See Designer Mode.

You edit your networks in Designer Mode. See Perform Mode.

Any floating window that is not a Pane or Viewer.

The tool built-in to TouchDesigner that analyzes and displays what TouchDesigner is doing as it generates an image.

A built-in panel in TouchDesigner that contains a library of components and media that can be dragged-dropped into a TouchDesigner network.

A dialog box in which commands and scripts can entered manually. Script errors and python print() messages are also output to the textport.

The operating system's holder of files and other folders (directories). It does not refer to operators within TouchDesigner. See Network Path.

Strictly refers to a window in Microsoft Windows. User-created windows are made with Panels inside Window Components, aside from the TouchDesigner editor window and its dialogs.

A pull-down list at the top of a network Pane containing jump-to Network Paths.

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

Exporting is the connection of CHOP channels to parameters of operators. The output of each exporting CHOP is one or more channels, active only while the CHOP Viewer is on. The current value of a channel can be exported to a parameter of any operator, overriding that parameter's value. See Parameter.