FBX Export MEL commands

The following MEL commands are used to emulate export options in the FBX export user interface.

FBXExport

FBXExport -f [filename] [-s];

Exports the specified file.

Add the -s flag if you want to change the export process so it exports the selected objects instead of an “export all” operation.

For example:

FBXExport -f myfile.fbx -s
FBXExportAnimationOnly

FBXExportAnimationOnly -v [true|false];

FBXExportAnimationOnly -q;

Use this script to export only animation. See Animation for more information.

FBXExportApplyConstantKeyReducer

FBXExportApplyConstantKeyReducer -v [true|false];

FBXExportApplyConstantKeyReducer-q;

This is the script equivalent of the Constant Key Reducer.

True
Filters FBX animation FCurves through a Constant Key Reducer. This eliminates constant keys on a FCurve and helps to reduce the size of resampled FCurves, especially Scale.
False
Setting this command to False ensures that the animation data is not filtered.
FBXExportAxisConversionMethod

FBXExportAxisConversionMethod [none|convertAnimation|addFbxRoot];

FBXExportAxisConversionMethod -q;

This command lets you set an export conversion method. See Axis conversion for more information.

None
No conversion takes place and the exported data is unaffected.
Convert animation
Recalculates all animation FCurves so their values reflect the new World system.
Add FBX_Root node
Adds a transformation node to the top of the scene to contain the transformations needed to transport the data into the new World system. This option facilitates backward compatibility as it generates the FBX file the same way as earlier releases of the plug-in.
Note: If the plug-in does not detect a need for the conversion, no Fbx_Root node is added.
FBXExportBakeComplexAnimation

FBXExportBakeComplexAnimation -v [true|false];

FBXExportBakeComplexAnimation -q;

This command is the script equivalent of the Bake animation option. See Bake Animation.

FBXExportBakeComplexEnd

FBXExportBakeComplexEnd -v [int];

FBXExportBakeComplexEnd -q;

This command is the script equivalent of the End field in the Bake animation option. The passed value is an integer number. See Bake Animation for more information.

FBXExportBakeComplexStart

FBXExportBakeComplexStart -v [int];

FBXExportBakeComplexStart -q;

This command is the script equivalent of the Start field in the Bake animation option. The passed value is an integer number. See Bake Animation for more information.

FBXExportBakeComplexStep

FBXExportBakeComplexStep -v [int];

FBXExportBakeComplexStep -q;

This command is the script equivalent of the Step field in the Bake animation option. The passed value is an integer number. See Bake Animation for more information.

FBXExportBakeResampleAnimation

FBXExportBakeResampleAll -v [true|false];

FBXExportBakeResampleAnimation - q;

This command is the script version of the Resample Animation option in the FBX Exporter. See Resample All.

FBXExportCacheFile

FBXExportCacheFile -v [true|false];

FBXExportCacheFile -q;

This command is the script version of the Geometry Cache file(s) option in the FBX Exporter. See Geometry Cache File(s).

Note: You must apply the set to the Objects Transform node and not the Shape node.
FBXExportCameras

FBXExportCameras -v [true|false];

FBXExportCameras -q;

Use this function to either include or exclude cameras in your FBX export. See Cameras for more information.

FBXExportColladaFrameRate

FBXExportColladaFrameRate [float];

FBXExportColladaFrameRate -q;

This function is the script equivalent of the Collada option.

FBXExportColladaSingleMatrix

FBXExportColladaSingleMatrix [true|false];

FBXExportColladaSingleMatrix -q;

This command is the script equivalent of the Collada Single matrix option.

FBXExportColladaTriangulate

FBXExportColladaTriangulate [true|false];

FBXExportColladaTriangulate - q;

This command is the script equivalent of the Collada Triangulate option.

FBXExportConstraints

FBXExportConstraints -v [true|false];

FBXExportConstraints -q;

Causes all the constraints defined in the Maya scene to be either included or excluded from the exported FBX file. See Constraints.

FBXExportConvertUnitString

FBXExportConvertUnitString [mm|dm|cm|m|km|In|ft|yd|mi];

This command returns the Scale Factor required to convert one centimeter to the specified unit and is the script version of the File Units Converted To menu in the FBX Exporter and Importer windows. SeeScene units converted to for more information.

FBXExportDxfTriangulate

FBXExportDxfTriangulate [true|false];

FBXExportDxfTriangulate -q;

Note: This command is for the Macintosh and Linux platforms only.
FBXExportDxfDeformation

FBXExportDxfDeformation [true|false];

FBXExportDxfDeformation - q;

Note: This command is for the Macintosh and Linux platforms only.
FBXExportEmbeddedTextures

FBXExportEmbeddedTextures -v [true|false];

FBXExportEmbeddedTextures -q;

True
Saves all textures in the FBX file. This command performs the same action as the Embed Media option in the FBX Exporter window. See Embed Media.
FBXExportFileVersion

FBXExportFileVersion -v [version];

Where [version] is the following:

  • FBX201600
  • FBX201400
  • FBX201300
  • FBX201200
  • FBX201100
  • FBX201000
  • FBX200900
See FBX Version for more.
FBXExportGenerateLog

FBXExportGenerateLog -v [true|false];

FBXExportGenerateLog -q;

Use this command to generate a log file on export. See Generate log data for more information.

FBXExportHardEdges

FBXExportHardEdges -v [true|false];

FBXExportHardEdges -q;

Duplicates all vertices in the scene's meshes for each polygon connected to them. The vertices’ normals are set accordingly, depending on whether they are connected to a hard or smooth edge.

Note: This function allows MotionBuilder to display hard edges.

