UI Class

From Derivative
Jump to: navigation, search

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



Members

UI.clipboardstr :

Get or set the operating system clipboard text contents.

UI.colorstd.Colors (Read Only):

Access to the application colors.

UI.dpiBiCubicFilterbool :

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

UI.masterVolumefloat :

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

UI.optionstd.Options (Read Only):

Access to the application options.

UI.panestd.Panes (Read Only):

Access to the set of all panes.

UI.performModebool :

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

UI.preferencestd.Preferences (Read Only):

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

UI.redrawMainWindowbool :

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

UI.rolloverOpOP (Read Only):

Operator currently under the mouse in a network editor.

UI.rolloverPartd.Par (Read Only):

Parameter currently under the mouse in a parameter dialog.

UI.lastChopChannelSelectedtd.Par (Read Only):

Last CHOP channel selected via mouse.

UI.showPaletteBrowserbool :

Get or set display of the palette browser.

UI.statusstr :

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

UI.undotd.Undo (Read Only):

Acess to application undo functions.

Methods

UI.openMIDIDeviceMapper()None:

Open the MIDI Device Mapper Dialog.

UI.openKeyManager()None:

Open the Key Manager Dialog.

UI.openImportFile()None:

Open the Import File Dialog.

UI.openSearch()None:

Open the Search Dialog.

UI.openConsole()None:

Open the Console Window.

UI.openCOMPEditor(path)None:

Open component editor for the specific operator.
  • path - Specifies the path to the operator. An OP can be passed in as well.

UI.openHelp()None:

Open the Help Dialog.

UI.openPaletteBrowser()None:

Open the Palette.

UI.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.
# basic usage
ui.messageBox('Warning', 'Have a nice day.')
# specify options and report result
a = ui.messageBox('Please select:', 'Buttons:', buttons=['a', 'b', 'c'])
ui.messageBox('Results', 'You selected item: ' + str(a))
# pick a node from their paths
ui.messageBox('Please select:', 'Nodes:', buttons=me.parent().children)
# pick a node from their first names (list comprehension)
ui.messageBox('Please select:', 'Nodes:', buttons=[x.name for x in me.parent().children])
# pick a cell
ui.messageBox('Please select:', 'Cells:', buttons=op('table1').cells('*','*'))

UI.openErrors()None:

Open the Errors Dialog.

UI.openPreferences()None:

Open the Preferences Dialog.

UI.openExplorer()None:

Open an Explorer window.

UI.openExportMovie(path="")None:

Open the Export Movie Dialog.
  • path - Specifies the operator content to export.

UI.openWindowPlacement()None:

Open the Window Placement Dialog.

UI.openBookmarks()None:

Open the Bookmarks Dialog.

UI.openDialogHelp(title)None:

Open help page for the specific dialog.
  • title - Specifies the help page to open.
ui.openDialogHelp('Window Placement Dialog')

UI.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):
	op('table1').save(path)

UI.openPerformanceMonitor()None:

Open the Performance Monitor Dialog.

UI.openTextport()None:

Open the Textport.

UI.refresh()None:

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)
	ui.refresh()

UI.viewFile(url_or_path)None:

View a url or file in the default external application.
  • url_or_path - url or path to launch.
a = ui.viewFile('output.txt')

UI.openNewProject()None:

Open the New Project Dialog.

UI.openOperatorSnippets(family=None, type=None, example=None)None:

Open the Operator Snippets window.

UI.openAbletonControl()None:

Deprecated. Use TDAbleton instead.

UI.openVersion()None:

Open a dialog displaying current version information. See also: App.version

UI.openBeat()None:

Open the Beat Dialog.

UI.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.')


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.

Any of the procedural data operators. OPs do all the work in TouchDesigner. They "cook" and output data to other OPs, which ultimately result in new images, data and audio being generated. See Node.

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.

Any floating window that is not a Pane or Viewer.

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

OP Snippets is a set of numerous examples of TouchDesigner operators, which you access via the Help menu. These can be copied/pasted into your projects.

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