It’s been a long time since I’ve tried, but I could never get the PyMel version to work. Just used the MEL command as a string wrapped up by eval or something.
It is not surprising that this command doesn’t work with PyMel or maya.cmds. Its not an official part of maya’s core. Its an external plugin that was integrated. As with an external plugin, its hit-or-miss how well it integrates into maya.
i tried using the fbx splugin properly and never could get it to fly. I ended up just using the FBXExport as mentioned. Was this a half assed plugin or half assed documentation?
I think using the long keyname is probably breaking your original example.
The actual FBXExport mel command only has the short flags, and the pymel mel wrapper is pretty simple, and just does a simple change of key=value into -key value
mel command:
FBXExport -f [filename] [-s];
If you want to export with a bunch of options, you’d do something like this
Another question:
Everything is working for me (the FBX files are created in the way I want them created).
But… I get an error:
// Error: line 1: Cannot find procedure “OneClickGetContactingAppName”. //
…which also brings up the Stack Trace window.
I can just supress that error message ofc, but I would like to know why the heck Im getting that false-positive error.
EDIT: Can’t even supress it.
Tried pm.scriptEditorInfo(suppressErrors=True) and I still get the error in the script line + stack trace window
I’ve never gotten that particular error before.
The command looks like it should be tied to the OneClick plugin, but in my Maya 2014 install it isn’t listed as a command on the plugin info panel.
However in 2015 that command does exist on the plugin, and I do get that error if the plugin isn’t loaded. Re-enabling the plugin caused the error to stop, so hopefully that works for you.
So that’s fun, looks like FBXExport has a dependency on OneClick in 2015.
[QUOTE=R.White;25946]I’ve never gotten that particular error before.
The command looks like it should be tied to the OneClick plugin, but in my Maya 2014 install it isn’t listed as a command on the plugin info panel.
However in 2015 that command does exist on the plugin, and I do get that error if the plugin isn’t loaded. Re-enabling the plugin caused the error to stop, so hopefully that works for you.
So that’s fun, looks like FBXExport has a dependency on OneClick in 2015.[/QUOTE]
Great! Activating that plugin in 2015 gets rid of that annoying error message!
FWIW I think that cmds generates a wrapper for the plugin mel commands if they use an MSyntax internally to parse their arguments and flags (I think that’s what MPXCommand.hasSyntax() is there for). However if you just roll your own and interpret the MArgList directly in your doIt() method, cmds doesn’t know what to do. So I think FBX is doing it the lazy way, which is why it works with the string series (“-f”, “filename”) but not the usual f=filename.
I didn’t realize until I looked into this recently that cmds automatically creates a wrapper for all plugin-derived mel at startup (subject to the note above). So, you can call cmds.FBXExport() or whatever but there’s a certain level of randomness in how complete the automatic wrapper is.