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

  • create_mesh_object
    • Parameters
    • Returns
    • Raises
  1. Objects
  2. create_mesh_object

create_mesh_object

create_mesh_object(
    vertices=None,
    edges=None,
    faces=None,
    name='Mesh',
    collection=None,
)

Create a new Blender mesh object.

Parameters

Name Type Description Default
vertices np.ndarray The vertices as a numpy array with shape (N, 3). Defaults to None. None
edges np.ndarray Vertex indices of each edge, with shape (M, 2). Defaults to None. None
faces np.ndarray Vertex indices of each face. Faces with different numbers of vertices can be given as a list of lists. Defaults to None. None
name str The name of the object. Defaults to ‘Mesh’. 'Mesh'
collection bpy.types.Collection The collection to link the object to. Defaults to None, which links it to a collection named “Collection”, created if needed. None

Returns

Name Type Description
Object The created mesh object.

Raises

Name Type Description
ValueError If vertices doesn’t have the shape (N, 3), an edge doesn’t have exactly 2 vertex indices, or an index is outside of the vertices.
TypeError If edge or face indices aren’t integers.
create_object
create_curves_object