Accessing Python Editor commands
 
 
 

The following table lists the Python Editor commands accessible via the Python Editor toolbar, including the equivalent keyboard shortcuts.

Tool Command Description
 
Create work area (Ctrl+T) Creates a tab in the work area of the Python Editor for a new script.
 
Load script (Ctrl+O) Opens the Open Python Script browser window for you to locate a script to load in the Python Editor work area. This action creates a tab for the loaded script.
 
Close script (Ctrl+-) Closes the active script in the Python Editor work area. Note that each script loaded in the work area has its work area (tab).
 
Save script (Ctrl+S / F2) Saves the active script or opens the Save File browser where you specify the file name and location of the new script you want to save.
 
Execute script (F5) Executes code or a script, depending on whether a code is highlighted. If nothing is highlighted, it executes the active script in the Python Editor work area.
 
Add script to scene (Ctr+=) Adds the active script to the current scene.
Note

Make sure to save your script before adding it to the scene.

 
Access Python Tool Manager (F10) Displays the Python Tool Manager that contains the tool scripts available in the PythonStartup folder in the C:\My Documents\MB\2012-x32\config or C:\My Documents\MB\2012-x64\config default directories.
 
Launch Telnet console Launches a local Telnet console that is automatically connected to MotionBuilder. The MotionBuilder modules are already imported.
 
Trigger Python contextual Help (F1) Displays in the interactive console, the list of Python Editor keyboard shortcuts when the interactive console is empty. Displays in the interactive console, contextual Help for either a command in the interactive console, or for highlighted text in the interactive console or work area.
 
Launch Python Logger (F7) Launches the script debugger tool.
 
Clear interactive console Clears the Python Editor interactive console.
 
Clear active work area Clears the Python Editor active work area.
 
Search in interactive console (Ctrl+F) Specifies the interactive console as the search area for the text entered in the text field.
Note

This is a toggle button.

 
Search in active work area (Ctrl+F) Specifies the active work area as the search area for the text entered in the text field.
Note

This is a toggle button.

 
Search in interactive console and in active work area (Ctrl+F) Specifies the interactive console and the active work area as the search area for the text entered in the text field.
Note

This is a toggle button.

 
Trigger search for text entered in Text field Locates in the specified area (interactive console/active work area) the text entered in the text field.
Note

Keyboard shortcuts available via the Python Editor override the MotionBuilder keyboard shortcuts when the Python Editor is in active state.

For a complete list of Python Editor keyboard shortcuts, see Python Editor keyboard shortcuts.

Python custom keyboard shortcuts

MotionBuilder includes global keyboard shortcuts and Python Editor keyboard shortcuts. The global keyboard shortcuts are available anywhere from within MotionBuilder. You can bind a keyboard shortcut to the execution of a script by modifying configuration files.

Important

A script needs to be bound to a keyboard shortcut that is not used. If it isn’t, MotionBuilder gives a warning message.

You can customize 13 Python Editor keyboard shortcuts so they call the Python code. A graphical editor for this file is provided with the KeyboardMapper.py script.