Skip to content

Documentation

Josh Tomlinson edited this page Apr 6, 2016 · 12 revisions

This is a python console panel for use in DCCs with access to a python interpreter that have limited or no support for interacting with said interpreter.

Panel

Once installed, the console is registered as a panel in the DCC and is available in the Shotgun menu. In apps that support embedded Toolkit panels (maya, nuke, houdini), the console will display in a docked panel. When using with older versions of these DCCs or in a DCC that does not support panels, the console will simply be shown as a regular Toolkit dialog.

Editor

The console has an input area for editing python. The input editor includes line numbers, highlights the cursor's current line, and does some basic syntax highlighting. The console attempts to use the palette of the DCC to give it an integrated look and feel.

Output

The output area displays the results of the executed python. Echoing the source python commands is turned on by default and is differentiated in the output by being prefixed with >>>. There is a toggle for turning the echo off. Syntax and Runtime errors are shown in red with a full stack trace for debugging.

Buttons

  • There are buttons for clearing the input and output areas.
  • There are also buttons for loading an external python file as well as saving the current editor contents.
  • There is a button to execute the current editor contents as well as a shortcut Ctrl+Enter (Command+Enter on mac).

Globals

Some Shotgun/Toolkit globals are pre-defined in the console, similar to what is available in the Shotgun Engine for the shell.

  • Tk API handle is available via the tk variable
  • Shotgun API handle is available via the shotgun variable
  • The current context is stored in the context variable
  • The shell engine can be accessed via the engine variable

Clone this wiki locally