-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation
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.
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.
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.
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.
- 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+Enteron mac).
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
tkvariable - Shotgun API handle is available via the
shotgunvariable - The current context is stored in the
contextvariable - The shell engine can be accessed via the
enginevariable