A numpy array subclass that automatically syncs changes back to the Blender object.
Values are retrieved from the Blender object as a numpy array, the operation is applied and the result is store back on the Blender object. This allows for operations like pos[:, 2] += 1.0 to work seamlessly.
Examples:
import databpy as dbimport numpy as npobj = db.create_object(np.random.rand(10, 3), name="test_bob")db.AttributeArray(obj, "position")
import databpy as dbimport numpy as npbob = db.create_bob(np.random.rand(10, 3), name="test_bob")print('Initial position:')print(bob.position) # Access the position attribute as an AttributeArraybob.position[:, 2] +=1.0print('Updated position:')print(bob.position)print('As Array:')print(np.asarray(bob.position)) # Convert to a regular numpy array