Last updated: September 04, 2017

As of Unreal Engine 4.16, this is no longer needed.

From the Unreal Engine 4.16 Release Notes :

  • New: The FBX importer updates:
    • Now imports collision models under the FBX LOD Group.
    • Now applies the transform from FBX options only one time for the whole import.
    • When importing an FBX file from Blender, the importer now removes the root node name “armature.”
    • No longer removes the socket created in UE4 Editor when using reimport. If affects only imported socket.

“The more things change, the more they stay the same.”
–Snake Plissken

Yeah, I know… some dead-French guy said it first, but I remember it from the end of Escape from L.A.
Get over it.

Blenders FBX exported has gotten a lot better… and yet, it still adds the extra root bone.

This tutorial will show you what to change in order to fix this.

Tools used:

Blender 2.78a.
Unreal Engine 4.13.
UE4 Tools Addon

The file we will be going to edit


C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_scene_fbx\export_fbx_bin.py

Before you begin:

  • Create a backup of the file.
  • Get a decent text editor.
    For Windows, I recommend Notepad++.
  • Run your text editor in admin mode.

Instructions:

  1. Find the following:
    
    
                elif ob_obj.type == 'EMPTY' or ob_obj.type == 'ARMATURE':
                    empty_key = data_empties[ob_obj]
                    connections.append((b"OO", get_fbx_uuid_from_key(empty_key), ob_obj.fbx_uuid, None))
    


    For me, it was around line 2465.

  2. Comment out these lines:
    
    
    #            elif ob_obj.type == 'EMPTY' or ob_obj.type == 'ARMATURE':
    #                empty_key = data_empties[ob_obj]
    #                connections.append((b"OO", get_fbx_uuid_from_key(empty_key), ob_obj.fbx_uuid, None))
    

  3. Save the file.
  4. Restart Blender.
  5. Export as usual.

Example:

I installed the UE4 Tools Addon by Luis Garcia and used the “Append Hero RIG!” button to add a UE4 Mannequin to the scene.

I then extruded two new bones – item_r & item_l – and added them to the EpicExtra bone group.

Result in blender:
ue4fixextraroot_inblender

After this, I selected everything and clicked the “Export Character” button and imported the result into UE4.

Result in editor:
ue4fixextraroot_ineditor

Enjoy!

Advertisements

6 thoughts on “Prevent Blender FBX Exporter adding extra root bone

    1. Sweet fix, except it doesn’t work when it comes to exporting skeleton and animations from Blender. This is what’s happening:

      Any idea how to fix exporter where Armature doesn’t get exported as root of the hierarchy and at the same time scale is maintained when anims are exported too ?

      Thanks beforehand

      1. I’ve had that issue before, but do not remember the exact cause or fix.
        Something to do with not applying the scale correctly.

      2. I had a similar issue, to fix, I just set the unit length in the scene tab to metric and unit scale to 0.01 then set the clip end in the “n” toolbar to 10km. Make sure all transforms are applied, and this should work as long as your root bone’s scale is 1 in pose mode, and edit mode just for safety.

      3. Also, to keep scale from before after changing the unit scale, just scale your object in object mode by 100 and reapply the transforms again.

      4. I think the reason for this is because 1 blender unit is 1 meter, and this is respected by UE4 for general object scale, but a scale of 1 on the root bone is seen as 1 centimeter, the UE4 standard, so all animations are scaled down by 100. The fix ought to be setting everything in blender to the 1 centimeter default.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s