databpy 0.11.0
  • Home
  • Attributes
  • API
  • Changelog
  1. Function reference
  • Function reference
  • Attribute
    • named_attribute
    • store_named_attribute
    • remove_named_attribute
    • list_attributes
    • AttributeDomains
    • AttributeTypes
    • AttributeArray
    • Attribute
    • attribute.guess_atype_from_array
  • Collections
    • create_collection
    • move_to_collection
  • Objects
    • create_object
    • create_mesh_object
    • create_curves_object
    • create_pointcloud_object
    • create_bob
    • evaluate_object
    • GeometrySet
    • BlenderObject
    • BlenderObjectAttribute
    • BlenderObjectBase
  • Errors
    • DatabpyError
    • NamedAttributeError
    • AttributeNotFoundError
    • AttributeMismatchError
    • LinkedObjectError
  • Utilities
    • require
    • require_data
    • mesh_data
    • curves_data
    • pointcloud_data
    • volume_data
    • active_scene
    • active_object
    • centre
    • lerp
  • Nodes (deprecated)
    • nodes.new_tree
    • nodes.swap_tree
    • nodes.custom_string_iswitch
    • nodes.append_from_blend
    • nodes.new_socket
    • nodes.tree_interface
    • nodes.input_socket
    • nodes.output_socket
    • nodes.socket_value
    • nodes.set_socket_value
    • nodes.MaintainConnections
    • nodes.DuplicatePrevention

On this page

  • Function reference
    • Attribute
    • Collections
    • Objects
    • Errors
    • Utilities
    • Nodes (deprecated)

Function reference

Attribute

For interacting with attributes on meshes

named_attribute Read the values of a named attribute into a numpy array.
store_named_attribute Write values to a named attribute on the object, creating it if needed.
remove_named_attribute Remove a named attribute from an object.
list_attributes List the names of the attributes on an object, sorted alphabetically.
AttributeDomains Enumeration of attribute domains in Blender.
AttributeTypes Enumeration of attribute types in Blender.
AttributeArray A numpy array of an attribute’s values that writes changes back to Blender.
Attribute Low-level wrapper around a Blender attribute with explicit reads and writes.
attribute.guess_atype_from_array Infer the attribute type for an array from its shape and dtype.

Collections

Working with collections in Blender

create_collection Create a new Blender collection or get an existing one.
move_to_collection Move one or many objects into a target collection.

Objects

create_object Create a new Blender mesh object.
create_mesh_object Create a new Blender mesh object.
create_curves_object Create a new Blender Curves object (the hair curves type, not the legacy Curve type).
create_pointcloud_object Create a new Blender point cloud object.
create_bob Create a BlenderObject wrapper around a new Blender mesh object.
evaluate_object Return the object with its modifiers evaluated.
GeometrySet Access the evaluated geometry of an object (bpy.types.GeometrySet).
BlenderObject A convenience class for working with Blender objects.
BlenderObjectAttribute Minimal base class for Blender objects with attribute access.
BlenderObjectBase Minimal base class for Blender objects with name and object access.

Errors

Exceptions raised by databpy, which all inherit from DatabpyError

DatabpyError Base class for all errors raised by databpy.
NamedAttributeError Base exception for all attribute-related errors in databpy.
AttributeNotFoundError Exception raised when a named attribute doesn’t exist.
AttributeMismatchError Exception raised when data doesn’t fit an attribute.
LinkedObjectError Error raised when a wrapper can no longer find the Blender object it is linked to.

Utilities

Typed helpers that check for None or narrow data-block types, plus general utilities

require Return the given value, raising an error if it is None.
require_data Return the object’s data-block, checked to be of the given type.
mesh_data Return the object’s data-block, checked to be a Mesh.
curves_data Return the object’s data-block, checked to be a Curves.
pointcloud_data Return the object’s data-block, checked to be a PointCloud.
volume_data Return the object’s data-block, checked to be a Volume.
active_scene Return the active scene, raising an error if there is none.
active_object Return the active object, raising an error if there is none.
centre Calculate the weighted centroid of the vectors.
lerp Linearly interpolate between two values.

Nodes (deprecated)

Deprecated and removed in databpy 0.13.0, as node groups are handled by nodebpy (https://pypi.org/project/nodebpy/). Importing databpy.nodes warns with a FutureWarning.

nodes.new_tree
nodes.swap_tree
nodes.custom_string_iswitch Creates a node group containing a Index Switch node with all the given values.
nodes.append_from_blend Append a Geometry Nodes node tree from the given .blend file
nodes.new_socket Create a new input or output socket on the interface of the node tree.
nodes.tree_interface Return the interface of a node tree, raising an error if it has none.
nodes.input_socket Get an input socket of a node by index or name.
nodes.output_socket Get an output socket of a node by index or name.
nodes.socket_value Return the default value of a socket.
nodes.set_socket_value Set the default value of a socket.
nodes.MaintainConnections
nodes.DuplicatePrevention Context manager to cleanup duplicated node trees when appending node groups
named_attribute