snnib.blender.utils.mesh_utils¶
functions to manipulate and read from blender meshes/objects
Exceptions
Classes
- Functions
‘add_spline2data()’ – adds a spline to some existing curve
‘apply_rotation()’ – applies the objects rotation (similar to ctrl + A > apply rotation)
‘get_bbox()’ – returns bounding box of some object
Other Objects
Functions
|
adds a new (bezier) spline with vertices at coords to data |
|
applies rotation to obj |
|
returns bounding box of obj |
|
|
|
- snnib.blender.utils.mesh_utils.add_spline2data(data: bpy.types.Curve, coords: List[List[float]], scale: List[float] | float = 1.0, handle_type: List[str] | str = 'AUTO') bpy.types.Spline[source]¶
adds a new (bezier) spline with vertices at coords to data
- Parameters
- data
bpy.types.Curve
curve object to add a spline to
- coords
List[List[float]]
coordinates of the vertices defining the new spline
- scale
List[float], float, optional
scale to apply to the vertices’ handles
- if float
applied to all handles
the default is 1.0
- handle_type
List[str], str, optional
handle type to use for each of the generated vertices
- if str
applied to all handles
the default is ‘AUTO’
Raises
- Returns
- spline
bpy.types.Spline
generated spline
- Dependencies
bpy
logging
numpy
typing
- snnib.blender.utils.mesh_utils.apply_rotation(obj: bpy.types.Object)[source]¶
applies rotation to obj
equivalent to calling Ctrl + a > apply rotation in the UI
- Parameters
- obj
bpy.types.Object
object to apply rotation to
Raises
Returns
- Dependencies
bpy
logging
numpy
typing
- snnib.blender.utils.mesh_utils.get_bbox(obj: bpy.types.Object) Tuple[ndarray, ndarray][source]¶
returns bounding box of obj
- Parameters
- obj
bpy.types.Object
object to get bounding box of
Raises
- Returns
- min
np.ndarray
minimum of the bounding box as [x,y,z]
- max
np.ndarray
maximum of the bounding box as [x,y,z]
- Dependencies
bpy
logging
numpy
typing