- Introduced a new asset catalog definition file for Blender to manage Bioxel assets. - Implemented layer caching and snapshot functionality in `layer.py`, allowing for VDB file generation and low-resolution snapshots. - Created node management functions in `node.py` for handling Bioxel nodes within Blender's Geometry Node Editor. - Added an operator to extract mesh data from selected nodes in `structure.py`. - Developed UI panels in `panels.py` for layer management, including import options and layer library display.
11 lines
305 B
Python
11 lines
305 B
Python
|
|
def normalize_axis_index(axis, ndim):
|
|
# Check if `axis` is in the correct range and normalize it
|
|
if axis < -ndim or axis >= ndim:
|
|
msg = f"axis {axis} is out of bounds for array of dimension {ndim}"
|
|
raise Exception(msg)
|
|
|
|
if axis < 0:
|
|
axis = axis + ndim
|
|
return axis
|