Blender to Unreal: fbx ASCII vs. Binary, problems with root motion for both

(More recent post to Unreal Animation Forum can be found at [this link][1]. If looking to help or find information, that’s probably a better place to check.)

I’ve been trying very hard for the past few months to get something with root motion to import successfully from Blender to UE4, but with little success. After trying many different things to get some models in, I finally decided to make the least complicated model I could, just to try and figure out how to get things to work. Here are the results:

First, my model in Blender. About as simple an armature model as possible, with only two bones, and a three frame forward walk animation.

47575-blenderarmature.png

This is with units in Blender set to metric, with a scale of 0.01, which has been (ctrl-a) applied to both the armature and the mesh. I exported an fbx two times, once using 7.4 binary, and once using 6.1 ASCII, with the rest of the settings like so:

ASCII:
This version imported seemingly nicely into Unreal. However, when turning on root motion, regardless of which Root Motion Root Lock option I choose, the forward animation “snaps” back into place after moving, rather than continuing forward like it should.

47577-unrealarmatureascii.png

Binary:
This version imported at 100x larger than it should’ve. However, when selecting root motion in the animation view, it correctly moved forward, though the correct speed was 100x too slow relative to its body. Also, when actually playing the game, the character did not move at all, despite being set to use the animation asset.

47578-unrealarmaturebinary.png

I’m honestly running out of steam here. I’ve been searching for quite a while, and to no avail. Anyone have any thoughts?

Also, in case anyone is interested, here are some of the similar problems I’ve been having, which are also unresolved, the first one especially being very related to this:

Thanks, y’all!

~Trekopep

Hi

Your export settings are possibly one part of the error here. Change your export settings to match this:

Additionally, ensure that you have zero’d out the starting pose so that the bones import correctly. Finally, depending on which blender version you are using you may be running into several known issues. Try using 2.74 or 2.75 rc for decent FBX export results.

Hi !

Yup, I forgot to put that I’m using Blender 2.74, so that should be fine.

After exporting using the exact settings you provided (I’m assuming the scale was the real problem; I still don’t really understand what “applying” transformations and such does in Blender), I got a nice little walking box-creature root-motion animation. However, I am unsure how to get this from the animation into the actual game, and therefore have several questions which have plagued me for quite some time.

In order to apply root motion to an actor:

  1. Does the actor need to be a blueprint?
  2. If so, does the blueprint need to have “Character” as a parent, with Character MovementMode set to walking (as was told to me in one of the originally provided links)?
  3. Does the actor need to have an animation blueprint, or can root motion work through a simple animation asset?

And if those are all the case, why is it that way?

I have yet to get the root motion to show up in the actual game (though in the animation window with Show → Process Root Motion checked, it looks perfect). I am going to post this now, as Unreal has crashed several times on me (once, my computer even restarted; my computer doesn’t particularly like Unreal…). If I make any more progress, I’ll post it here.

Hi

If you could, please make a separate post for your crashes. the primary reason for this is so that, if other developers are experiencing the same type of error we can better assess the situation and gather information from multiple perspectives, which often helps to identify the root of the problem. Additionally, for animation, I would highly recommend our documentation, we have a lot of information on animation and blueprints here: Skeletal Mesh Animation System in Unreal Engine | Unreal Engine 5.1 Documentation

,

I’m not particularly concerned about the crashes, as it’s probably more my computer needing more RAM than anything else.

However, as far as animation goes, perhaps I simply haven’t looked in the right spot yet, but I haven’t been able to figure out how to get root motion to work.

Unreal has great documentation, and this article on root motion (which I have read numerous times) was no exception.

However, it still does not answer my questions. As it was written when AnimMontages were still necessary for root motion, I am unsure in what situations root motion now applies. The only clue I have is the following: “To fully utilize Root Motion, your character will need an Animation Blueprint”, which I cannot decide whether it means an Anim Blueprint is necessary, or that it is simply very useful in most situations.

Again, in the animation tab with “Process Root Motion” checked, everything looks wonderful, but I cannot figure out how to transfer this to in-game. I have tried making my Actor into a blueprint, giving it an Animation Blueprint, and having it extend Character with MovementMode set to both “walking” and “flying”, all to no avail.

I appreciate your help!

Hi

The animation specific questions would probably be best answered in the animation section of the forums at forums.unrealengine.com. We have a large and extremely talented community who are often more than willing to help in situation such as this!

Duly noted! I’ll report back to this post if I find a solution.

Hi,I had similiar problem.
ASCII works best for me but if you use ASCII it will create another bone and that new bone is your new root bone and it is probably called Armature.

The reason why your model is not using root motion is because of that new bone.

Fix:
To fix this problem is easy.

You probably moved your model in pose mode with your real root bone but as I said before ASCII is adding this new bone called armature becouse of that you need to go to object mode and select your armature/sceleton and move it only in object mode.

I hope it helps :slight_smile:

  • Blue

After following these and other leads I finally found a workaround. My Blender to UE4 pipeline finally works!

The main key difference to what you did is, I used an ACharacter as the base of my animated object, instead of just dropping the Animation Blueprint on the scene. From this ticket you commented on: https://answers.unrealengine.com/questions/227087/root-motion-seen-by-unreal-but-not-applied.html

Here’s all the steps, and maybe it will show why this really needs some work:

In Blender

  1. Before doing anything, set the scale to Metric 0.01. If you already had stuff, scale it up by 100 and apply scale.

70222-blender1.jpg

  1. Don’t animate root motion in the root bone in pose mode. Animate the entire Armature in object mode for all root motions. This is because there is a flaw in Blender’s FBX exporter that exports the Armature as the root bone. Setting the root bone to 0,0,0 does not solve this.

  1. Export the FBX using the Binary version. ASCII wouldn’t even import for me. Also might as well set the smoothing to edge, and save the operator preset because every time you open a new Blender session it will revert back to wrong.
  2. Import into UE4, I imported all, including Animations and Skeleton, but not the materials (but that doesn’t matter)
  3. Open the Animation, check the “Enable Root Motion” box, (Ref Pose, Anim First Frame, and Zero all work for me) Click “Show” in the viewport and choose “Process Root Motion”. At this point everything should look good. And your mesh should animate off screen and then appear on the other side of the screen.
  4. Create a new Animation Blueprint.
  5. Edit the Animation Blueprint defaults, set Root Motion Mode to “Root Motion from Everything”
  6. Add the animation to the graph, and connect it to Final Pose.

  1. Create an ACharacter blueprint. Change the Mesh > Skeletal Mesh to your imported Skeletal Mesh. Move it down about -85 on the z to compensate for the capsule component’s center. This is totally a hack (my thing is not a Character), but it works.

The correct way is probably to do [what Genetic Spartain said][5] and make your own Class with this code:

FRootMotionMovementParams RootMotion = Mesh->ConsumeRootMotion();

if (RootMotion.bHasRootMotion)
{
	FTransform WorldRootMotion = Mesh->ConvertLocalRootMotionToWorld(RootMotion.RootMotionTransform);
	UpdatedComponent->SetWorldLocation(UpdatedComponent->GetComponentLocation() + WorldRootMotion.GetTranslation());
}

70228-2015-12-11+02-00-54_1_1.gif

smilingrob’s solution works perfectly for me. Thank you.

Thanks for this incredibly detailed answer. Haven’t had a chance to try it out yet, but I’ll let you know my results when I do.