FBX General MEL commands

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

FBXClose

FBXClose;

Closes the FBX importer so that any FBX files launched with the FBXRead command are unlocked.

When you use the FBXRead command, it opens and locks the FBX file. To release the file, you must either call the FBXClose command, or use call commands that open a new file, for example, FBXRead or FBXImporter, and so on.

FBXExtPlugin

FBXExtPlugin -l;

FBXExtPlugin <pluginName> [-q] -state [on|off];

FBXExtPlugin <pluginName> [-q] -opts [optionsString];

FBXExtPlugin lets users list, enable, disable, and pass options to FBX extension plug-ins.

The state and options are stored in memory and not in the FBX files. They will remain set until another call to FBXExtPlugin changes them.

The option string is a single, double-quote-enclosed string. The syntax of the options passed to the extension plug-in is determined by the extension plug-in it is being passed to. This means that you will need to consult the extension plug-in's documentation to determine option names and value separators. If the option string is too long, it will be truncated.

Use FBXExtPlugin -l to output the list of installed extension plug-ins.

Use FBXExtPlugin <pluginName> -q -state to query the state of a specific extension plug-in.

Use FBXExtPlugin <pluginName> -state [on|off] to enable or disable an extension plug-in.

Use FBXExtPlugin <pluginName> -q -opts to query the options passed to an extension plug-in.

Use FBXExtPlugin <pluginName> -opts <optionsString> to pass options to the extension plug-in.

Note: Consult the FBX Extension SDK package for more information about extension plug-ins.
FBXGetTakeComment

FBXGetTakeComment [index];

Returns the comment attached to the take at the specified index in the take array. This command uses the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

Note: You must enter numbers from 1 to the number of takes contained in the file otherwise the script returns the message: No such take. The Maya FBX plug-in considers any number of takes greater than the amount of takes in the file, negative values, or zero, to be invalid.
FBXGetTakeCount

FBXGetTakeCount;

Returns the number of takes saved in the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

Note: If the Maya FBX plug-in does not find any takes in the file, the script returns a value of 0.
FBXGetTakeIndex

FBXGetTakeIndex [take name];

Returns the index of the first take named as the parameter in the take array. This command uses the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

Note: If [take name] does not contain a valid name, the script returns the message: No such take.
FBXGetTakeLocalTimeSpan

FBXGetTakeLocalTimeSpan [index];

Returns the local start and stop time of the take at the specified index in the take array. This command uses the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

Note: You must enter numbers from 1 to the number of takes contained in the file, otherwise the script returns the message: No such take. The Maya FBX plug-in considers any number of takes greater than the amount of takes in the file, negative values, or zero, to be invalid.
FBXGetTakeName

FBXGetTakeName [index];

Returns the name of the take in the take array's specified index. This command uses the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

FBXGetTakeName [index];

Note: You must enter numbers from 1 to the number of takes contained in the file otherwise the script returns the message: No such take. The Maya FBX plug-in considers any number of takes greater than the amount of takes in the file, negative values, or zero, to be invalid.
FBXGetTakeReferenceTimeSpan

FBXGetTakeReferenceTimeSpan [index];

Returns the reference start and stop times of the take at the specified index in the take array. This command uses the file stored in the file buffer.

You can load a file into the file buffer with the FBXRead command.

Note: You must enter numbers from 1 to the number of takes contained in the file, otherwise the script returns the message: No such take. The Maya FBX plug-in considers any number of takes greater than the amount of takes in the file, negative values, or zero, to be invalid.
FBXLoadExportPresetFile

FBXLoadExportPresetFile -f [filepath];

Sets the export preset file path.

FBXLoadImportPresetFile

FBXLoadImportPresetFile -f [filepath];

This command lets you set the import preset file path.

You can use this to load the MotionBuilder Import presets without knowing their file path.

For example: FBXLoadMBImportPresetFile; loads "C:\<maya version>\bin\plug-ins\FBX\Presets\<version>\import\Autodesk MotionBuilder.fbximportpreset" (The path may be different on your machine.)

FBXLoadMBExportPresetFile

FBXLoadMBExportPresetFile

This command loads the MotionBuilder presets provided with each release.

You can use this to load the MotionBuilder Import/Export presets without knowing their file path.

For example: FBXLoadMBExportPresetFile; loads "C:\<maya version>\bin\plug-ins\FBX\Presets\<version>\export\Autodesk MotionBuilder.fbxexportpreset" (The path may be different on your machine.)

FBXLoadMBImportPresetFile

FBXLoadMBImportPresetFile

This command loads the MotionBuilder presets provided with each release.

You can use this to load the MotionBuilder Import/Export presets without knowing their file path.

For example: FBXLoadMBImportPresetFile; loads "C:\m<maya version>\bin\plug-ins\FBX\Presets\<version>\import\Autodesk MotionBuilder.fbximportpreset" and FBXLoadMBExportPresetFile; loads "C:\<maya version>\bin\plug-ins\FBX\Presets\<version>\export\Autodesk MotionBuilder.fbxexportpreset" (The path may be different on your machine.)

FBXPopSettings

FBXPopSettings;

This setting loads all settings that were saved by the Pop script; it preserves the current state of the settings when you perform a One-Click operation.

FBXPushSettings

FBXPushSettings;

This setting saves all I/OSettings. Use FBXPushSettings to preserve the current state of the settings when you perform a "Send To" operation.

FBXRead

FBXRead -f [filename];

Reads the specified FBX file without importing anything into Maya. The file is instead stored in a buffer. This command is used for take querying.

Once read or imported, use the commands FBXGetTakeCount, FBXGetTakeName, FBXGetTakeIndex for take querying.

Note: The file you are reading must match an existing file name, otherwise the file in the buffer is destroyed if you attempt to read or import a non-existent file.
FBXResetImport

FBXResetImport;

This command restores the default values of the FBX Importer and loads settings specified in the Autodesk Media & Entertainment import preset , as in UI. See import Presets in the FBX Import options topic for more information.

FBXResetExport

FBXResetExport;

This command restores the default values of the FBX Exporter and loads settings specified in the Autodesk Media & Entertainment export preset. See Export Preset Options in FBX Export options for more information.

FBXResamplingRate

FBXResamplingRate -v [float];

FBXResamplingRate -q;

Sets the rate at which the exporter produces keyframes when it needs to resample data.

Resampling is needed when the interpolation of the Maya animation curve cannot be perfectly represented by curves in MotionBuilder.