I’m having an issue scripting out exporting selected objects from Maya.
The first problem is, that it won’t export selected objects until I manually export selected first before running the script (If I don't run this manually first it will export out the whole scene not just the selected).
Second issue is if I export out a lot of objects from one scene, I run into the memory issue that Maya is so well known for and it ends up crashing.
Do you know of any exporting selection thru the API? I've tried MEL, Python and Pymel but they all cause the same issues (because they are all wrappers around the MEL function).
Here is some sample code I have if it helps
import pymel as pm
def exportTARGShapes(path, blendNode="blendShape1"):
if not path:
path = pm.fileDialog(m=0, dm="*.ma")
for iterator in range(numTargets):
dup = pm.duplicate("geoToExportGroup")
dup = pm.rename(dup, originalName)
pm.exportSelected("C:/Documents and Settings/user/Desktop/exportFolder/%s.ma"%originalName,
Thanks for any help.