Unity supports FBX files which you can export from many 3D modeling applications. Use these guidelines to help ensure the best results:
In addition to these generation guidelines about exporting from 3d modeling applications, some 3d modeling applications have more specific information under these sections:
Think about what you want to export: some scene objects are essential but others may be unnecessary. Applications often let you export selected objects or a whole scene. You can optimize the data in Unity by keeping only the essential objects.
If you choose to export only specific objects in your scene, you can:
Prepare your Assets for export, using the following considerations:
|Meshes||All NURBS, NURMS, splines, patches, and subdiv surfaces must be converted to polygons (triangulation or quadrangulation)|
|Animation||Select the correct rig. Check the frame rate. Check the animation length.|
|Blend Shapes or Morphing||Make sure your Blend Shapes or Morph targets are assigned. Set up the export Mesh appropriately.|
|Bake deformers||Make sure that you bake deformers onto your Model before exporting to FBX. For example, if you are exporting a complex rig from Maya, you can bake the deformation onto skin weights before you export the Model to FBX.|
|Textures||Make sure your textures are either sourced from your Unity Project or copy them into a folder called
Note: We don’t recommend embedding textures in the FBX file using the Embed Media option. You must extract textures before using them, so embedding them just bloats your project unnecessarily and slows the import process.
|Smoothing||Verify any smoothing groups and smooth Mesh settings.
Important: Importing blendshape normals requires having smoothing groups in the FBX file.
Check your FBX export settings:
Before importing your FBX file into Unity:
Verify the size of your exported file. Perform a sanity check on the file size (e.g. >10kb?).
Re-import your FBX file into a new scene back into the 3D modeling software you used to generate it. Check to make sure it is what you expected.
To import your file into Unity, follow the instructions for Importing, keeping in mind how you set the export options in your 3D modeling software.
Unity’s physics and lighting systems expect 1 meter in the game world to be 1 unit in the imported file.
The defaults for different 3D packages are as follows:
When importing Model files into Unity from a 3D modeling application with a different scaling factor, you can convert the file units to use the Unity scale by enabling the Convert Units option.
You can use the FBX Export options to pick what to export in your FBX file.
When exporting BlendShapes (Morphing) from Maya, follow these guidelines:
When you’ve imported the file into Unity, select it in the Project view and enable Bake Animations in the Animations tab of the Model Importer.
You can create very complex character rigs in Maya. For performance reasons, Unity only supports linear blend skinning with four influences per vertex. If your character uses more than four influences, when you import the Model into Unity, the animation may appear choppy or distorted. Or if you are using deformation other than clusters, the animation may be completely absent.
To solve this problem, bake the deformation joints before exporting your Model from Maya, using the Bake Deformer tool (from Maya’s top menu: Skin > Bake Deformers to Skin Weights).
For more information, see Bake deformers on a character in the Autodesk documentation.
If you are using IK to animate your characters in Cinema 4D, you have to bake the IK before exporting using the Plugins > Mocca > Cappucino menu in Cinema 4D. If you don’t bake your IK prior to importing into Unity, you only get animated locators and no animated bones.
You can speed up file import into Unity by turning off the Embed Textures preference in Cinema 4D before you export. Check the Cinema 4D documentation for instructions.
You can use the FBX Export options to pick what to export in your FBX file.
When exporting from 3ds Max, there are some extra considerations when dealing with the following:
3ds Max’s editable Mesh always exports triangles. The Editable Poly retains quads and N-gons on import. So if you want to import quads into Unity, you have to use an Editable Poly in 3ds Max.
Follow these guidelines when you want to export bone-based animations in 3ds Max:
When exporting a bone hierarchy with Mesh and animations from 3ds Max to Unity, the exported GameObject hierarchy corresponds to the hierarchy you can see in the 3ds Max Schematic View. However, Unity uses a GameObject as the new root, containing the animations, and places the Mesh and material information in the root bone.
If you prefer to keep animation and Mesh information in the same Unity GameObject, parent the Mesh node to a bone in the bone hierarchy in 3ds Max before exporting.
Follow these guidelines when you want to export Morph targets in 3ds Max:
Unity has a built-in lightmapper, but you can also create lightmaps using texture baking (Render To Texture on the Rendering menu) feature and automatic unwrapping functionality in 3ds Max.
Usually one UV set is used for main texture and/or normal maps, and another UV set is used for the lightmap Texture. For both UV sets to come through properly, set the Material in 3ds Max to Standard and set up both Diffuse (for the main Texture)and Self-Illumination (for the lightmap) map slots:
Note: If the object uses a Shell type of Material, Autodesk’s FBX exporter does not export UVs correctly.
Alternatively, you can use Multi/Sub Object material type and setup two sub-materials, using the main texture and the lightmap in their diffuse map slots, as shown below. However, if the faces in your Model use different sub-material IDs, this results in multiple materials being imported, which is not optimal for performance.
You can access the FBX export settings window inside LightWave by selecting Save > Export > Export FBX from the File toolbar in LightWave Layout:
The Export FBX window appears.
|FBX Filename||Set the name and location of the FBX file. Use a location under the Unity
|Anim Layer||Name of the animation layer to use.|
|Type||Use Binary to reduce filesize or ASCII for a text-editable FBX file.|
|FBX Version||Select the most recent FBX version from the list, making sure that it matches the version that Unity is using.|
|Models||Export all models in the scene|
|Morphs (Blend Shapes)||Export all BlendShapes in the scene|
|Cage (Subdivision Off)||Export the object without any subdivision applied to it|
|Subdivision||Subdivide the mesh when it is exported|
|Re-parent bone hierarchy||Create a null to act as the new parent of the bone hierarchy.
When exporting a rig from Layout with the bone hierarchy parented to the mesh, the actual movement of the deformed mesh is twice what it should be. Enabling this new parent keeps the mesh in place.
|Materials||Convert LightWave’s standard Surface channels and image maps. This does not include procedural textures and nodes.|
|Embedded Textures||Save embedded Textures as image maps included directly in the FBX file instead of in a separate image directory. This creates much larger, but self-contained, FBX files.|
|Smoothing Groups||Convert LightWave’s normals into smoothing groups.|
|Collapse Materials||Collapse surfaces with identical Material names, exporting the Materials separately. However, if both Material names and all surface parameters match, the two Materials are always merged, regardless of this setting.|
|Merge UVs||Collapse multiple UV maps into a single map per object.|
|Unity 3D Mode||Correct rotation errors caused by converting between coordinate systems across LightWave, FBX, and Unity.
Both LightWave and Unity use left-handed coordinate systems but FBX is right-handed. When LightWave exports to FBX, it converts to right-handed coordinates along the Z axis. When Unity imports the FBX file, it converts back to left-handed coordinates along the X axis, which results in an apparent 180 degree rotation of the scene. Using the setting means that when you go into Unity and look down the Z axis, the imported FBX looks exactly the same as it does inside LightWave.
|Cameras||Export all cameras in the scene.|
|Lights||Export all lights in the scene.|
|Animations||Export simple animations based on movement, rotation or scaling without baking. Character animation or other animation using IK or dynamics should still be baked, using Bake Motion Envelopes.|
|Bake Motion Envelopes||Set an arbitrary start and end point for baking, in case there are setup frames you do not wish to capture. Only available if Animations is checked.|
|Start Frame and End Frame||Export data only inside this timeframe.|
|Scale Scene||Set a scale for your scene to match the Unity file scale value.|