The following MEL commands are used to emulate import options in the FBX importer user interface.
If you are writing a script and want to prevent the FBX UI from appearing each time a file is imported, use the following command to suppress the FBX UI on import:
FBXImport -file "c:/myfile.fbx";
FBXImport -f [filename] -t [take index];
Imports the file specified in [filename] and the take specified in [take index].
The file imported is the one accessible for take querying after the execution of the command.
Specify the appropriate take number to load the corresponding take. If you specify 0, the plug-in imports no animation. (This is the same as if you select No Animation from the menu in the Maya FBX plug-in user interface.)
FBXImportAxisConversionEnable -v [true|false];
FBXImportAxisConversionEnable -q;
This command is the script version of the Axis conversion option in the FBX Importer. See Axis conversion for more information.
FBXImportCacheFile -v [true|false];
FBXImportCacheFile -q;
This command is the script version of the Import geometry Cache file(s) option in the FBX Importer. See Geometry cache file(s) for more information.
FBXImportCameras -v [true|false];
FBXImportCameras -q;
Use this script to either import or exclude cameras with your FBX file. See Cameras for more information.
FBXImportConstraints -v [true|false];
FBXImportConstraints -q;
Causes all constraints defined in the FBX file to be ignored by the importing process and excluded from the Maya scene. See Constraints for more information.
FBXImportConvertDeformingNullsToJoint -v [true|false];
FBXImportConvertDeformingNullsToJoint -q;
Converts deforming elements into Maya joints.
See Deforming elements to joints for more information.
FBXImportConvertUnitString [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. See File units converted to for more information.
FBXImportDxfWeldVertice [true|false];
FBXImportDxfWeldVertice -q;
FBXImportDxfReferenceNode [true|false];
FBXImportDxfReferenceNode -q;
FBXImportDxfObjectDerivation [layer|entity|block];
FBXImportDxfObjectDerivation -q;
FBXImportFillTimeline -v [true|false];
FBXImportFillTimeline -q;
Fills the scene timeline on import (instead of using the Maya default).
FBXImportForcedFileAxis [y|z];
FBXImportForcedFileAxis -q;
Use this command to "force" the FBX plug-in to consider the data in the file as if it is natively generated with the user-specified axis. There is no UI equivalent to the FBXImportForcedFileAxis command, and it can produce unexpected results as the command changes only the incoming file axis in the global settings.
For example, a plane created in 3ds Max's Z-up world would have the following vertex coordinates: (0,0,0) - (1,0,0) - (1,0,1) - (0,0,1). (This plane would look like a sheet of paper on a table, with the table being the XY plane at Z = 0 elevation.) On import into Maya, using the FBXImportUpAxis option, the plane would rotate so that the it would appear to be in the same position in Maya as it is in 3ds Max. Therefore, in Maya, the plane is on the XZ plane with the Y = 0 elevation. (Provided Maya is set to the default Y-Up axis.)
If you use FBXImportForcedFileAxis to force the axis to Y-up on import, the Maya plug-in will NOT apply any conversion to the axis. This is because, with this command, the plug-in treats the File and the System axis both as Y-Up, making the plane becomes perpendicular to the table, on the XY plane with Z = 0 depth.
FBXImportGenerateLog -v [true|false];
FBXImportGenerateLog -q;
Use this command to generate a log file on export. See Generate Log Data for more information.
FBXImportHardEdges -v [true|false];
FBXImportHardEdges -q;
Merges back all vertices located at the same exact position as a unique vertex. The Maya FBX plug-in then determines if the edges connected to each vertex are hard edges or smooth edges, based on their normals.
Use this function when FBXExportHardEdges is set to True on export.
This command is the script version of the Combine per-vertex Normals option in the FBX Importer. See Combine per-vertex Normals for more information.
FBXImportLights -v [true|false];
FBXImportLights -q;
Use this function to either include or exclude lights from the import process. See Lights for more information.
FBXImportMergeBackNullPivots -v [true|false];
FBXImportMergeBackNullPivots -q;
The pre-rotation and post-rotation nodes are then deleted.
The look-up is done by name as the pre-rotation node's name contains the “__Pre_ “suffix, while the post-rotation node's name has a “__Post_” suffix.
FBXImportMergeAnimationLayers -v [true|false];
FBXImportMergeAnimationLayers -q;
Activate Bake animation layers to bake (or Plot) animation layers contained in the incoming file.
FBXImportMode -v [exmerge|add|merge;]
FBXImportMode -q;
This command has three possible states:
Nodes of the same name and nature have only their animation curve replaced. No new nodes are created. This command is the same as the Update animation option in the plug-in UI.
FBXImportProtectDrivenKeys -v [true|false];
FBXImportProtectDrivenKeys -q;
Use this script to prevent any incoming animation from overwriting channels with driven keys.
If set to True, the driven keys are protected and no incoming animation is applied to the driven channels.
If set to False, the driven keys are discarded and the incoming animation is applied to the driven channels. See Protect Driven Keys for more information.
FBXImportQuaternion -v [quaternion|euler|resample] ;
FBXImportQuaternion -q;
Lets you specify how quaternion rotations should be treated on import into Maya. This option compensates for differences between Maya and MotionBuilder quaternions. This command is the equivalent of the Quaternion interpolation mode settings. See Quaternoin interpolation mode for more information.
FBXImportResamplingRateSource -v [Scene|File|Custom];
FBXImportResamplingRateSource -q;
This command lets you set the rate that the FBX Importer uses to produce keyframes when it needs to resample data. Use Scene to use Maya's current working units (See Working Units in the Preferences window Settings area), File to use the sampling rate defined by the FBX file, or Custom to specify a self-defined value.
Resampling is used when the interpolation of the Maya animation curve cannot be accurately represented by curves in MotionBuilder.
FBXImportScaleFactorEnable [true|false];
FBXImportScaleFactorEnable -q;
FBXImportScaleFactor [float];
FBXImportScaleFactor -q;
FBXImportSetMayaFrameRate -v [true|false];
FBXImportSetMayaFrameRate -q;
This command lets you import the frame rate from the FBX file. This overwrites the rate used in Maya.
FBXImportSetLockedAttribute -v [true|false];
FBXImportSetLockedAttribute -q;
This command is the scripting equivalent of the UI dialog box Keep all locked or unlock all options. Use this command when you import an FBX file that contains animation onto an object that has locked channels.
When you use the UI, the Maya FBX plug-in prompts you to either keep all the channels locked or unlock the locked channels, which imports the animation correctly. This had created problems for users who tried to do this without working in the UI.
FBXImportSetLockedAttribute -v False;
FBXImport -f "C:/myFile.fbx";
FBXImportShapes -v [true|false];
FBXImportShapes -q;
Use this script to import or exclude shapes from your FBX file. See Deformed models for more information.
FBXImportSkeletonType -v [none|fbik|humanik];
FBXImportSkeletonType -q;
Use this function to either import or exclude Skeleton definitions with your FBX file. See Skeleton Definitions As for more information.
FBXImportSkins -v [true|false];
FBXImportSkins -q;
Use this function to import or exclude skin deformations from your FBX file. See Deformed models for more information.
FBXImportUnlockNormals -v true|false;
FBXImportUnlockNormals -q;
Overrides the default Maya locking of normals.
FBXImportUpAxis [y|z];
FBXImportUpAxis -q;