def METHOD_NAME(self):
    """Main export function."""
    NifLog.info(f"Exporting {NifOp.props.filepath}")
    # extract directory, base name, extension
    directory = os.path.dirname(NifOp.props.filepath)
    filebase, fileext = os.path.splitext(os.path.basename(NifOp.props.filepath))
    if bpy.context.scene.niftools_scene.game == 'UNKNOWN':
        raise NifError("You have not selected a game. Please select a game in the scene tab.")
    prefix = "x" if bpy.context.scene.niftools_scene.game in ('MORROWIND',) else ""
    self.version, data = scene.get_version_data()
    # todo[anim] - change to KfData, but create_controller() [and maybe more] has to be updated first
    NifData.init(data)
    b_armature = math.get_armature()
    # some scenes may not have an armature, so nothing to do here
    if b_armature:
        math.set_bone_orientation(b_armature.data.niftools.axis_forward, b_armature.data.niftools.axis_up)
    NifLog.info("Creating keyframe tree")
    kf_root = self.transform_anim.export_kf_root(b_armature)
    # write kf (and xkf if asked)
    ext = ".kf"
    NifLog.info(f"Writing {prefix}{ext} file")
    data.roots = [kf_root]
    data.neosteam = (bpy.context.scene.niftools_scene.game == 'NEOSTEAM')
    # scale correction for the skeleton
    self.apply_scale(data, round(1 / NifOp.props.scale_correction))
    data.validate()
    kffile = os.path.join(directory, prefix + filebase + ext)
    with open(kffile, "wb") as stream:
        data.write(stream)
    NifLog.info("Finished successfully")
    return {'FINISHED'}