databpy
  • Home
  • Attributes
  • API
  1. Objects
  2. BlenderObjectBase
  • Function reference
  • Attribute
    • named_attribute
    • store_named_attribute
    • remove_named_attribute
    • AttributeDomains
    • AttributeTypes
    • AttributeArray
  • Collections
    • create_collection
  • Objects
    • create_object
    • create_mesh_object
    • create_curves_object
    • create_pointcloud_object
    • create_bob
    • evaluate_object
    • BlenderObject
    • BlenderObjectAttribute
    • BlenderObjectBase
    • LinkedObjectError

On this page

  • BlenderObjectBase
    • Attributes
  1. Objects
  2. BlenderObjectBase

BlenderObjectBase

BlenderObjectBase(obj=None)

Minimal base class for Blender objects with name and object access.

This provides a minimal set of functionality to persistently track a an object in Blender’s database, providing access to it’s name property and also the object itself. Referencing an object in the database directly can lead to ReferenceErrors as Blender can without warning alter the database and thus the Object’s place in memory.

To get around this BlenderObjectBase always looks up via the name attribute and double checks with the uuid attribute to ensure the correct object is being returned. If there is a mismatch the entite database will be searched for an object with a uuid that matches and if none is found a LinkedObjectError will be raised.

Blender internally uses it’s own UUID / reference system but this is currently (and frustratingly) not available to us via the Python API.

Attributes

Name Type Description
object bpy.types.Object The wrapped Blender object.
uuid str Unique identifier for this object instance.
name str Name of the Blender object.