options for cmds.file()

1,148 views
Skip to first unread message

cspears

unread,
Apr 24, 2015, 8:37:41 PM4/24/15
to python_in...@googlegroups.com
I'm trying to debug some code that uses cmds.file(), and I am confused about the options flag.  According to the documentation, the options flag is used to set file options.  All of the examples look like this:

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

However, I have been looking on the web all afternoon for a list of options I can pass to 'op', and I cannot find anything. Can someone point me in the right direction? I am specifically looking for what the 'time' option does.

Thank You!

Paul Molodowitch

unread,
Apr 24, 2015, 8:47:26 PM4/24/15
to python_inside_maya
Unfortunately, I don't think that's well documented anywhere - what can go in there is dependent on each particular file type / plugin.

I usually just try to play with values in the export UI, and see what gets spit out in the script editor, and can generally figure it out from that.  Alternatively, if you have the source code for that file exporter plugin, you can check that; though, unless it's included as an example/reference in the sdk, don't think we do for the obj exporter....

- Paul

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8a943302-c6e8-4ed0-9906-f14a4f1404a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Spears

unread,
Apr 24, 2015, 8:57:11 PM4/24/15
to python_in...@googlegroups.com
I was afraid of that.  My issues are centered around importing a file.  Your advice is solid.  I'll poke the Import UI and see what happens.

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/JiX_CuUIdjI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAssL7ah5NhNZSd8WW_8hoQUY%3D56TR9zeVTQXgDdYH3kdr5KzA%40mail.gmail.com.

Joe Weidenbach

unread,
Apr 25, 2015, 10:52:26 AM4/25/15
to python_in...@googlegroups.com
Well, I can't speak for obj, but I have worked with similar for an fbx exporter script. I had to use MEL to do it, as the module wasn't available in Python.

FBX has a Mel interface to set its options up, but each module is slightly different.  I can speak to that one from experience, and probably give some advice, if you're working with FBX.

For OBJ, it stores the preferences in the OBJexportOptions optionvar.  And, just like you showed, it's a string: "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1".  The file that controls that interface is objExportOptions.mel in your Maya Install Directory, scripts/other/objExportOptions.mel.

I did find a howto here: http://ewertb.soundlinker.com/mel/mel.068.php

Basically, though, as stated, it looks to be based on each available plugin, and each one's slightly different.  The options var basically passes a string of options on to the specified export plugin.

For more options, visit https://groups.google.com/d/optout.




This email is free from viruses and malware because avast! Antivirus protection is active.


Reply all
Reply to author
Forward
0 new messages