store_named_attribute

store_named_attribute(
    obj,
    data,
    name,
    atype=None,
    domain=Domains.POINT,
    overwrite=True,
)

Adds and sets the values of an attribute on the object.

Parameters

Name Type Description Default
obj bpy.types.Object The Blender object. required
data np.ndarray The attribute data as a numpy array. required
name str The name of the attribute. required
atype str or AttributeTypes or None The attribute type to store the data as. If None, type is inferred from data. None
domain str or DomainType The domain of the attribute, by default ‘POINT’. Domains.POINT
overwrite bool Whether to overwrite existing attribute, by default True. True

Returns

Name Type Description
bpy.types.Attribute The added or modified attribute.

Raises

Name Type Description
ValueError If atype string doesn’t match available types.
AttributeMismatchError If data length doesn’t match domain size.