Script Editor

The Script Editor lets you execute single or multi-line Python code and see the output.

../../../_images/se_tools.png

Note

All the code written in the Script Editor is saved as separate .py files for each tab at the following path: $HOME/.opendcc/script_editor

Shortcuts

Shortcut

Action

Ctrl + Enter

Execute selected code or if nothing is selected entire tab

Ctrl + Space

Force autocomplete

Ctrl + /

Autocomment and it can also uncomment

Ctrl + F

Find/Replace tools

F1

Execute dir(selected code)

Autocomplete

The Script Editor autocompletes Python code, words, and SdfPath using the current stage. USD properties are autocompleted as well.

../../../_images/autocomplete.gif

Pressing Ctrl+Space forces the widget to appear.

Autocomment

Pressing Ctrl+/ makes the Script Editor try to intelligently comment/uncomment selected code.

../../../_images/script_editor_autocomment.gif

Toolbar

../../../_images/script_editor_toolbar.png

The Script Editor’s toolbar has Run code, Clean output, Add to shelf, and Search actions. Add to shelf allows you to add selected code to the shelf if the current shelf is custom (not built in). Search can search tabs and the output.

Tabs

../../../_images/script_editor_tabs.png

The tabs can be renamed with a double click on a tab. A new tab can be created with the Create new tab button.

Find/Replace

../../../_images/script_editor_find.png

The Find/Replace widget is shown by pressing Ctrl+F. Matching case can be toggled off and RegEx expressions are supported.

Preferences

../../../_images/script_editor_preferences.png

Autocomplete can be toggled on/off in the preferences. All tabs are saved before execution and will be restored if the program crashes. Saving tabs before execution can be switched off.