How to export file to recent folder?

Hello, developers! I’m trying to export fbx file by my script, but export window appears with picked blend file folder instead of last recent one. I can’t handle how to tell script to select recent folder. If somebody can help me I will be happy)

My script

class Retarget_OT_Export_Operator(bpy.types.Operator):
    """Export character to fbx"""
    bl_idname = "retarget.export_operator"
    bl_label = "EXPORT"

    def execute(self, context):

        #Define fbx name
        filename = ""
        if animtrack.mute == 0:
            filename = rig.animation_data.nla_tracks["ANIM"].strips["ANIMATION"]
        if animtrack.mute == 1:
            if rig.animation_data.action:
                filename =
            else: filename = "!NO ANIM DATA!"

        char_mesh =['RETOP']
        for obj in char_mesh.objects:
        bpy.ops.export_scene.fbx('INVOKE_DEFAULT', filepath=filename, use_selection=True, object_types={'ARMATURE', 'MESH'}, mesh_smooth_type= 'FACE', add_leaf_bones = False, use_armature_deform_only = True, bake_anim = True, bake_anim_use_all_bones = True, bake_anim_use_nla_strips = False, bake_anim_use_all_actions = False, bake_anim_force_startend_keying = False, bake_anim_step = 1.0, bake_anim_simplify_factor = 0.009999999776482582, path_mode = 'AUTO', embed_textures = False, batch_mode = 'OFF', use_batch_own_dir = True, axis_forward = '-Z', axis_up = 'Y')
        return {'FINISHED'}

def register():

def unregister():

if __name__ == "__main__":

Maybe it will be useful for you:
a little addon I updated for one person with defining a path for export fbx files


1 Like

Thanks for this! It’s interesting way but I still try to kick my goal)