Script Editor ============= The Script Editor lets you execute single or multi-line Python code and see the output. .. image:: ../../images/tools/script_editor/se_tools.png :align: center .. 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 --------- .. table:: :align: center ============ ============================================================ 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. .. image:: ../../images/tools/script_editor/autocomplete.gif :align: center Pressing **Ctrl+Space** forces the widget to appear. Autocomment ----------- Pressing **Ctrl+/** makes the Script Editor try to intelligently comment/uncomment selected code. .. image:: ../../images/tools/script_editor/script_editor_autocomment.gif :align: center Toolbar ------- .. image:: ../../images/tools/script_editor/script_editor_toolbar.png :align: center 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 ---- .. image:: ../../images/tools/script_editor/script_editor_tabs.png :align: center 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 ------------ .. image:: ../../images/tools/script_editor/script_editor_find.png :align: center The Find/Replace widget is shown by pressing **Ctrl+F**. Matching case can be toggled off and RegEx expressions are supported. Preferences ----------- .. image:: ../../images/tools/script_editor/script_editor_preferences.png :align: center 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.