create_curves_object
create_curves_object(
positions= None ,
curve_sizes= None ,
name= 'Curves' ,
collection= None ,
)
Create a new Blender curves object (new Curves type, not legacy Curve).
Parameters
positions
np .ndarray
The control point positions as a numpy array with shape (N, 3). If None, creates an empty curves object. Defaults to None.
None
curve_sizes
list [int ] | np .ndarray
Number of points in each curve. For example, [4, 5, 6] creates 3 curves with 4, 5, and 6 control points respectively. Total must equal len(positions). If None, creates an empty curves object. Defaults to None.
None
name
str
The name of the object. Defaults to ‘Curves’.
'Curves'
collection
bpy.types .Collection
The collection to link the object to. Defaults to None.
None
Returns
Object
The created curves object.
Raises
ValueError
If positions and curve_sizes lengths don’t match.
Examples
import numpy as np
from databpy import create_curves_object
# Create 2 curves with 3 and 4 points
positions = np.random.random((7 , 3 ))
curves_obj = create_curves_object(positions, [3 , 4 ])