src/bvhtoolbox/convert/bvh2csv.py
def write_joint_hierarchy(bvh_tree, filepath, scale=1.0):
    """Write joints' world positional 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
    :param scale: Scale factor for offset values.
    :type scale: float
    :return: If the write process was successful or not.
    :rtype: bool
    """
    data = list()
    for joint in bvh_tree.get_joints(end_sites=True):
        joint_name = joint.name
        parent_name = bvh_tree.joint_parent(joint_name).name if bvh_tree.joint_parent(joint_name) else ''
        row = [joint_name, parent_name]
        row.extend((scale * offset for offset in bvh_tree.joint_offset(joint.name)))
        data.append(tuple(row))
    data = np.array(data, dtype=[('joint', np.unicode_, 20),
                                 ('parent', np.unicode_, 20),
                                 ('offset.x', np.float),
                                 ('offset.y', np.float),
                                 ('offset.z', np.float)])
    try:
        np.savetxt(filepath,
                   data,
                   header=','.join(data.dtype.names),
                   fmt=['%s', '%s', '%10.5f', '%10.5f', '%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' world positional 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
    :param scale: Scale factor for offset values.
    :type scale: float
    :return: If the write process was successful or not.
    :rtype: bool
    
Write joints' world positional data to a CSV file.
Write joints ' world positional data to a CSV file .
def write_joint_hierarchy(bvh_tree, filepath, scale=1.0):
    data = list()
    for joint in bvh_tree.get_joints(end_sites=True):
        joint_name = joint.name
        parent_name = bvh_tree.joint_parent(joint_name).name if bvh_tree.joint_parent(joint_name) else ''
        row = [joint_name, parent_name]
        row.extend((scale * offset for offset in bvh_tree.joint_offset(joint.name)))
        data.append(tuple(row))
    data = np.array(data, dtype=[('joint', np.unicode_, 20),
                                 ('parent', np.unicode_, 20),
                                 ('offset.x', np.float),
                                 ('offset.y', np.float),
                                 ('offset.z', np.float)])
    try:
        np.savetxt(filepath,
                   data,
                   header=','.join(data.dtype.names),
                   fmt=['%s', '%s', '%10.5f', '%10.5f', '%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_hierarchy ( bvh_tree , filepath , scale = 1.0 ) : data = list ( ) for joint in bvh_tree . get_joints ( end_sites = True ) : joint_name = joint . name parent_name = bvh_tree . joint_parent ( joint_name ) . name if bvh_tree . joint_parent ( joint_name ) else '' row = [ joint_name , parent_name ] row . extend ( ( scale * offset for offset in bvh_tree . joint_offset ( joint . name ) ) ) data . append ( tuple ( row ) ) data = np . array ( data , dtype = [ ( 'joint' , np . unicode_ , 20 ) , ( 'parent' , np . unicode_ , 20 ) , ( 'offset.x' , np . float ) , ( 'offset.y' , np . float ) , ( 'offset.z' , np . float ) ] ) try : np . savetxt ( filepath , data , header = ',' . join ( data . dtype . names ) , fmt = [ '%s' , '%s' , '%10.5f' , '%10.5f' , '%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' world positional data to a CSV file.
Write joints ' world positional data to a CSV file .
"""Write joints' world positional 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
    :param scale: Scale factor for offset values.
    :type scale: float
    :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 .
scale
Scale factor for offset values.
Scale factor for offset values .