If two vertices are located exactly at the same position, a warning is issued, as this causes unpredictable results when FBXImportHardEdges is set to True.

This command is the script version of the Split per Vertex Normals option in the FBX Exporter. See Include.

FBXExportInAscii

FBXExportInAscii -v [true|false];

FBXExportInAscii -q;

Use this function to export as an ASCII file. See Type for more information.

FBXExportInputConnections

FBXExportInputConnections -v [true|false];

FBXExportInputConnections –q;

Use this function to query the current value of the input connection option. The function returns 0 for False, and 1 for True.

Use this function with the FBXExport -f [filename][s] script if you are performing an export of selected objects. Set False so that the input connections to selected objects are not considered during export. The default value for this command is True, which makes the plug-in include all the objects that influence the selected ones.

This is the script equivalent of the Connections option in the UI.

Note: This command is ignored during the “Export All” process.
FBXExportInstances

FBXExportInstances -v [true|false];

FBXExportInstances -q;

This is the script equivalent of the Preserve Instances option in the UI.

FBXExportLights

FBXExportLights -v [true|false];

FBXExportLights -q;

Use this function to either exclude or include lights in the exported FBX file. See Lights for more information.

Note: This option is on by default.
FBXExportQuaternion

FBXExportQuaternion -v [quaternion|euler|resample];

FBXExportQuaternion -q;

Use the quaternion interpolation script to select how to export your quaternion interpolations from the host application.

FBXExportQuickSelectSetAsCache

FBXExportQuickSelectSetAsCache –v “setName”;

FBXExportQuickSelectSetAsCache –q;

This command stores the setName as the set to be used when exporting the cache file.

This command does not validate the received string. However, if the string used here does not correspond to an existing (and valid) set in the Maya scene, the cache export fails.

FBXExportReferencedAssetsContent

FBXExportReferencedAssetsContent -v [true|false];

FBXExportReferencedAssetsContent -q;

This command is the script version of the Referenced Assets Content option in the FBX Exporter. See Referenced Assets Content .
FBXExportScaleFactor

FBXExportScaleFactor [float];

FBXExportScaleFactor -q;

This command is the script version of the Scale Factor field in the FBX Exporter. See Scale Factor for more information.

FBXExportShapes

FBXExportShapes -v [true|false];

FBXExportShapes -q;

Use this function to either exclude or include shape deformations with your FBX file. See Deformed Models for more information.

Note: This option is on by default.
FBXExportSkeletonDefinitions

FBXExportSkeletonDefinitions -v [true|false];

FBXExportSkeletonDefinitions -q;

Use this function to either include or exclude Skeleton definition in your export.

Note: This command is the same as the deprecated FBXImportCharacter command.
FBXExportSkins

FBXExportSkins -v [true|false];

FBXExportSkins -q;

Use this function to either exclude or include skin deformations in your FBX file. See Deformed Models for more information.

Note: This option is on by default.
FBXExportSmoothingGroups

FBXExportSmoothingGroups -v true|false;

FBXExportSmoothingGroups -q;

This command is the script version of the Smoothing Groups option in the FBX Exporter. See Smoothing Groups for more information.

FBXExportSmoothMesh

FBXExportSmoothMesh -v true|false;

FBXExportSmoothMesh -q;

Use this function to export the subdivision level of the mesh.

FBXExportSplitAnimationIntoTakes

FBXExportSplitAnimationIntoTakes -q

FBXExportSplitAnimationIntoTakes -c

FBXExportSplitAnimationIntoTakes -v

This command lets you export an ainmation file into multiple takes.

FBXExportSplitAnimationIntoTakes -v
The FBXExportSplitAnimationIntoTakes -v option requires extra arguments. Its syntax is: FBXExportSplitAnimationIntoTakes -v "takename" frameStart frameEnd This sets the form "takename frameStart frameEnd" in memory. Subsequent calls to the function append new entries in the table.
For example:
  • FBXExportSplitAnimationIntoTakes -v \"toto\" 1 5
  • FBXExportSplitAnimationIntoTakes -v \"tata\" 10 25
  • FBXExportSplitAnimationIntoTakes -v \"titi\" 3 20

Internally, frames are expressed in seconds. The conversion from frame to seconds is performed using the current application framerate. After definitions are available, calling FBXExportSplitAnimationIntoTakes -q. This returns:

// Result: name=toto start=1 end=5 name=toto start=10 end=25
name=toto start=3 end=20 //
Note:
  • The accumulator is not automatically cleared, if new definitions need to be set for a second export; the caller is responsible for clearing the accumulator by calling the command using the -clear option.
  • Take001 always exists regardless of how many splits are defined.
  • Setting a frameEnd < frameStart returns an error.
  • frameStart and frameEnd do not necessarly define an interval with keys and the split function does not try to validate. If no animation keys are in the range, the take will still be created with no keys.
FBXExportTangents

FBXExportTangents -v [true|false];

FBXExportTangents -q;

This command is the script version of the Tangents and Binormals option in the FBX Exporter.

FBXExportTriangulate

FBXExportTriangulate -v [true|false];

FBXExportTriangulate -q;

This command is the script version of the Triangulate option in the FBX Exporter.

FBXExportUpAxis

FBXExportUpAxis [y|z];

FBXExportUpAxis -q;

This command lets you define the up axis in your FBX file. The up axis is the global axis that points upwards. See Axis conversion for more information.

By default, the up axis in Maya is the Y axis.

Y
Sets the up axis to Y-up. This setting is the default.
Z
Sets the up axis to Z-up.
FBXExportUseSceneName

FBXExportUseSceneName -v [true|false];

FBXExportUseSceneName -q;

This command is the script version of the Use scene name option in the FBX Exporter.