Hey guys,
Do any of you know of any batch exporters for maya that can export out a bunch of selected files and into separate .ma files that are named what the objects were called in the outliner?
Setting up a reference library, and it'd be pretty handy. I've seen a few that will do FbX, but I need .ma.
cheers.
Replies
import maya.cmds as cmds selection = cmds.ls(sl=True) manualSave = False if len(selection) != 0: fileName = cmds.file(query=True,sn=True) if fileName == "": try: filePath = cmds.fileDialog2(fileMode=3, dialogStyle=2,caption="Scene was not saved. Select Directory to export.")[0] manualSave = True except TypeError: cmds.warning("Aborted by user.") else: filePath = fileName.rpartition('/')[0] for object in selection: cmds.select(object) if manualSave: path = "%s/%s.ma" % (filePath,object) cmds.file(path,es=True,force=True,typ="mayaAscii") else: directoryPath = "%s/Batch_Exports" % (filePath) cmds.sysFile( directoryPath, makeDir=True ) path = "%s/%s.ma" % (directoryPath,object) cmds.file(path,es=True,force=True,typ="mayaAscii") else: cmds.error("Nothing selected")Thanks a a lot for this. Before I had to export one asset at a time and it just took too long.
So awesome. Thanks again!