def _z_order_mask_set(swizzler_mask, c_blocks, x_blocks, y_blocks, z_blocks,
    c_mask, x_mask, y_mask, z_mask):
    """THIS FUNCTION WILL SWIZZLE AN ARRAY OF x, y, AND z OFFSETS
    TOGETHER IN z-ORDER STYLE. THE COLOR CHANNELS CAN ALSO BE SWIZZLED"""
    c_mask.extend([0] * c_blocks)
    i = c_blocks
    for size in range(max(x_blocks, y_blocks, z_blocks)):
        """WE CHECK IF THERE ARE STILL ANY BITS FOR EACH AXIS"""
        if x_blocks > size:
            x_mask.append(i)
            i += 1
        if y_blocks > size:
            y_mask.append(i)
            i += 1
        if z_blocks > size:
            z_mask.append(i)
            i += 1
        i -= 1
