

It gives access to library data, for example:īpy. This implies that any setting that can be changed via a button can also be changed with Python.Īccessing data from the currently loaded blend-file is done with the module bpy.data. You can access Blender’s data with the Python API in the same way as the animation system or user interface Key Concepts Data Access Accessing Data-Blocks

Scripts can also run from the command line with Blender but to learn scripting in Blender this isn’t essential. The Python Console is typically used for typing in snippets and for testing to get immediate feedback,īut can also have entire scripts pasted into it. py files or paste then from the clipboard, then test using Run Script. You can use the Scripting workspace accessible from the Topbar tabs.įrom the text editor you can open. Rather than manually configuring your spaces for Python development, Text editor or entering commands in the Python console.īoth the Text Editor and Python Console are space types you can select from the header. The two most common ways to execute Python scripts are using the built-in Scripts/startup/bl_operators for operators. Scripts/startup/bl_ui for the user interface. To examine further scripts distributed with Blender, see: Many python examples can be found in the text editor’s template menu. The context menu of buttons directly links to this API documentation (when enabled see above). Is great for testing one-liners it has autocompletion so you can inspect the API quickly.īutton tooltips show Python attributes and operator names (when enabled see above). This document its intended to familiarize you with Blender Python APIĪ quick list of helpful things to know before starting: Subscribe to changes to data and it’s properties.ĭefine new settings in existing Blender data. Modify user preferences, keymaps and themes.Ĭreate user interface elements such as menus, headers and panels.Ĭreate new rendering engines that integrate with Blender. But some areas are still being extended and improved.Įdit any data the user interface can (Scenes, Meshes, Particles etc.).
