create_mesh_object
create_mesh_object(
vertices=None,
edges=None,
faces=None,
name='Mesh',
collection=None,
)
Create a new Blender mesh object.
Parameters
| 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
|
Object |
The created mesh object. |
Raises
|
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. |