I'm having trouble getting an export function to work and I'm sure I just have dumb syntax or something somewhere. Basically I'm opening an OBJ file, manipulating it, and saving it to another OBJ file. Everything works fine until the end export. Any ideas about possible syntactical issues? When I'm back at my work computer I can provide error feedback from the console if need be. Thanks for the help!
import maya.cmds as mc
#one two skip a few
#open the file
mc.file(mayaFiles[i], open = True, force = True)
#do some things to the file
#now let's save it!
mc.select( all=True )
outputDir = mc.workspace (query = True, fileRule = True)
path = "Users/MyName/MyPath/Object.obj"
mc.file(path,pr=1,typ="OBJexport",es=1,op="groups=0; ptgroups=0; materials=0; smoothing=0; normals=0")
print path;
Edit: After some ideas from @brycelynch and others, and some experimentation on my own, I'm now here with my export code:
c.select( all=True )
outputDir = mc.workspace (query = True, dir = True)
path = os.path.join(outputDir+"/objExp/","Object"+str(i)+".obj")
print outputDir
mc.loadPlugin('objExport')
mc.file(path,pr=1,typ="OBJ",es=1,op="groups=0; ptgroups=0;materials=0; smoothing=0; normals=0")
The error I currently get is:
Could not save file "/Users/myPath/objExp/Object0.obj