Graphics Reference
In-Depth Information
The Blender Text Editor
Like any other window type, the Blender text editor can be accessed from the Window Type menu in the left
corner of any window header. The text editor window is shown in Figure 13-2 .
Figure 13-2 A script displayed in the text editor
The basic functionality in the File and Edit menus is standard and will be familiar to anyone who has used a
word processor or text editor.
The Format menu item has various options that are specific to Python scripting. For example, the Indent and
Unindent options will add a tabbed indentation to (or remove one from) selected blocks of text. You can also
perform these operations from the keyboard with Tab and Shift+Tab, respectively. Because the structure of a
Python program is determined by the pattern of indentation, these are handy shortcuts. The Comment menu
item adds a hash ( # ) symbol to the beginning of each line in a selected block of text, which comments out that
line of code. Commented-out code is ignored by the interpreter, so this is a good way to add comments to help
explainthecodetootherprogrammerswhomighthavecausetoreadit(ortoyourself,ifyoucomebacktoyour
script after a long time away!). You can also use the Comment and Uncomment options to remove and replace
blocks of code from your script for testing purposes, without having to delete and rewrite them. Commenting
out code to help narrow down the source of a problem is a commonly used method of debugging. The Convert
Whitespace option in the Format menu enables you to convert whitespace from spaces to tabs and vice versa,
which can be useful for fixing problems that can result from using multiple editors with different tab settings.
 
 
Search WWH ::




Custom Search