Workflow Tips

This section contains a list of features included in Charcoal Editor 2 that are designed to improve the scripting workflow in Maya.

Single Line Execution

Using the Ctrl+Alt+Enter hotkey will execute the line of code at the current cursor position. This eliminates the need to select the text prior to execution.

Note: Leading whitespaces are stripped prior to execution to avoid Python indentation errors.

Execute and Execute All

Charcoal Editor 2 provides the ability to excute the full script or a selected block of code. As with the native script editor, Ctrl+Enter executes the select text (or the entire script if nothing is selected) and Ctrl+Shift+Enter executes the entire script regardless of selection.

Note: Unlike Maya's script editor, code is never deleted from the editor when executed.

Print MEL Variables

Highlighting and executing a variable in MEL will print the current value of the variable to the Output Window. This is equivalent to using the MEL print command.

Note: Double-clicking on a MEL variable will highlight the variable name including the '$' character.

Highlight Matching Words

When a word is highlighted in the Code Editor, any matching words will be highlighted as well. This can used to quickly identify all instances of a word in the script. The color of the matching highlight can be changed in Preferences.

Note: This behavior also exists in the Output Window. Selecting a word in the Output Window will highlight any matching words.

Configurable Layout

Charcoal Editor provides a customizable layout with widgets that can be repositioned within the main window. The visibility of widgets, toolbars and the tab bar can be toggled through the main menu or preferences dialog. A tab can be reordered by dragging it left or right in the tab bar or moved to a different view by dragging it into that view.

Note: The Charcoal Editor layout is persistent and is maintained between Maya sessions.

Split-Screen Editing

By default, Charcoal Editor only displays one code view. When working with multiple files it can be beneficial to split the editor into different views, each with their own tab bar, maintaining a different set of buffers.

To split a view, simply drag a tab to the edge of the existing group. A highlight overlay should be displayed showing where the new group will be created. When all tabs are closed/moved from a group, the editor will hide the empty group.

Show Hidden Tabs and Spaces

Indentation in languages such as Python are very important. Mixing tabs and spaces in a script can result in difficult to identify errors.

Enabling Show Tabs and Spaces in the main main or toolbar will display symbols for tabs and spaces in the Code Editor. The symbols are unobtrusive and make it easy to identify spacing inconsistencies.