I want to make painless FBX export buttons for the art team that enforces the required export settings.
Being used to Maya/python My first thought was to pass the export options in the button command script, but not every option seems exposed via max script.:(:
the preferred approach appears to be to keep saved presets and load them.
the MaxScript command for loading a preset is
FBXExporterSetParam "LoadExportPresetFile" <full path to preset file>
The 3ds_Max_FBX_Plug-in_Help lists the preset file locations as follows: C:\Documents and Settings<username>\My Documents\3dsMax\FBX\Presets (Windows XP)
C:\Users<username>\Documents\3dsMax\FBX\Presets (Vista)
C:\Users<username>\My Documents\3dsMax\FBX\Presets (Windows 7)
to generate the path to the preset file I came up with
--build path to preset file
fbxPresetDir="C:\Users\\" + sysInfo.username + "\Documents\3dsMax\FBX\3dsMax2013_X64\Presets\2013.1\export\\"
fbxPresetFile="User defined.fbxexportpreset"
fbxPresetPath=fbxPresetDir+fbxPresetFile
--set the preset file
FBXExporterSetParam "LoadExportPresetFile" fbxPresetPath
which seems cumbersome but successfully loads the intended preset file.
Now I’m faced with the task of distributing the preset files to the team…
all of this seems a bit cumbersome and indirect, compared to the MEL equivalent.
…am I missing a simple way to pass options to an exportFile() command?
is there a smarter way?
I also had to do this but it seems (at least in 2012) the maxscript hooks for the settings are broken - even though explicitly setting things, if the user manually sets them to something else on a manual export these settings don’t get overwritten when changed via maxscript. In the end I had to make a callback that effectively pushes all the buttons on the UI instead.
(Maya) We use two preset files that are distributed through source control to the project directories (not //user/documents…). One for animated objects, one for not-animated. After loading them, we modify a couple settings that aren’t read from the preset (bake start, bake end, etc). After export, we do any namespace modifications to the nodes in the ASCII fbx file with regex.
Turns out that the property names returned in the script listener using FBXExporterGetParam “FBXProperties”
are not the same names you must use with FBXExporterSetParam
“BakeComplexAnimation” vs “BakeAnimation” for example…fun!
for anyone keeping score, the approach suggested by Theodox & LoTekk is spot on.
I just played with this a little. I can’t seem to get ANYTHING to actually change any of the gui values. What i tried was both loading a preset as described in the first post as well as using various FBXExporterSetParam calls. When i went to export manually, the gui would not reflect any of these changes. So are they actually changed when i load a preset? (I’d be fine with loading a preset if the individual paramsetting is borked)
I’m pretty sure loading the presets is overriding what you are seeing in the gui. We have a preset for mesh and animation and they wouldn’t export properly if we relied on the gui being updated.
Hey,
so just for clarification, is there a way to check that the presets have been successfully loaded and used if it isn’t applied in GUI (except the final result mesh) ?
I’m just getting started with MaxScript (I’m a Maya guy usually), so it’s a bit premature to post. But since there’s no answer yet in this thread: isn’t the info from FBXExporterGetParam “FBXProperties” what it would take to manipulate the GUI? Doesn’t MAXscript give a way to bang on the interface elements if you have their paths?