create_bob(
vertices=None,
edges=None,
faces=None,
name='NewObject',
collection=None,
uuid=None,
)
Create a BlenderObject wrapper around a new Blender object.
Parameters
vertices |
ndarray or None |
Array of vertex coordinates. Each row represents a vertex. Default is None. |
None |
edges |
ndarray or None |
Array of edge indices. Each row contains indices of vertices forming an edge. Default is None. |
None |
faces |
ndarray or None |
Array of face indices. Each row contains indices of vertices forming a face. Default is None. |
None |
name |
str |
Name of the created object. Default is “NewObject”. |
'NewObject' |
collection |
bpy.types.Collection or None |
Blender collection to link the object to. Default is None. |
None |
uuid |
str or None |
Directly set the UUID on the resulting BlenderObject rather than generating one. Default is None. |
None |
Returns
|
BlenderObject |
A wrapped Blender object with additional functionality. |
See Also
: The underlying function used to create the Blender object.
Notes
If uuid is provided, it will be set both on the BlenderObject wrapper and the underlying Blender object.
Examples
import numpy as np
from databpy.object import create_bob
vertices = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]])
bob = create_bob(vertices=vertices, name="MyObject")
print(bob.name)
print(len(bob))
bob.named_attribute("position")
array([[0., 0., 0.],
[1., 0., 0.],
[1., 1., 0.],
[0., 1., 0.]])