The trials and tribulations of Blender & Skeletal Meshes

**UPDATE - **Made a fix to the plugin that should work (see below): Dropbox - - Simplify your life

Hello Folks,
finally decided to post a thread about this after many days of frustration.
I’ll try to keep this thread updated with fixes and use it as a hub to gather all the main issues I can find about UE4 and Blender.

I’ve been using Blender and Unreal Engine and it got us through our previous game without much trouble (a mobile fighting game made with UDK). The only real issue it had back then was with an additional bone (the armature) been added upon import. Luckily a fix to the FBX plugin solved the problem.

I’ve been using UE4 since its release and been using Blender all the way.
The only main issue I found (up to Blender 2.74) was the incorrect bone scaling.
No matter the settings or scene setup, upon importing the Skeletal Mesh to UE4, the bones would be 100 times smaller than in reality, as if they weren’t scaling with everything else which was being imported correctly. While the character looks ok at a glance, this is easily recognizable by the fact that the PhAT Asset cannot be created automatically due to the bones being too small and by the fact that if you try to rotate the bones in the character editor, they would rotate by only a few degrees even if in the gizmo you’re doing whole revolutions.

This isn’t an issue until you start importing animations and your skeletal mesh gets re-scaled to 0.01. The fix I was able to find is to import the animations at 100 the scale in the import settings. This works mostly fine, with the only issue being the huge sockets (100 times their size). I’ve researched this a lot and couldn’t find two export/import settings that agree with each other.

Apparently their way of fixing this was this, which with the addition brought to the FBX i/o addon by 2.75 and 2.76, re-introduced the problem of the armature added as an additional bone.

This is where I got pretty mad.

I saw a couple of topics about the armature as a bone issue here on the forum as well on the Answer Hub but apparently most people shrugged it off, re-imported everything and went with it.

Also, the problem with the scaling wasn’t fixed, at least for me. I experience the same bone scaling issue with 2.75 and 2.76 - no matter the import/export or scene settings. I actually found a workaround that fixes the bone scaling issue but the problem of the armature as a bone remains.
The fix was rejected by the Blender dev team as it broke other stuff but it worked for me so I dusted off my limited programming skill and FileMerge and starting diff-ing the exporters from 2.74 and 2.76 to come up with a solution.

I managed to remove all the code that added the armature as a bone issue but now the workaround aforementioned wasn’t working anymore and this is where I got stuck.

To the Blender guys, this is all fine as to them, adding the armature as a bone is “not a bug” and a “more like a matter of adjusting your process”. To me, this is unacceptable.

So to sum it the two issues are:
Blender 2.74 - Bones get exported at .01 their original size, no matter the export settings. Works fine until animations are added to the mix. Workaround is importing animations scaled by 100.
Blender 2.75 & 2.76 - The armature is added to the skeleton as a bone above the root. Bones get exported at .01 their original size, no matter the export settings.

If anybody has any suggestion or possible fix I’d love to hear it.
It’s pretty frustrating to see the fbx pipeline so broken after the contribution by Epic to the Blender development and to be clear, I blame these issues on Blender and not Unreal.

Using Blender with UE4 over the last year with skeletal meshes was and still is one hell of a roller-coaster ride… Although now, thankfully, most things work.

I get your frustration, but man, Epic giving $10k to blender to work on fbx isn’t what’s going to fix things with fbx. Hell that’s barely enough to pay some programmer for a few months or maybe a medium/short contract. Don’t get me wrong I’m really happy they did, it was a very awesome and generous gesture, since it made the dev team at blender more focused on their fbx reverse-engineering*.

Blender can’t use offical fbx source because of GPL.

*In the end this is a big problem. Bastien and Team over at blender are reverse-engineering fbx… As long is this is the case we’ll never get 1:1 parity with official fbx. We’re lucky to even have what we have right now tbh considering this is not the primary focus over at Blender. I’m happy we have as much as we do even though it is frustrating a lot of times.

The only ‘maybe’ solution that I can think of is if Epic were to create their own fbx plugin for blender (distributed by epic not blender so that it doesn’t touch GPL issues)
*Ex. Like the plugins they make for Maya distributed with the engine

Thing is, I’m not even sure that is possible because of what code they would need to touch/integrate for creating an fbx exporter plugin, If it requires having blender code in the plugin then its bound by GPL so… yeah. no clue.

It’s either that or they’ll need to keep sending money to see progress. But I’m not sure how much of a priority Blender is on everyone’s list compared to the top proprietary tools.

I’ll try to help.

How to export from Blender 2.76b with correct scale settings

