文本编辑器¶
Blender有一个窗口类型叫 文本编辑器 ,通过 窗口类型 菜单或 Shift-F11 快捷键即可进入该编辑器窗口。
标题¶
新打开的文本编辑器是灰色空白的,外加一个简单的标题栏。当创建或打开文本文件后,会出现更多选项。
- Editor Type
标准编辑器选择按钮。
- 菜单
编辑器菜单。
- Resolve Conflict
Resolves modified file conflicts when an external text file is updated from another program.
- Reload from Disk
Opens the file from drive again, overriding any local changes.
- Make Text Internal
Converts the external text data-block into an internal one.
- Ignore
Hides the warning message until the external text file is modified externally again.
- 文本
用于选择文本或创建新文本的 数据块菜单。使用之后标题栏将发生变化。
- Run Script (play icon)
执行文本作为Python脚本 Alt-P. 请参阅 模板菜单。
- 显示
Toggle display options.
Line Numbers, Word Wrap, Syntax Highlighting
- Script Node Update (refresh icon)
When an OSL-file is opened, this updates the Shader Script node with new options and sockets from the script.
主视图¶
敲击键盘可以在文本缓存中输入文本。
跟平常一样,按下拖动并松开 LMB 用于选择文本。按下 RMB 打开上下文菜单。
Tip
文本窗口的其他用途
在你想要分享你的 .blend
文件的时候,文本窗口也很方便。可以在 文本 窗口添加一个 README
文本,解释该blend文件的内容。务必保证在保存时该文本是可见的!
Sidebar¶
Find & Replace¶
- Find Text Ctrl-F
Searches for instances of a text that occur after the cursor. Using the eyedropper icon will search for the currently selected text and sets the selection to the match. Find Next searches for the next instance of the text.
- Replace Text Ctrl-H
Searches for the text specified in Find Text and replaces it with the new text. Using the eyedropper icon will set the currently selected text as the replace text. Replace searches for the next match and replaces it. Replace All searches for the match and replaces all occurrences of the match with the new text.
- Case
Search is sensitive to upper-case and lower-case letters.
- Wrap
Search again from the start of the file when reaching the end.
- All
Search in all text data-blocks instead of only the active one.
Properties¶
- Margin
Shows a right margin to help keep line length at a reasonable length when scripting. The width of the margin is specified in Margin Column.
- Font Size Ctrl-WheelUp
The size of the font used to display text.
- Tab Width
The number of character spaces to display tab characters with.
- Indentation
Use Tabs or Spaces for indentations.
用法¶
运行脚本¶
最方便的按键是 Alt-P ,使用Blender内置的解释器解析缓冲区的内容。在进行之前,需要注意的是,Blender配有一个内置的功能齐全的Python解释器,并具有许多Blender特有的模块,如 脚本与扩展Blender 部分所述。