Better Fbx Importer & Exporter

by meshonline in Scripts and Addons

Who Don't Need It?

If Blender is your only toolchain, you don't need this add-on.

Who May Need It?

Game developers

Who need to import FBX files into Blender and export FBX files to game engines.

3d digital artists

Who need to share your 3d artworks to other 3d digital artists who use other 3d softwares, or you want to sell your 3d artworks in various digital markets.

What is it?

Blender is lack of native FBX support, when we import some older and newer FBX files, it often fails.

So I made a better FBX importer and exporter with official FBX SDK from scratch.

The add-on is compatible with all FBX versions, from ASCII to binary, from FBX 5.3 to FBX 2019.

I have tested the importer and exporter with about one hundred commercial FBX files which made by 3d digital artists in 3ds Max, Maya or Cinema 4D, the add-on can import and export these FBX files successfully.

The exported FBX files have been verified in Unity Engine 2018 and Unreal Engine 4 with no issues.

Features

  • Supports Blender 2.79b and Blender 2.8.
  • Supports Blender Renderer, Cycles Renderer, and Eevee Renderer.
  • Supports N-Gons (Polygons consisting of more than 4 vertices).
  • Supports exporting smoothing groups.
  • Supports automatic bone orientation.
  • Supports armature deform animation.
  • Supports exporting non-linear animation.
  • Supports shape key animation.
  • Supports multiple material sets.
  • Supports multiple UV sets.
  • Supports multiple vertex color sets.
  • Supports meshes attach to bones.
  • Supports dummy nodes.
  • Compatible with all FBX versions.
  • Supports exporting from any generic rigging system.
  • Supports exporting retarget-able human armature from Rigify Auto-Rigging System.
  • Supports Unity Engine 2018 and Unreal Engine 4.
  • Supports Windows, Linux and macOS.
  • Limitations
  • Does not support camera.
  • Does not support lights.
  • Does not support instances.
  • Does not support mesh transform animation.
  • Does not support exporting multiple animation actions, but supports importing multiple animation actions.

Interface

Importer:

To import an FBX file, navigate to File->Import->Better FBX (.fbx).

Then you can select leaf bone style, set scale value and other parameters, select the FBX file, click 'Better Import FBX' button to import the FBX file.

Exporter:

To export to an FBX file, navigate to File->Export->Better FBX (.fbx).

Then you can select FBX version, set scale value and other parameters, enter a filename, click 'Better Export FBX' button to export to the FBX file.

Showcase

Here is an imported robot warrior in Cycles Renderer of Blender 2.79b, you may notice that his shield and weapon have already been attached to proper bones automatically, and all bones orientations have been corrected automatically, while the armature deform animation remains not changed.

Here is an imported ancient Chinese soldier in Eevee Renderer of Blender 2.80 Release Candidate, you may notice that his spear has already been attached to the right hand bone automatically, and all bones orientations have been corrected automatically, while the armature deform animation remains not changed.

Here are three characters in the Editor of Unity 2018, note that Santa's eyes, mouth and face are driven by shape key animation, and his body is driven by armature deform animation.

Here is one character in the Editor of Unreal Engine 4 v4.22.3, the scene is the famous starter scene - 'Table, Glass And Chairs', note that Santa's eyes, mouth and face are driven by shape key animation, and his body is driven by armature deform animation.

Tutorial

Basic Operation

Video Package: Download the HD version of the video(Format:zip,Size:20MB,Date:July 12,2019).

Watch Online:

Rigify Workflow

Video Package: Download the HD version of the video(Format:zip,Size:64MB,Date:July 23,2019).

Watch Online:


How To Install

The product is a zip file named 'better-fbx-addon.zip', unzip it anywhere, launch Blender, navigate to File->User Preference->Addons, click the 'Install Add-on from file...' button, a pop up dialog will appear, select 'better-fbx-addon/addon/2.7/fbx.zip', or 'better-fbx-addon/addon/2.8/fbx.zip', click the 'Install Add-on from file...' button on the pop up dialog, the addon will be installed to Blender's addons directory.

 When the pop up dialog closed, we are still on Addons page, type 'better' in the search box, two separate addons will be filter out, activate the two add-ons, then click the 'Save User Settings' button and close the 'Blender User Preference' window.

How To Upgrade

Quit Blender, unzip the latest 'fbx.zip', replace all the old files with the new files.

To find Blender's add-on directory, switch to Blender's Python Console window, type the following commands:

import bpy

bpy.utils.script_path_user()

Blender will tell you where the add-on directory is.

Supported FBX Versions

  • FBX53_MB55
  • FBX60_MB60
  • FBX200508_MB70
  • FBX200602_MB75
  • FBX200608
  • FBX200611
  • FBX200900
  • FBX200900v7
  • FBX201000
  • FBX201100
  • FBX201200
  • FBX201300
  • FBX201400
  • FBX201600
  • FBX201800
  • FBX201900

Cycles/Eevee Material

