blender-python
Blender Python API Reference
Targets Blender 5.0 and Blender 5.1. Python 3.11 (5.0) and 3.13 (5.1).
General Principles
Module structure. The top-level bpy module exposes sub-modules: bpy.context (read-only
state), bpy.data (all data-blocks), bpy.ops (operators), bpy.types (RNA type definitions),
bpy.props (property declarations), bpy.app (version/paths/handlers/timers), bpy.utils
(registration helpers), bpy.msgbus (message bus subscriptions), bpy.path (Blender path
utilities). Standalone modules include bmesh, mathutils, gpu, gpu_extras, freestyle,
aud, imbuf, bl_math, bpy_extras, idprop, and blf.
Data-block model. All persistent data lives as data-blocks in bpy.data collections
(objects, meshes, materials, etc.). Data-blocks inherit from bpy.types.ID. Maximum name
length is 255 bytes. Loading a new blend file replaces all data-blocks — never hold long-lived
Python references across file loads. Data-blocks are reference-counted; use orphans_purge() to
remove unused ones.