Home

bpy

bpy is Blender's Python API module that exposes Blender's data, operators, and UI for scripting and automation. It is the primary interface for extending Blender with Python, enabling users to create tools, automate repetitive tasks, and build add-ons. Scripts typically run in Blender's embedded Python interpreter and can interact with most Blender features, including scenes, objects, materials, animation, rendering, and user interface elements.

The API is organized into several submodules: bpy.data provides access to data blocks such as objects, meshes,

Scripts can be run from the Blender Text Editor, loaded from external files, or packaged as add-ons.

Common uses include automating repetitive editing, batch exporting, procedural content generation, rigging and animation tools, scene

Version compatibility is important: Blender's Python API evolves between releases, so scripts target a specific Blender

materials,
textures;
bpy.context
exposes
the
current
context
(active
object,
selected
objects,
current
mode);
bpy.ops
contains
operators
that
perform
actions
(such
as
object
transformations,
creation,
file
I/O);
bpy.types
contains
Python
classes
that
wrap
Blender
data
types;
bpy.props
defines
properties
for
custom
data
blocks;
bpy.utils
and
bpy.app
supply
utilities
and
runtime
information.
Changes
made
through
bpy
affect
the
current
project
and
can
be
saved
to
a
.blend
file
or
exported.
Since
calls
often
depend
on
context,
scripts
must
check
the
active
context
before
performing
certain
operations.
setup,
and
add-on
development.
Developers
create
operators
and
panels,
register
classes,
and
define
preferences
and
properties
so
the
tool
integrates
with
Blender's
interface.
version;
the
official
API
reference
documents
available
modules,
properties,
and
operator
signatures.
Performance
considerations
include
avoiding
unnecessary
context
switches
and
using
data-block
references
to
manage
memory.