I am trying to use python or pymel to export fbx file in maya. After getting this mel script for fbx exporting, how can I transfer them to python or pymel so that I can use it in my scripted tool? Thank you!
@Anonymous wrote:
Hi Craig
That's actually what I was trying to explain, I don't think there is any documentation unless the individual developer has written some specifically.
The only way I've been able to deduce the options settable in an undocumented file translator (Such as the OBJ one for example) is by doing something like this:
1) Create some objects in your scene
2) File > Export All > [Options]
3) In the export settings you should see a section called "File Type Specific Options".
4) Perform the actual export
5) Open the Window > General Editors > Script Editor
6) Look for the export command which was called in the script history. You should see the options string in there.
For example the following setup:

Resulted in this command to be called
file -force -options "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -type "OBJexport" -pr -ea "C:/test.obj";
So we can see the options used were:
groups=1
ptgroups=1
materials=1
smoothing=1
normals=1
And by cross referencing those options with the UI we saw earlier we can quite easily figure out the options which are available.
You can do exactly the same for imports too.
As I said in my last post, there may be a better way to do this, but I don't know it. Perhaps someone else could post here if they do. But I have always been able to work with the above method anyway.
Hope this helps
Cheers
Mike
@Anonymous wrote:
Hi Craig
That's actually what I was trying to explain, I don't think there is any documentation unless the individual developer has written some specifically.
The only way I've been able to deduce the options settable in an undocumented file translator (Such as the OBJ one for example) is by doing something like this:
1) Create some objects in your scene
2) File > Export All > [Options]
3) In the export settings you should see a section called "File Type Specific Options".
4) Perform the actual export
5) Open the Window > General Editors > Script Editor
6) Look for the export command which was called in the script history. You should see the options string in there.
For example the following setup:

Resulted in this command to be called
file -force -options "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -type "OBJexport" -pr -ea "C:/test.obj";
So we can see the options used were:
groups=1
ptgroups=1
materials=1
smoothing=1
normals=1
And by cross referencing those options with the UI we saw earlier we can quite easily figure out the options which are available.
You can do exactly the same for imports too.
As I said in my last post, there may be a better way to do this, but I don't know it. Perhaps someone else could post here if they do. But I have always been able to work with the above method anyway.
Hope this helps
Cheers
Mike