Rhino python script set FBX Export Options



Hi, I am using Rhino python script to convert .3dm files to .fbx files by using rs.Command("_-SaveAs _-Enter", True) .

But I found that if we do it manually, there is a dialog like thisFBXExportOptions

that I don’t know how to set these option from rhino python. These settings really affect my work. Could anyone help me how to set it up by using python?

(Pascal Golay) #2

Hello - the best way to see all of the fbx command line options is to run the command straight in Rhino and then you’ll see the options and how to set them. MacroEditor is very handy for this.
For example:

! -SaveAs "C:\test\testfbx.fbx

when you run this you’ll see the options:

Export FBX Options ( ExportNurbsObjectsAs=Mesh ExportMaterialsAs=Phong ExportFileAs=Version7Binary ):

Then set these as appropriate in your script.



Hello pascal, thank you for your advice. Would you mind be more clearer?

In my python code, it is like : cmd = “_-SaveAs " + “c:/1.fbx” + " _-Enter” + " _-Enter"
rs.Command(cmd, True)

Where should I set the Export FBX Options into my code?

(Pascal Golay) #4

Hello - I don’t know what options you need but if your image above has the settings that you need then

cmd = "_-SaveAs " + "C:\Users\pascal\Desktop\Junk\junk.fbx" + "ExportNurbsObjectsAs=NURBS ExportMaterialsAs=Phong ExportFileAs=Version7Binary Enter "

Does that work?


Hi Pascal, it doesn’t work. I tried this setting and failed. Actually I need setting for ExportNurbsObjectsAs is Mesh only.

When I run this command you provided, Rhino stuck when it is launching.

Any ideas? Thank you!

(Pascal Golay) #6

Hello - I guess I am not really sure how else to help - it is pretty straightforward- run the command

-SaveAs "Path"

Just run it, typed at the command line. You will then see the options that are available at the command line - set these the way you like, then use the exact same settings when running the command in your script.



Hello pascal, that was my mistake. Your advice is totally correct. Thank you for your help!!!