Only static diffuse image texture is supported.

In node editor, if a Cycles/Eevee material has only one static image texture node, the add-on treats it as the diffuse image texture node, you don't need to do anything.

In node editor, if a Cycles/Eevee material has more than one static image texture nodes, please follow the steps:

  1. Add a new image texture node to the node editor.
  2. Let the image texture node hold the static diffuse image texture too.
  3. Make sure that the image texture node is not connected to any other nodes.

The add-on treats the orphan image texture node as the diffuse image texture node.

If you don't add the orphan image texture node to hint which image texture represents the diffuse image texture, the add-on treats the first static image texture node it found as the diffuse image texture node.

Generic Rigging System

This add-on can export from any generic rigging system.

The exported armature is generic, is not retarget-able, because the bones hierarchy has not been configured for game engines, but the animations work properly in any game engines.

I have verified Rigify Auto-Rigging System and Auto-Rig Pro.

The exported FBX files can be imported to Unity Engine 2018 and Unreal Engine 4, and the animations work properly.

When you have finished your character, just export with this add-on, no extra setup needed.

Rigify Auto-Rigging System

There is a special gift to Rigify Auto-Rigging System.

This add-on supports exporting retarget-able human armature from Rigify Auto-Rigging System.

Retarget-able human armature means that Unity Engine 2018 and Unreal Engine 4 can recognize the human armature and map the bones hierarchy to game engine's inner bones hierarchy, you can retarget tons of animations to your armature in game engine.

When you have finished your character, just export with this add-on.

From the export interface, set 'Fix Rig' option to 'Rigify Auto-Rigging System', the add-on will export retarget-able human armature instead of generic armature.

There is also an 'Only Selected Deform Bones' option, if you enable the option, the add-on will export only selected deform bones in 'EDIT' mode.

You should not rename the deform bones, but you can delete the useless bones, and add some user defined bones.

If you rename the deform bones, the add-on can get confused, the result can be wrong.

Please refer to FAQ to learn how to setup user defined bones.

Here is a Character with Rigify Auto-Rigging System in Blender 2.79b, it does not contain any armature deform animations.

Here is the same character in Unity Engine 2018, Unity Engine recognized all bones.

Here is the same character in Unreal Engine 4, Unreal Engine recognized most bones, a few bones have been mapped to wrong bones, but it's not difficult to fix the mistake.

For your convenience, here is the right mapping.

How To Export

There are two solutions:

1. Single FBX file

You may export the rigged character, the armature and all animation actions to a single FBX file.

To achieve this, you need to concatenate all actions to one big action, select the rigged character and the 'rig' armature, from the export interface, enable 'Selected Objects' option, enable 'Only Deform Bones' option, enable 'Animation' option, then export to an FBX file.

2. Multiple FBX files

You may export the rigged character and the armature without animations, then export the animations multiple times, finally you get a separate rigged character and multiple animation files.

To export the rigged character and the armature, you need to select the rigged character and the 'rig' armature, from the export interface, enable 'Selected Objects' option, enable 'Only Deform Bones' option, disable 'Animation' option, then export to an FBX file.

To export multiple armature deform animation files, you need to select the 'rig' armature, from the export interface, enable 'Selected Objects' option, enable 'Only Deform Bones' option, enable 'Animation' option, then export to an FBX file.

Then switch to another armature deform animation action, export to another FBX file.

Repeat the above steps, until all armature deform animation actions have been exported to multiple FBX files.

The workflow of exporting multiple shape key animations is similar to the former, select the character instead of the 'rig' armature, other parameters are the same.

Unity Engine 2018 and Unreal Engine 4 can import separate rigged character and multiple animation files.

But there are slight differences between Unity Engine 2018 and Unreal Engine 4.

Unity Engine 2018 can import separate armature deform animations and separate shape key animations, then assign them to the character later.

While Unreal Engine 4 requires that you must bind an armature deform animation and corresponding shape key animation together and put them into one FBX file, when importing, they generate one mixed animation sequence, including both the armature deform animation and the shape key animation.

If the character has no shape key animations, the workflow is exactly the same as the former.

But if the character also has shape key animations, you need to select both the rigged character and the 'rig' armature, other parameters are the same.

Remember to switch the armature deform animation action and the shape key animation action together before exporting the next animation action.

Non-Linear Animation

The add-on supports exporting non-linear animation.

If there exists any NLA-Tracks in the NLA editor, the add-on will export current non-linear animation instead of original keyframe action.

If you want to export original keyframe action, you must remove all NLA-Tracks from the NLA editor, then select original keyframe action in the 'Action Editor' tab of the 'Dope Sheet Editor'.

You need not to bake animation before exporting the non-linear animation, just export when you want.

Detail Of The Parameters

The parameters in the importer:

Leaf Bone

There are two leaf bone styles - 'Long' and 'Short'.

'Long' means that the length of a leaf bone is equal to 1/1 of the length of its parent bone.

'Short' means that the length of a leaf bone is equal to 1/10 of the length of its parent bone.

