Exporting selected objects as .fbx files

Hello,

Im trying to ease the xnormal baking process by exporting all my selected objects in a maya scene to seperate .fbx files. For each file, I’d like to use the mesh name as the file name.

If possible id also like the option to use the transform name as well? Thats the one that shows up when you select an object while the channel box is open

How might i be able ti accomplish this?

That will export all selected meshes to C:/temp folder. The filename would be the mesh transform name. How to setup FBX options.

import pymel.core as pm

selected_meshes = pm.ls(sl=True)
for mesh in selected_meshes:
    filename = 'C:/temp/{0}.fbx'.format(mesh.name())
    pm.select(mesh)
    pm.mel.FBXExport(s=True, file=filename)
1 Like