Unreal Engine 4

Mixamo animations to UE4. How to import them without support.

In December 2016, Mixamo decided to pull support for Unreal Engine 4 compatible animations. But what does this mean ? Does this make it impossible to get mixamo animations into UE4 ? In short, “No!”, it is still possible to get Mixamo animations into Unreal Engine 4. First I will explain why mixamo needed a separate option for unreal exports and afterwards I will describe a (at the time of writing atleast) working way to get mixamo animations into UE4.

The previous way of getting animations into UE4 would have been to export the mannequin from UE4 as an fbx file, upload this to mixamo, select the desired animations on the mannequin and download them from mixamo with the “unreal Engine 4 export” option. This was however made unavailable.

Mixamo had the need for this option because animations in mixamo work without an actual root bone. I don’t exactly know why, but I guess it isn’t necessary as the preview “scenes” only have the specific character and thus only 1 skeleton. At export time however, the skeleton gets a root bone. When selecting the UE4 option, they added a root bone at 0.0.0 via the way of a script. When you use the standard export, the pelvis gets transformed in a root bone, and this is where the problem lies. UE4 needs a root bone at 0.0.0 to correctly use root motion, and the root bone also describes the position of the mesh. Importing skeletons into UE4 which have the pelvis as root bone therefore results in meshes which “float” by means of the pelvis, resulting in the added effect that a pelvis will not move.

43f29a570e21b0bdbf44e52beffb4e37
A mixamo animation imported with a faulty root bone

Now, for a way to actually import them correctly. First, we must modify the UE4 mannequin to have the pelvis as a root bone (I know , this sounds counter-intuitive). So, export the SK_Mannequin to an fbx. and open it in any modelling software you are familiar with (Maya is sure to work, you may also need to put the model into y-up). Then, remove the “root” bone and the IK bones for the left and right hand. This will leave you with a normal skeleton which has the pelvis as a root. We will call this skeleton_noroot to be clear.

Our skeleton_noroot is now ready to be uploaded to mixamo. You can now put any mixamo animations you want on it. Download the skeleton_noroot with the animations from mixamo in fbx and with a skin attached. Now, import this into UE4, this will give you a new mesh with it’s own animations, materials and skeleton, don’t worry, we will make these animations available on the standard mannequin.

The last thing we have to do is use the UE4 “retarget manager” to retarget our animations from skeleton_noroot to the standard mannequin. This is fairly trivial, as the bones have exactly the same name and the skeletons are actually identical except for the root and IK bones. More information on the retarget manager can be found on Epic’s site.

e20ada53dac32f095c8b0a6fd22f7604
The same animation, correctly imported from mixamo
Advertisements
C#, Code, Unreal Engine 4

Unreal Engine 4 , blueprints or C++?

Unreal Engine 4 is probably one of the most powerful and widespread engines in the industry right now.

For artists it’s easy to see why , it has some very good rendering capabilities, has great functionality with substance painter and is very easy to create new shaders in with its very robust node-based approach.

Programmers new to UE4 however are not always sure how they should feel about UE4. Sure , the blueprint system seems like a nice idea , but can I really do everything I want in it?

Most programmers have a certain fear of the blueprint system at first because they feel like it limits them to what they can do. It also isn’t exactly very freeform at first. Sure , it’s easy to grasp , but very hard to actually implement complex systems in. Atleast , that’s what they think.

As a programmer myself however , i understand all these questions and had them myself at first. Coming from unity , this gives you the idea that you can write everything you want very easily, as it’s totally code-based. Blueprints however are also very powerful , and not should not be underestimated. It’s actually very easy and possible to create a fully working FPS with an inventory etc. without even touching a single line of code in UE4. And all that , thanks to the power of blueprints.

An added benefit of blueprints , is that they can be made extremely readable and it’s a lot easier for the artists on your project to try and code ( or at least understand ) something themselves. This , because it is ¬†essentially the same node-based system as the way in which they create their shaders in UE4.

And when you are a small team , it can be very helpful if an artist ca roughly code one of his ideas and then just let you refine and actually implement this feature.

Therefore , I highly recommend leaving the C++ code on the side and at least trying some code in UE4 blueprints. You’ll be amazed at what it can do.

I’ll be making another blogpost containing some actual examples of me using this system to great effect in the near future.

Stay tuned!