Blender Python: Scripting Environment

<<< Return to the Blender Python Notebook

Summary

Blender allows you to change up your viewport layout to reflect different ways of working. For example, you might need one set of windows for modeling, and a different set for rendering. The same is true for scripting. Blender comes with a preset scripting layout that you can customize to meet your coding needs.

Blender's interface includes:

  • Text Editor
  • Python Console
  • Info Window
  • Blender Console

Here is what a typical scripting layout might look like…

BlenderSetup.JPG

Interface Elements

Text Editor

A standard text editor for editing, loading, and saving Python script files. You can do standard stuff like line numbering and syntax highlighting…. but, alas, there is not code completion.

BlenderText.JPG

Python Console

A standard text editor for editing, loading, and saving Python script files. You can do standard stuff like line numbering and syntax highlighting…. but, alas, there is not code completion. Coupled with the text editor, the Python Console is a handy tool for exploring the API more efficiently while coding.

BlenderPyConsole.JPG

The console offers an 'Autocomplete' feature which allows you to explore the Python API…

BlenderPyConsole-Autocomplete.JPG

Info Window

Blender's 'Info' view port shows you all recent Blender activity as executable Python commands. This is very handy for prototyping a process using modeling methods and then assembling them into a script.

This is what the Info window returns after placing some objects in the scene…

BlenderInfo.JPG

Blender Console

Blender also has a console window… this is nothing more than a command prompt. Most often, I use it to print values when I am testing.

BlenderConsole.JPG
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License