Skip to content

Instantly share code, notes, and snippets.

@hogjonny
Last active March 11, 2016 04:44
Show Gist options
  • Save hogjonny/d3e176dda26e2407fe55 to your computer and use it in GitHub Desktop.
Save hogjonny/d3e176dda26e2407fe55 to your computer and use it in GitHub Desktop.
import maya.cmds as mc
filePath = mc.file(q=True, sceneName=True)
parentDir = os.path.abspath(os.path.join(filePath, os.pardir))
selSet= mc.ls( selection=True )
for thing in selSet:
selThing = mc.select(thing)
newFile = os.path.abspath(os.path.join(parentDir, '{0}.ma'.format(thing)))
cmds.file(newFile, type='mayaAscii', force=True, exportSelected=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment