Changelog
0.9.0 (unreleased)
A full static-typing pass over the package and test suite. The code base now passes ty with zero errors and zero suppression comments (every # type: ignore has been removed), and ty runs in CI alongside ruff. Blender API values that are typed as Something | None or as wide data-block unions are now handled through small helpers that check at runtime and narrow the type, instead of being ignored.
Added
- Typed narrowing helpers, exported from the top-level
databpynamespace:require()— return a value, raisingValueErrorif it isNonerequire_data(),mesh_data(),curves_data(),pointcloud_data(),volume_data()— returnObject.datachecked to be the expected data-block type, raisingTypeErrorotherwiseactive_scene()andactive_object()— non-optional accessors forbpy.context.scene/bpy.context.active_object
- Node helpers in
databpy.nodesfor the optional-heavy node APIs:tree_interface(),new_socket(),input_socket(),output_socket(),socket_value()andset_socket_value(). databpy.object.get_uuid()/set_uuid()for the dynamically registereduuidproperty onbpy.types.Object.- Type checking with ty in CI (new
typecheckjob in the lint workflow), withtyandruffadded as locked dev dependencies. - API documentation sections for the new utility and node helpers.
Changed
- Breaking: invalid-type errors now consistently raise
TypeError(some previously raisedValueErrororAttributeError):utils.path_resolve(),attribute.guess_atype_from_array(),BlenderObject.__getitem__()with a non-string key, assigning a non-ObjecttoBlenderObjectBase.object, and the deprecatedvertices/edgesproperties on non-mesh objects. - Object creation functions (
create_object(),create_mesh_object(),create_curves_object(),create_pointcloud_object(),create_bob()and theBlenderObject.from_*()classmethods) are now typed to accept any array-like (lists and tuples always worked at runtime). utils.lerp()accepts scalars and array-likes, converting to numpy arrays internally (the documented list example now actually works).Attribute()accepts anybpy.types.Attributeand validates it against the supported concrete attribute types, raisingNamedAttributeErrorfor unsupported ones.nodes.new_tree()is typed as returning aGeometryNodeTreeand raisesNodeGroupCreationErrorif an existing node group with the requested name is not a geometry node tree.nodes.MaintainConnectionsandnodes.swap_tree()raiseTypeErrorwhen given a node that is not aGeometryNodeGroup.custom_string_iswitch()catches specific exception types during node group creation (rather than a blindexcept Exception) and chains the original error onto the raisedNodeGroupCreationError.
Fixed
from databpy import utilswas shadowed bydatabpy.nodes.utilsin the package namespace, so static analysis (and potentially import order) resolveddatabpy.utilsto the wrong module.- Docs builds failed with the latest griffe (quartodoc 0.11.1 is incompatible with griffe 2.x); griffe is now pinned to
<2in the dev dependencies.
0.8.0 (2026-07-21)
Support for the new attribute types introduced in Blender 5.2, alongside a cleanup of the attribute typing system. Requires bpy >= 5.2.
Added
- Support for the new Blender 5.2 attribute types:
FLOAT4— 4D float vectors (Float4Attribute)INT16_2D— 2D 16-bit signed integer vectors (Short2Attribute)STRING— text strings (StringAttribute). String support is experimental and raises a warning when used: string attributes are accessible through the Python API but are not yet properly supported within Geometry Nodes. Values are read and written per-element (as unicode numpy arrays) since Blender’sforeach_get/foreach_setdo not support string properties.
GeometrySet, for accessing all components of an object’s evaluated geometry — including multi-component Geometry Nodes outputs (mesh, point cloud, curves and instances) that a normally evaluated object doesn’t expose. Providesnamed_attribute()/list_attributes()across components and an informativerepr()suited to snapshot testing.Attribute.storage_type, exposing Blender 5.2’s new attribute storage types ("ARRAY"or"SINGLE").SINGLE-storage attributes (produced by Geometry Nodes for constant values) read transparently as full arrays.named_attribute(evaluate=True)andevaluate_object()now work for Curves and PointCloud objects, not just meshes.BlenderObject.store_named_attribute()now returns the created or modified attribute (previously returnedNone).
Changed
- Results of
AttributeArrayoperations (e.g.pos + 1, comparisons) are now plainnumpy.ndarrays, and copies (pos.copy(), boolean-mask indexing) are detached from Blender — neither syncs back on modification. True views (slices, column access) remain connected and continue to auto-sync. - Data is cast to the attribute’s storage dtype before writing, letting Blender’s
foreach_setuse its fast buffer path instead of per-element iteration (a significant speedup for the common case of passing float64 arrays). - Breaking: attribute type guessing for
(n, 4)float arrays now maps to the genericFLOAT4type instead ofFLOAT_COLOR. To store colors or quaternions, explicitly request them with e.g.store_named_attribute(..., atype="FLOAT_COLOR").(n, 4)uint8arrays still map toBYTE_COLOR. - Attribute type guessing for
(n, 2)int16/uint16arrays now maps toINT16_2D(other integer widths still map toINT32_2D), and string arrays map toSTRING. - Requires
bpy >= 5.2(previously>= 5.1). - Improved type hints throughout the attribute module: precise
Literaltypes for attribute type and domain names,tuple[int, ...]shapes, and an immutableAttributeTypedataclass.
Fixed
- Setting an existing attribute with dictionary syntax (
bob["color"] = data) no longer performs a second, redundant write with a re-guessed attribute type, which could raise a type mismatch error for color and quaternion attributes. Attribute.from_array()now triggers the same object-data refresh workaround asstore_named_attribute(), so writes through the low-level interface update reliably in the viewport.repr()of anAttributeArraythat has lost its attribute reference no longer raises an error.
Removed
- Breaking: removed the unused legacy
AttributeTypeInfoandAttributeDomainclasses from the public API. Use theAttributeTypesandAttributeDomainsenums instead.
0.7.0 (2026-03-05)
- Updated dependencies for Blender 5.1 (#69).
0.6.2 (2026-03-05)
- Improved typing for the attribute module (#67).
- Added
move_to_collection()for moving objects from one collection into another (#62, thanks @kolibril13).
0.6.0 (2025-11-25)
0.5.1 (2025-11-06)
0.5.0 (2025-10-25)
- Better point cloud and curves support (#57).
- Requires Blender >= 4.5 for compatibility with point cloud support.
0.4.2 (2025-10-24)
- Internal improvements and cleanup (#56).
- Deprecated
Attribute.n_valuesin favor ofAttribute.size.
0.4.1 (2025-10-21)
- Fixed
AttributeArray.__str__(#55).
0.4.0 (2025-10-21)
- Fixed integer attribute returns to be
int32(#54).
For older releases, see the GitHub releases page.