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

On this page

  • Parameters
  • Raises
  • Examples
  1. Attribute
  2. remove_named_attribute

remove_named_attribute

remove_named_attribute(obj, name)

Remove a named attribute from an object.

Parameters

Name Type Description Default
obj bpy.types.Object The Blender object. required
name str Name of the attribute to remove. required

Raises

Name Type Description
AttributeError If the named attribute does not exist on the mesh.

Examples

import bpy
import numpy as np
from databpy import remove_named_attribute, list_attributes, store_named_attribute
obj = bpy.data.objects["Cube"]
store_named_attribute(obj, np.random.rand(8, 3), "random_numbers")
print(f"{list_attributes(obj)=}")
remove_named_attribute(obj, "random_numbers")
print(f"{list_attributes(obj)=}")
list_attributes(obj)=['position', 'random_numbers', '.select_vert', '.edge_verts', '.select_edge', '.select_poly', 'sharp_face', '.corner_vert', '.corner_edge', 'UVMap']
list_attributes(obj)=['position', '.select_vert', '.edge_verts', '.select_edge', '.select_poly', 'sharp_face', '.corner_vert', '.corner_edge', 'UVMap']