FBX batch exporter

If anyone else needs it, it exports each selected object as a seperate FBX file:


import bpy

filePath = "G:\\!GDG\\art\\!GoHere\\Crate\\Standard\\"

#concatenate subfolder
PathSubFolder = "Crate_Baking_Low\\"
print (filePath)

#cache the objects that are active in the scene
activeObs = bpy.context.selected_objects

 #deselect everything
bpy.ops.object.select_all(action='TOGGLE')


for i in activeObs:
 
    #assign all selected scene objects to context
    bpy.context.scene.objects.active = i
    
    obName = bpy.context.scene.objects.active.name
    print(obName)   
    
    i.select = True
    
    #write the files
    bpy.ops.export_scene.fbx(filepath = filePath + PathSubFolder +obName  + ".fbx", use_selection = True)
       
    #deselect everything
    bpy.ops.object.select_all(action='TOGGLE')