Set scene units to metric, 0.01 scale
Scale assets to have plausible size (eg. human should be 1.8m or so in the dimensions panel)
Apply transforms (armature and mesh should have 1.000 scale and 0m transforms and 0 degrees rotation)
Export with the binary .fbx exporter with default scale (disable add leaf bones)

How to export root motion animations made in Blender

In the dope sheet, select your root bone keyframes, copy them and then delete the keyframes
Insert a new keyframe (locrot) for the armature object in object mode on the frame of the animation
In the dope sheet, paste the keyframes
Export with the binary .fbx exporter with default scale (disable add leaf bones), also disable NLA Strips and All Actions if only exporting one animation

Now the bugs:

Apex doesn’t work for 2+ bones (reported)

I didn’t test with any older blender versions though. Guess I’ll have to do that.

I found that the older exporter from 2.75a works better than the newer 2.76 version. One thing I’ve learned the hard way is to avoid using any scaling. Make your objects actual size in Blender if you intend to export to fbx. (Remember that UE4 units are centimeters.) Scaling objects during export/import is asking for trouble. The same goes for objects that have rotations.

Fixed FBX Export Plugin (2.75b custom fixed)**: Dropbox - Error
Scene Units: Meter, Scale 0.01
Export Settings: Scale 1, Apply Unit: Unchecked, Apply Transform: Unchecked.
Works with Skeletal Meshes and Animations.

So, after doing a lot of tests, 2.75b seemed like the version that got the scaling of the bones right (I tried all the way to the latest 2.77 preview build in every possible export/scale combination and none of them worked). The problem with 2.75b was still that the armature was being added as the root of the skeleton, creating all sorts of issues. By diffing with the plugin in 2.74 I removed two lines of codes that were responsible for it. I’ll keep testing with newer versions of the FBX plugin and see if I can come up with a way to fix it on the newer plugins. Apparently they seem to be looking into it more seriously.

Does root motion work (on the root bone in pose mode) when you export your animation?

I have not tested it since our game doesn’t require it but I don’t see why it wouldn’t work. Bear in mind that skeletons exported with 2.75b (vanilla exporter) and 2.76 have the armature as an extra bone at the root. Most people saw root motion breaking because the root wasn’t the root bone anymore but was the armature object itself.

tried the 2.77 export in hope that the extra “armature” bone would be fixed but no joy, in the end i now have a workflow which should work, but it still leaves a “bone” (renamed armature) with no weights on it, i gave up hoping the blender guys would fix this issue, after a few posts back and forth i realised it was a no hope cause.

the answer is live with it or use other 3d programs. at time i do wish Epic would go bask to psk/psa exporter/importer

Have you tried my version of the 2.75 exporter? It should fix both of the problems. I’m gonna stick with that and try new releases as they come out to see if they fixed it or if I can fix it.

tbh it would help more if you could fix the current version, if i remeber rightly all i did in the older versions was to edit 2 lines that added the extra root bone, i didn’t do much with anims but i didn’t have any issues with them

It seems to be the same if you import a UE4 mannequin into Blender (no root bone as bone but the armature of the mannequin is called just root). If you rename the armature of a custom-mesh to root and don’t use any real root bone in Blender then the import looks like it should? If you need such root bone (as real bone) you could probably do something with control bones and exclude it from export as non-deform bone (as there should not be any weights to the root bone anyway). But so far I had no issue with this further “root” bone or without the root bone.

Hey folks, I fixed the exporter for 2.77 - apparently it works.
Export settings: Scale 1.00 (Apply Unit Scale set to off), DO NOT apply transforms, Armature FBXNode Type set to ROOT.

i’ll give it a go at weekend, i’ve got soo much on my plate atm hardly time to breath :frowning:

Confirmed, I’ve been using it for my projects, and it works fine :slight_smile:

ok did a very quick test and YIPPIE no armature bone on the root

fantastic job vernocchi

i’ll do a few more tests at the weekend and if all goes well i’ll do a video update with you as the main star :slight_smile:

Woot. I’m not sure if I’m ready for the fame but make sure to plug Empires Apart :smiley:
Glad that it works, folks!

ok video is up

just an issue when using the characters from UE4 eg it doesn’t work on import but as for the rest works great well done

Super awwsome, i was able to export animations B4, but then it didnt work anymore.
this works great :smiley:

Great job!
Just wanted to said that the size of mesh in animations is incorrect, if EnableRootMotion and ForceRootLock is unchecked. So don’t forget to check them.
Also there is some warnings, when I import my models, like: Imported bone transform is different from original. Please check Output Log to see detail of error. But everything works fine on the first sight, so I ignore them.

Dude, I can’t thank you enough for this fix. I’ve been tearing my hair out for hours trying to fix the extra root bone issue.