src/bvhtoolbox/convert/csv2bvh.py
def csv2bvh_file(hierarchy_file, position_file, rotation_file, destination_file=None, scale=1.0):
    """ Composes BVH file from CSV input files. If no destination path is given, CSV file path is used.
    
    :param hierarchy_file: CSV file path containing hierarchy. Columns: joint, parent, offset.x, offset.y, offset.z
    :type hierarchy_file: str
    :param position_file: CSV file path to positions.
    :type position_file: str
    :param rotation_file:CSV file path to rotations.
    :type rotation_file: str
    :param destination_file: Output BVH file path.
    :type destination_file: str
    :param scale: Scale factor for root position and offset values.
    :type scale: float
    :return: Whether writing to file was successful or not.
    """
    if not destination_file:
        bvh_file = os.path.basename(hierarchy_file).replace('_hierarchy', '').replace('.csv', '.bvh')
        destination_file = os.path.join(os.path.dirname(hierarchy_file), bvh_file)
    else:
        # If the specified path doesn't yet exist, create it.
        if not os.path.exists(os.path.dirname(destination_file)):
            try:
                os.mkdir(os.path.dirname(destination_file))
            except OSError as exc:  # Guard against race condition.
                if exc.errno != errno.EEXIST:
                    raise

    data = csv2bvh_string(hierarchy_file, position_file, rotation_file, scale)
    success = write_file(data, destination_file)
    return success
 Composes BVH file from CSV input files. If no destination path is given, CSV file path is used.
    
    :param hierarchy_file: CSV file path containing hierarchy. Columns: joint, parent, offset.x, offset.y, offset.z
    :type hierarchy_file: str
    :param position_file: CSV file path to positions.
    :type position_file: str
    :param rotation_file:CSV file path to rotations.
    :type rotation_file: str
    :param destination_file: Output BVH file path.
    :type destination_file: str
    :param scale: Scale factor for root position and offset values.
    :type scale: float
    :return: Whether writing to file was successful or not.
    
Composes BVH file from CSV input files. If no destination path is given, CSV file path is used.
Composes BVH file from CSV input files . If no destination path is given CSV file path is used .
def csv2bvh_file(hierarchy_file, position_file, rotation_file, destination_file=None, scale=1.0):
    if not destination_file:
        bvh_file = os.path.basename(hierarchy_file).replace('_hierarchy', '').replace('.csv', '.bvh')
        destination_file = os.path.join(os.path.dirname(hierarchy_file), bvh_file)
    else:
        if not os.path.exists(os.path.dirname(destination_file)):
            try:
                os.mkdir(os.path.dirname(destination_file))
            except OSError as exc:  
                if exc.errno != errno.EEXIST:
                    raise
    data = csv2bvh_string(hierarchy_file, position_file, rotation_file, scale)
    success = write_file(data, destination_file)
    return success
def csv2bvh_file ( hierarchy_file , position_file , rotation_file , destination_file = None , scale = 1.0 ) : if not destination_file : bvh_file = os . path . basename ( hierarchy_file ) . replace ( '_hierarchy' , '' ) . replace ( '.csv' , '.bvh' ) destination_file = os . path . join ( os . path . dirname ( hierarchy_file ) , bvh_file ) else : if not os . path . exists ( os . path . dirname ( destination_file ) ) : try : os . mkdir ( os . path . dirname ( destination_file ) ) except OSError as exc : if exc . errno != errno . EEXIST : raise data = csv2bvh_string ( hierarchy_file , position_file , rotation_file , scale ) success = write_file ( data , destination_file ) return success
Composes BVH file from CSV input files.
Composes BVH file from CSV input files .
""" Composes BVH file from CSV input files. If no destination path is given, CSV file path is used.
    
    :param hierarchy_file: CSV file path containing hierarchy. Columns: joint, parent, offset.x, offset.y, offset.z
    :type hierarchy_file: str
    :param position_file: CSV file path to positions.
    :type position_file: str
    :param rotation_file:CSV file path to rotations.
    :type rotation_file: str
    :param destination_file: Output BVH file path.
    :type destination_file: str
    :param scale: Scale factor for root position and offset values.
    :type scale: float
    :return: Whether writing to file was successful or not.
    """ # If the specified path doesn't yet exist, create it. # Guard against race condition.
Whether writing to file was successful or not.
Whether writing to file was successful or not .
hierarchy_file
CSV file path containing hierarchy.
CSV file path containing hierarchy .
position_file
CSV file path to positions.
CSV file path to positions .
rotation_file
CSV file path to rotations.
CSV file path to rotations .
destination_file
Output BVH file path.
Output BVH file path .
scale
Scale factor for root position and offset values.
Scale factor for root position and offset values .