src/bvhtoolbox/convert/bvh2csv.py
def write_joint_rotations(bvh_tree, filepath):
    """Write joints' rotation data to a CSV file.

    :param bvh_tree: BVH tree that holds the data.
    :type bvh_tree: BvhTree
    :param filepath: Destination file path for CSV file.
    :type filepath: str
    :return: If the write process was successful or not.
    :rtype: bool
    """
    time_col = np.arange(0, bvh_tree.nframes*bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
    data_list = [time_col]
    header = ['time']
    for joint in bvh_tree.get_joints():
        channels = [channel for channel in bvh_tree.joint_channels(joint.name) if channel[1:] == 'rotation']
        header.extend(['{}.{}'.format(joint.name, channel[:1].lower()) for channel in channels])
        data_list.append(np.array(bvh_tree.frames_joint_channels(joint.name, channels)))
        
    data = np.concatenate(data_list, axis=1)
    try:
        np.savetxt(filepath, data, header=','.join(header), fmt='%10.5f', delimiter=',', comments='')
        return True
    except IOError as e:
        print("ERROR({}): Could not write to file {}.\n"
              "Make sure you have writing permissions.\n".format(e.errno, filepath))
        return False
Write joints' rotation data to a CSV file.

    :param bvh_tree: BVH tree that holds the data.
    :type bvh_tree: BvhTree
    :param filepath: Destination file path for CSV file.
    :type filepath: str
    :return: If the write process was successful or not.
    :rtype: bool
    
Write joints' rotation data to a CSV file.
Write joints ' rotation data to a CSV file .
def write_joint_rotations(bvh_tree, filepath):
    time_col = np.arange(0, bvh_tree.nframes*bvh_tree.frame_time, bvh_tree.frame_time)[:, None]
    data_list = [time_col]
    header = ['time']
    for joint in bvh_tree.get_joints():
        channels = [channel for channel in bvh_tree.joint_channels(joint.name) if channel[1:] == 'rotation']
        header.extend(['{}.{}'.format(joint.name, channel[:1].lower()) for channel in channels])
        data_list.append(np.array(bvh_tree.frames_joint_channels(joint.name, channels)))
    data = np.concatenate(data_list, axis=1)
    try:
        np.savetxt(filepath, data, header=','.join(header), fmt='%10.5f', delimiter=',', comments='')
        return True
    except IOError as e:
        print("ERROR({}): Could not write to file {}.\n"
              "Make sure you have writing permissions.\n".format(e.errno, filepath))
        return False
def write_joint_rotations ( bvh_tree , filepath ) : time_col = np . arange ( 0 , bvh_tree . nframes * bvh_tree . frame_time , bvh_tree . frame_time ) [ : , None ] data_list = [ time_col ] header = [ 'time' ] for joint in bvh_tree . get_joints ( ) : channels = [ channel for channel in bvh_tree . joint_channels ( joint . name ) if channel [ 1 : ] == 'rotation' ] header . extend ( [ '{}.{}' . format ( joint . name , channel [ : 1 ] . lower ( ) ) for channel in channels ] ) data_list . append ( np . array ( bvh_tree . frames_joint_channels ( joint . name , channels ) ) ) data = np . concatenate ( data_list , axis = 1 ) try : np . savetxt ( filepath , data , header = ',' . join ( header ) , fmt = '%10.5f' , delimiter = ',' , comments = '' ) return True except IOError as e : print ( "ERROR({}): Could not write to file {}.\n" "Make sure you have writing permissions.\n" . format ( e . errno , filepath ) ) return False
Write joints' rotation data to a CSV file.
Write joints ' rotation data to a CSV file .
"""Write joints' rotation data to a CSV file.

    :param bvh_tree: BVH tree that holds the data.
    :type bvh_tree: BvhTree
    :param filepath: Destination file path for CSV file.
    :type filepath: str
    :return: If the write process was successful or not.
    :rtype: bool
    """
If the write process was successful or not.
If the write process was successful or not .
bool
bvh_tree
BVH tree that holds the data.
BVH tree that holds the data .
filepath
Destination file path for CSV file.
Destination file path for CSV file .