databpy 0.11.0
  • Home
  • Attributes
  • API
  • Changelog
  1. Attribute
  2. remove_named_attribute
  • 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

  • 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
AttributeNotFoundError If the named attribute does not exist on the object.
TypeError If obj isn’t an object, or its data isn’t a mesh, curves or point cloud.
NamedAttributeError If the attribute is required by Blender (e.g. position) and can’t be removed.

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)=}")
list_attributes(obj)=['.corner_edge', '.corner_vert', '.edge_verts', '.select_edge', '.select_poly', '.select_vert', '.uv_select_edge', '.uv_select_face', '.uv_select_vert', 'UVMap', 'position', 'random_numbers', 'sharp_face']
remove_named_attribute(obj, "random_numbers")
print(f"{list_attributes(obj)=}")
list_attributes(obj)=['.corner_edge', '.corner_vert', '.edge_verts', '.select_edge', '.select_poly', '.select_vert', '.uv_select_edge', '.uv_select_face', '.uv_select_vert', 'UVMap', 'position', 'sharp_face']
store_named_attribute
list_attributes