Blender 4.4: Python API & Text Editor¶
Breaking Changes¶
Blender-based Python Classes Construction¶
Python-defined classes based on Blender types (like Operator
, PropertyGroup
, etc.)
that define their own __new__
/__init__
constructors must now call the parent's matching
function,
and pass on generic positional and keyword arguments:
import bpy
class AwesomeRaytracer(bpy.types.RenderEngine):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
...
Paint¶
paint.brush
andpaint.eraser_brush
are now read-only properties. (9e8c037375)
GPU¶
-
When drawing with
POLYLINE_FLAT_COLOR
,POLYLINE_SMOOTH_COLOR
orPOLYLINE_UNIFORM_COLOR
or when drawing wide lines (line width greater than 1) usingFLAT_COLOR
,SMOOTH_COLOR
orUNIFORM_COLOR
, the following rules now apply:- The
pos
attribute must useF32
formatFLOAT
fetch type. - The
color
attribute must useF32
format withFLOAT
fetch type or useU8
with 4 components andINT_TO_FLOAT_UNIT
for fetch mode. - Each attribute needs to be 4 byte aligned.
- Primitive type needs to be
GPU_PRIM_LINES
,GPU_PRIM_LINE_STRIP
orGPU_PRIM_LINE_LOOP
. - If drawing using an index buffer, it must contain no primitive restart index.
- The
Grease Pencil¶
- The influence vertex group was removed from the Texture Mapping modifier (c452d5d9e8)
Sequencer¶
- The
bpy.types.Sequence
and all related types got renamed tobpy.types.Strip
. See the full list here. - Text strip
align_x
andalign_y
were renamed toanchor_x
andanchor_y
. Propertyalignment_x
does proper alignment now. (77a5478c0f)
Additions¶
Grease Pencil¶
The Grease Pencil Python API got some new functionality. See the changes here.
Curves¶
- New
Curves.reorder_curves(new_indices=[...])
to reorder curves. (a265b591be) - New
Curves.set_types()
to change curve types (5db88ff2e3).
Nodes¶
- New
Node.color_tag
property, which returns an enum item corresponding to the node color tag (Texture, Vector, Output, etc...) (6cd33510c3) - New
bl_use_group_interface
property on custom node trees that allows disabling some built-in UI for node groups (ebfbc7757b).
Blender as a Python Module¶
The bpy package on pypi now optionally provides access to VFX libraries used by Blender. (PR#133082)
While most are available as separate packages on pypi, they may not have the same version or build options as Blender. This can lead to errors and crashes when interchanging data with Blender.