How to get Root Motion from Motionbuilder to Unreal

This is a method to get a root for you skeleton that has motion on it. The Root remains under the hips of the moving character, on the floor (0 Y) – it won’t bob up and down…In Unreal this can be used with root motion to give an animation that can move away from 0,0 and when it loops, the next loop will start from the last frame position – rather than jumping back to 0,0.

There are 3 bits to this guide:
1. Getting all your motions into one take and driving a sourcecharacter
2. Making a root motion character and getting the sourcecharacter motions to drive it
3. Getting it all hooked up in unreal.

***
may have figured out how to get the root rotation too.

from Mocappys

  1. Use the character’s “Hips” and the “Source” object.
  2. Add your “Root Object” as the “Constrained Object”
  3. “Snap” the constraint to keep the offset.

If you want the “Root Object” to stay on the floor and not move up and down with the “Hips”:

  1. Select the “Position” Constraint in the “Scene Browser”
  2. In the Properties window, turn OFF “Constraint Axes>Affect Y”Repeat these steps with a rotation constraint but set the Constraint Axes property to be only affecting Y.

Then select the Select the root bone and all child bones  and in the Animation menu select “Plot selected (all properties)” and plot all takes.

..However this gives double rotation in Unreal

*****

First if you have motions you need to get them to drive a character.

in Motionbuilder..

1. You have a moving skeleton like the pic below, there is no T-pose take and you have a bunch of other motions.

3d view of the skeleton

2. In the schematic view it looks similar to this, you can delete any extraneous bits.

Schematic view of the skeleton

3. L-Click Drag over to select the whole skeleton to select it and go to File/Motion file import. Select all the other takes using the same skeleton (that come from the same performer – lets assume you have more than one take). In the import settings choose In Selected Models and Ignore Model type and Import degrees of freedom. This will bring in all the takes onto this skeelton.  (see pic below)

Merge motion settings

4. Save this file as ‘YourPerformerSource’.

5. Open a copy of a characterised Tpose character file that has no motion and doesn’t have a skeleton root. (I’m doing a lot with takes and characters that share the same skeleton, this may be important in the next step)

6. Make sure that under the character settings the Input Type is not set to Active.

7. In the schematic view select the skeleton root and choose File/Motion File Import. Iin the import  dialogue box this time select In Selected Heirachy

(Hopefully this will work even if you have characters and motions which have different skeletons. I use a lot of the same skeleton so it may not be the case)
You should now see your character driven by your motion takes. It’s a good idea to rename the character  ‘source’ so usually open the navigator and change the namespace to ‘source’. Save this file as ‘YourCharacterSource’.

Second make a character have a root in Motionbuilder…

1. Open another copy of a characterised Tpose character file that has no motion and doesn’t have a skeleton root.
2. In Navigator in Characters/Character Definition uncheck Characterise.
3. hit CTRL-W to switch to Schematic view.
4. From the Asset Browser under Templates/Element drag a Skeleton Root onto the window.
5. Parent your Skeletons Hips or Pelvis bone to the Skeleton Root & rename it to ‘Root’
6. Hold X and drag it into the Character Definition Under Special / Hips Translation.

Root dragged into the Special/Hips Translation slot
Root dragged into the Special/Hips Translation slot

7. Now Click Characterise.
8. With the Root selected in the Schematic view in the Window menu choose ‘Add Property View’.
9. In the Properties window Choose ‘Group all’ from the drop-down list at the top.
10. Look for Degrees of Freedom/Translation tick ‘Enable Translation DOF’.
11. under Min T tick ‘Enable Min Y’ and under Max T tick ‘Enable Max Y’.
12. Now save this Rootcharacter & import it into Unreal.
13. Back in Motionbuilder open the file with your motion takes, (‘YourCharacterSource’  from the first section above). Now merge in your Rootcharacter and set the Merge Options like so:

Merge settings

Use the Source Character to drive your Root character, then Plot to your skeleton, then select just the skeleton and choose Export Motion files.

 

Plot to skeleton settings
Plot to skeleton settings

Third Set it up in Unreal..

1. Import the Motion files to Unreal & choose the Rootcharacters Skeleton you imported earlier as the Skeleton.

2. In Unreal open the animation and under Asset Details click EnableRootMotion. You will see the character hips now don’t move. There should be a bone that stretches down to the floor, like this pic. (Ps. This is in Unreal Engine 4.18)

3. In your Animation blueprint you need to check that under Anim Preview Editor, the Edit Defaults are selected and the RootMotion From Everything is selected. If not it seems to stop root motion from working. The default setting is Edit Preview which foxed me for a while. looks like this…

4. So just because, in Unreal to get a properly set up character, even if its only a NPC type character that will play special animations and never be controlled by the player.. (will write this into a better guide soon)
the way to set it up is:
a) import skeletal mesh in a Tpose with a Root.
b) Then import just animations, which you set to use Root Motion.
C) Make a Animation Blueprint to control the animations, probably using State Machines like here.
d) Finally a Blueprint character that uses both the skeletal mesh and the Anim blueprint is what gets placed in the level…