export OBJ in pymel

748 views
Skip to first unread message

Justin Ball

unread,
Mar 12, 2009, 5:11:20 PM3/12/09
to python_inside_maya
Iam new to pymel and I am trying to figure out the best way to export
a obj with pymel.

The command I am trying to replitace from python in Maya is:

cmds.file("/path/to/
file",pr=1,typ="OBJexport",es=1,op="groups=1;ptgroups=1;materials=1;smoothing=1;normals=1")

I was trying things for with pymel

from pymel import *
name = "path/to/file"
type = "OBJexport"


file(name, pr = 1, type, es = 1) etc....

Which does not work.

I know pymel has certain built-ins to handle things like this.

I am assuming the saveAs() function. But I am not sure how to tailor
it to OBJ.

Any help would be greatly appreciated. I am putting together a script
to export all the geometry as separate obj's to send them to Nuke.
Not and obj sequence, but just all the geo broken into separate obj's.

Thanks

Justin

Justin Ball

unread,
Mar 13, 2009, 10:14:34 AM3/13/09
to python_in...@googlegroups.com
Sorry for the annoying post.

I got it figured out.


from pymel import * # safe to import into main namespace

name = "/path/to/filename"
obj = "OBJexport"


exportSelected(name, pr = 1, typ = obj, es = 1,

Reply all
Reply to author
Forward
0 new messages