The 'Long' style lets you easily select leaf bones, the 'Short' style make the armature looks more beautiful.

The default parameter is 'Long'.

Normal

'Calculate' means that we don't use imported normals, we let Blender generate normals for us.

'Import' means that we use imported normals.

The default parameter is 'Calculate'.

Auto Smooth

Auto smooth (based on smooth/sharp faces/edges and angle between faces).

The default parameter is enabled.

 

Angle

Maximum angle between face normals that will be considered as smooth.

The default parameter is 60.0 degrees.

 

Shading

How to render and display faces.

'Smooth' means that render and display faces smooth, using interpolated vertex normals.

'Flat' means that render and display faces uniform, using face normals.

The default parameter is 'Smooth'.

 

Scale

If the imported 3d model looks too small or too large, you may change the value to let it have proper size.

The default parameter is 0.01.

The parameters in the exporter:

FBX Version

You can choose your favorite FBX version.

The default parameter is 'FBX_2013_00'.

Selected Objects

When enabled, exports selected objects on visible layers.

When disabled, exports all objects in the scene.

The default parameter is disabled.

Only Deform Bones

When enabled, exports only deform bones.

When disabled, exports all bones, include IK bones, deform bones, and control bones.

The default parameter is enabled.

Animation

When enabled, exports the armature and the animation action.

When disabled, only exports the armature with bind pose.

The default parameter is enabled.

Fix Rig

When 'Rigify Auto-Rigging System', exports retarget-able human armature for Rigify Auto-Rigging System.

When 'None', exports generic armature.

The default parameter is 'None'.

Fix Hint

Describe how to setup user defined bones.

For example:

"attach ponytail.01 to spine.006; attach tail.01 to spine"

Or

"attach def-ponytail.01 to def-spine.006; attach def-tail.01 to def-spine"

You can omit the prefix of "def-", or use the exact deform bone name.

The description is case insensitive, use semicolon to separate multiple descriptions.

Only Selected Deform Bones

When enabled, exports only selected deform bones in 'EDIT' mode.

When disabled, exports all deform bones.

The default parameter is disabled.

Max Bone Influences

Maximum bone influences you can have per vertex.

4: Suitable for mobile game.

8: Suitable for desktop game.

Unlimited: Suitable for generic animation.

The default parameter is Unlimited.

Scale

If the exported 3d model looks too small or too large, you may change the value to let it have proper size.

The default parameter is 100.0.

License

The license of this add-on is "GPL".

The add-on does not interact with FBX SDK, instead, it interacts with a universal text format I invented, which is elegant and plug-in friendly, supports all 3d softwares.

The product package also includes an external command-line utility, which interacts with the universal format, and convert it to FBX format, or vise versa.

The external command-line utility is written in c++, which links to FBX SDK to generate the binary file.

The add-on uses the external command-line utility via a simple system call.

The external command-line utility respects Autodesk FBX SDK license, which requires the developer to put the following statement in the online document.

"This software contains Autodesk® FBX® code developed by Autodesk, Inc. Copyright 2014 Autodesk, Inc. All rights, reserved. Such code is provided “as is” and Autodesk, Inc. disclaims any and all warranties, whether express or implied, including without limitation the implied warranties of merchantability, fitness for a particular purpose or non-infringement of third party rights. In no event shall Autodesk, Inc. be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of such code."

Change Log

[2019-11-11]

Fix importing error when normals are per vertices.

Fix flipped normal issue when calculated by Blender.


[2019-11-06]

Mark sharp edges.


[2019-11-05]

Fix 'Imported Normals' bug.


[2019-10-10]

Fix 'Found the same (BMVert) used multiple times' bug.


[2019-10-07]

Fix a potential bug of node editor.

Add 'Auto Smooth', 'Angle' and 'Shading' option.

Import to active collection in Blender 2.8.


[2019-10-06]

Release version 2.0.

Supports dummy nodes.


[2019-09-30]

Add 'Max Bone Influences' option.


[2019-09-26]

Fix 'face already exists' bug.


[2019-09-17]

Supports NLA animation.


[2019-08-10]

Fix code-sign issue on macOS.


[2019-08-08]

Export bind pose for meshes.

Export relative path for textures.


[2019-08-05]

Fix face map singleton bug in Blender 2.8.

Fix base color bug for Cycles Renderer and Eevee Renderer.


[2019-07-31]

Fix a bug when 'Only Selected Deform Bones' is enabled and 'Animation' option is disabled at the same time.


[2019-07-30]

Add 'Only Selected Deform Bones' option.

Fix wrong user defined bones function name in Blender 2.8.


[2019-07-28]

Fix type annotation warning in Blender 2.8.


[2019-07-27]

Fix a bug when exporting only parts of deform bones.


[2019-07-26]

Change license to 'GPL'.


[2019-07-25]

Add 'Fix Hint' option.

Add missing eyes bones.


[2019-07-24]

Initial version.