Working with Root Translation in MotionBuilder

Working with Root Translation in MotionBuilder

Anonymous
Not applicable
9,522 Views
20 Replies
Message 1 of 21

Working with Root Translation in MotionBuilder

Anonymous
Not applicable

Hi everyone,

I've got some animations that use root motion, and I've got these working in Unreal 4. At the bindpose, the root is at 0,0,0 and this is at the top of the hierarchy. The hips are a child to the root. To my knowledge this is a pretty standard setup.

I've got translation keys on both of these joints. The root is driving the capsule in the game engine. The hips are being animated purely for aesthetics - the up and down during the walk, etc. Again, I think this is pretty normal (though correct me if I've made a mistake).

Here's my problem - in MotionBuilder, the characterisation panel doesn't have a slot for Root. It has a slot for Hip Translation under the Special tab, but this (as the name suggests) puts all of the hip translation keys onto the root, which is not what I want - the root is now bobbing up and down as the hips did in the original animation. If I put the hip joint in the Hip Translation slot when characterising, then it does the opposite; it puts all the keys from the root onto the hips. In that case the final result is a character that walks off the origin and leaves his root behind, which doesn't work in the game. Either way it's not right.

What I'd like is to be able to retarget the root joint to the root joint, and the hip joint to the hip joint; I don't want MotionBuilder to treat them as the same thing and consolidate them into one retarget. I'm sure this is possible and that it's me making the mistake - can anyone help me?

0 Likes
9,523 Views
20 Replies
Replies (20)
Message 2 of 21

BradClarkRiggingDojo
Collaborator
Collaborator

If you are trying to retarget /mix match motions that have or don't have root translate, this requires a bit of rigging with constraints and limits to get working otherwise you will hit the problem you encountered.

 

Depending on skill with MotionBuilder will tell me how much detail you need to get this working.

Message 3 of 21

Anonymous
Not applicable

Hi Brad,

 

I'm having the same problem as the OP. Same setup and same requirement, I need to get the motion from the root bone in a set of mocap animations (already cleaned up elsewhere - Motus) onto either the Reference bone in my target skeleton or it's equivalent.

 

I'm a programmer, not an animator, so I've been watching tutorials and reading what I can to solve the problem, but I can't seem to find the right solution.

 

I've found out and tried hip translation - but that puts all the motion onto the root, including the hip sway, which I definitely don't want there. I tried using a position constraint keeping only the X motion, and a whole bunch of other things. I either end up with a character that seems to move correctly with the reference where I'd expect while using another as the active source - but then when I bake it ends up  with zero motion on the root, so it runs in place instead. Other results include the root moving up and down through the floor...you get the idea. Trying to copy the root from the source using a constraint led to the target root running slightly ahead of the model over time - since their sizes are different.

 

The animations already have a perfect root on them, one I just want to transfer to the source, but have properly scaled in line with the hips, so it maintains it's offset from there. I just can't seem to stumble onto the right method.

 

I have basic understanding of the constraints, though it would help if a decent tutorial / document could be linked to resolve questions I have about which order they are applied in, and if it's possible to swap a pair of values between two nodes using a constraint, etc.

 

If you know the correct way to do it, that would go a long way towards me getting this done and getting back to the programming work for my project. I have some in-place animations that are no problem, but I also have a couple of hundred with root motion, including ones on X+Y axes, so any solution would preferably handle those cleanly.

Message 4 of 21

cbroadhurst
Participant
Participant

Hi guys,

 

Crispin here with Motus/MocapOnline.

If I'm reading your intentions correctly, you are trying to use MoBu to to retarget root motion animations from one character to another, and also retarget the root motion at the same time to the target rigs root/ref whatever it happens to be called. Correct?

 

Assuming that, this really simple to a point - IF you don't scale the target character to fit better, that is much more involved.

 

For simple no scale retarget:

Make sure "Match Source" is on in the target rig.

You can ParentChild constrain the target root to the source root, just make sure you "snap" them (not zero) at the origin to each other to maintain any rotation offsets between them.

Add the target root to a Char Extension so it plots along with the character skeleton, a convenience.

I do this all the time porting from UE4 Manny to CryEngine which has root motion too. BUT I never have to rescale, thank goodness.

 

Scaling the target char for a better fit really makes for multiple steps and gets a bit convoluted. (as rsimp68 mentioned the root will drift away and feet will slide, total mismatch)

Brief example I texted to Brad discussing the process while I was throwing something together that worked, sorry for the shorthand:

>>>>

e.g. target ref is scaled to .75, ref(root) is constrained at the origin(root motion ignored). Plot target. Either a ctrl rig or a mkr needs to be baked then constrain the hips current baked motion(like a ctrl rig would). Child mkr of a pair is plotted to the current source animation of the source root(wrong scale for target). Parent mkr of the pair is then scaled to 1.333(the percentage inverse of .75). Child marker now moves in correct scale/position with target character, and its ref is constrained /plotted to it along with the hips simultaneously re-plotted.

>>>>

 

I checked the results of a "Stand_Turn135_To_Jog_Fwd", and the results of the local translation of the hips were spot on at the end jog pose with the start of the jog cycle at the origin, off by point 2mm on one axis, which is likely the error already in the source animation. Math works. I have not tried jumping (Y) root motion as a verified test, but it should hold up - or simply edit the height to taste with a ctrl rig.

 

I apologize if that texted gibberish doesn't make much sense, I need to run now but if that doesn't help and set off some light bulbs I'll gladly make a tutorial video later more clearly, it is an interesting problem. 🙂

 

Cris

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
Message 5 of 21

Anonymous
Not applicable

If I'm reading your intentions correctly, you are trying to use MoBu to to retarget root motion animations from one character to another, and also retarget the root motion at the same time to the target rigs root/ref whatever it happens to be called. Correct?

Exactly right. I have the Motus Movement Pro pack (which is really nice BTW, thanks guys), and I am working with MoBu to get those animations onto a different rig and then into CryEngine. The plan was definitely to target it to a smaller character than the one supplied, though I might just try it the easy way first and target it on one with the same height. Then I can go back and try the longer harder method you describe. Short term plan is to get a base model and rig for a generic human male and female, both at average heights for US citizens. From there I can use Mixamo to help generate any b-characters I need and if I just make them the same height and proportions as the base ones, it will be quick and easy to get them into the engine.
I apologize if that texted gibberish doesn't make much sense, I need to run now but if that doesn't help and set off some light bulbs I'll gladly make a tutorial video later more clearly, it is an interesting problem. 🙂
The shorthand is much appreciated. Most of my problem is just not being familiar enough with the tools and how to use them. Knowing to plot to a control rig with zero transforms on the root first takes out half the guesswork 😄 I will happily watch that video when you make it! Do you have a channel or blog I can go check out?
0 Likes
Message 6 of 21

BradClarkRiggingDojo
Collaborator
Collaborator

Thanks for getting back to them, I forwarded your post on to Crispin since he created the Motus pack 🙂

Message 7 of 21

cbroadhurst
Participant
Participant

I refined/simplified/cleaned up the process and I'm going to make a tutorial video later to post on YouTube and our MocapOnline blog, stay tuned.

Glad I could help, this actually is a tool I will use in the future. Smiley Happy

 

Cris

 

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
Message 8 of 21

cbroadhurst
Participant
Participant

Tutorial is up now.

 

https://www.youtube.com/watch?v=bS_ze_ASmak&feature=youtu.be

 

I hope that helps out you guys and a lot of other folks. I tend to spend a lot of time explaining concepts, but I think it's always best to have a good understanding of why you're doing something instead of just listing the actions themselves. The fix for the scaling issue is a simple one. There is an index to jump to that or any section. Smiley Happy

 

Cheers,

Cris

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
0 Likes
Message 9 of 21

Anonymous
Not applicable

Thanks for the tutorial, it's quite excellent at explaining the issues and the solution. The best part is where you go through the huge complicated mess of constraints you made, then reveal it wasn't needed and go on to explain the easy solution.

0 Likes
Message 10 of 21

cbroadhurst
Participant
Participant

Glad it helped.

I had to laugh at myself, sometimes you need to go through the process to reveal the simple answer. A simple parent object versus replicating the relationship and results with math and more mouse clicks.

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
0 Likes
Message 11 of 21

Anonymous
Not applicable

I need to add one more point, for people using CRYENGINE.

 

Any animation which allows the 'Root' node to lift off the ground plane, will not play well in CRYENGINE.

 

If you export it from MotionBuilder using the supplied plugin, you will find the exported animations will appear 'compressed' around places where jumps and the like occur. Whenever the character should lift off the ground, CRYENGINE will keep them stuck to the ground, and their body will compress accordingly.

 

For lack of a better idea, I simply applied a small change to your instructions. When you advise to add to Parent-Child constraint to the 'Root', I made sure to turn off the 'Y-translation' on that constraint. This keeps the 'Root' firmly fixed to the ground plane.

 

I don't know if that's the best plan, but..for now, it is, since it let's me import the animations in a way that looks right.

 

My plan is to use animevents to know when the character is "in the air" and vice-versa. Hopefully, that works...if not...I'll post back here.

0 Likes
Message 12 of 21

Anonymous
Not applicable

Hi Crispin,

could you explain how to get rotation onto the root bone? (I'm using Unreal and my root motion anims aren't rotating correctly - there is no rotation on the root) 

 

thankyou

 

0 Likes
Message 13 of 21

cbroadhurst
Participant
Participant

@Anonymous wrote:

Hi Crispin,

could you explain how to get rotation onto the root bone? (I'm using Unreal and my root motion anims aren't rotating correctly - there is no rotation on the root) 

 

thankyou

 


aa9332,

 

Generally speaking, with your character animation on the Control Rig, you can animate the Root node any way you want. The hips now move independently and the Root can be translated and rotated appropriately to how you want it. The Root should be the Reference for the Character(typically) and added in a Character Extension so it is keyed and plotted with the Full Body, and this also makes it part of the Pose - very useful and important so loops and tree motions have perfectly matching relative Root positions.

 

So for example a character goes from a Stand to a Walk_Forward 90 deg to the left. You start with the Root zeroed at the origin (the Stand Idle pose) and end with the Walk_Forward cycle pose 90deg left with the root correctly under the character hips and facing 90deg left to match.

 

You of course need your Poses for Idles and cycles already created, which includes the character's position over the Root(origin), which then of course in this >L90>WalkForward example is pasted and becomes the position and rotation of the Root under the character at the new location to the left and rotated 90deg.

 

You could paste the beginning and end poses, then clean up the interpolation curves for the Root so the rotation and translation matches the turning of the character and stays under the hips smoothly. The start is easy, paste the Idle pose with no TR matching as is. For the 90deg walk forward more care is needed so the pose is truly 90deg. One way(a few variations possible) is to hand key the Root first at the end so it's under the hips, is exactly on the X line(if no Z drift is desired) and rotated 90deg left. Then select the Root and match T and R for the full body Walk_Forward pose. This way you get a true 90deg offset of the pose as well as exact lateral placement since it was based on the perfectly placed Root TR.

 

Hopefully that all made sense, I think I answered your question in paragraph one but I wanted to elaborate a little if you've never created root motion from scratch before, there's a number of ways to approach it depending on the desired end results and what floats your boat.

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
0 Likes
Message 14 of 21

Anonymous
Not applicable

Hi

thanks for answering. I wasn't using a control rig. My root was top of heirachy and prior to being plotted is driven by animation from another character. The root has one constraint to the hips, position. In the properties the DOF is set to Min and Max Y set to 0 so no up and down. I select all bones and select Animation/Plot all properties. This works well in Unreal for Root motion for the Translation. So i figured that for rotation i could add a Rotation constrain and use the properties DOF rotation order Euler YZX to give just Y rotation. However somehow in Unreal this doesn't come over well. Because I'm stupid and maybe  Motionbuilder documentation doesn't seem to be written for people who don't already understand it, I don't really understand how the rotation is converted to Unreal.

But you are saying I have to use a control rig? Im also only animating an NPC not a PC so my sequences are long and move all over the place.

0 Likes
Message 15 of 21

Anonymous
Not applicable

if i look at the rotating root bone, where the character is doing  complete turn from front to back say i can see the Y going from say -87 round thru 0 to plus 85 which seems like the right numbers. But on X and Z the numbers stay at 0 then about half time they jump to 180. Which messes up unreal. How can i stop the unwanted rotation there?

0 Likes
Message 16 of 21

cbroadhurst
Participant
Participant

@Anonymouswrote:

if i look at the rotating root bone, where the character is doing  complete turn from front to back say i can see the Y going from say -87 round thru 0 to plus 85 which seems like the right numbers. But on X and Z the numbers stay at 0 then about half time they jump to 180. Which messes up unreal. How can i stop the unwanted rotation there?


Sorry for my very late reply, I somehow got unsubscribed.....?

 

I see, you are trying to do a transfer between characters, not use the control rig, but using a handful of constraints. Could work, a tool box is a toolbox. 

 

I'm not sure your exact setup and process, but I get the gist. I do know that the UE4 root is Euler XYZ and Z up - which means in Motionbuilder it is globally rotated -90 on X but still has a local rotation of 0 on X. So turning of root motion happens on the local Z rotation, and that makes for a clean single channel rotation with no no 180 flipping/gimballing of the other two channels (Z is the parent/top rotation).

 

If your target character root is non-XYZ rotation order, that could create chaos and the 180 flipping you are seeing and UE4 hates. Besides that, using rotation constraints versus a Relation with direct math connections will create different results, especially numerically, so there are some options there for experimentation.

 

As I said I don't really understand your exact setup/situation without seeing it. If you haven't figured it out yet, you can send me an example file showing your setup and a good Take with the problem, I could take a look.


 

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
Message 17 of 21

Anonymous
Not applicable

Hi Crispin 

 

Thanks for your help. I'm sending you a file with a short take. The final skeleton with root bone is green. The root bone is constrained to the hips for translation and rotation. The constraints have DOF enabled. In Rotation the DOF is set with Euler XYZ rotation like you said, and it's a lot better in Unreal- its facing the correct way and is correctly translated over. But on a long take the character goes up into the sky as if it was on an invisible floor plane that was tilted up.

(I'm plotting the source animation to my character by selecting all the bones and choosing Animation /Plot all properties, then exporting the motion file, then opening it to reset the first frame root Translation to 0,0. In Unreal im setting root motion with Root Motion Root Lock set to 'Anim First Frame')

 

thanks again for the advice.

0 Likes
Message 18 of 21

cbroadhurst
Participant
Participant

@Anonymouswrote:

Hi Crispin 

 

Thanks for your help. I'm sending you a file with a short take. The final skeleton with root bone is green. The root bone is constrained to the hips for translation and rotation. The constraints have DOF enabled. In Rotation the DOF is set with Euler XYZ rotation like you said, and it's a lot better in Unreal- its facing the correct way and is correctly translated over. But on a long take the character goes up into the sky as if it was on an invisible floor plane that was tilted up.

(I'm plotting the source animation to my character by selecting all the bones and choosing Animation /Plot all properties, then exporting the motion file, then opening it to reset the first frame root Translation to 0,0. In Unreal im setting root motion with Root Motion Root Lock set to 'Anim First Frame')

 

thanks again for the advice.


I have a fix, I made a new FBX file for you to illustrate and a video explaining. I will post the video to you privately for now, I may clean it up later and post for everyone else as it could be useful information. I am tired, and I do ramble. Smiley Happy

See attached file.

 

Summary:

 

I set the target root to a pre-rotation of -90, so it would have a global -90 rotation at default rest but all zeros locally. Just like the Epic SK_Mannequin root and for good reason. This makes rotating local Z for yaw(turning) the only channel necessary, clean single curve.

I created a marker as a poxy object to hold the Pelvis in place while I unparented, rotated and reparented the root. (Pelvis was already keyed for T Pose)

Rotation constraint for the root is still Pelvis controls Root and is snapped at the T Pose to accurately represent "forward". DOF was set to zero for X and Y.

I made a Relation for root to follow Pelvis global translation XZ and set global Y to zero. (I removed the original T limits)

 

Other than the process inevitably breaking at some point if the character bends over too far in any direction and gimballing/confusing the rotation constraint, solid results with a single clean local Z rotation.

 

A number of ways to get the same results for sure, this was pretty quick and dirty but gets the job done. Check it out lemme know you got it working.

 

Cheers,

Cris

Crispin Broadhurst
Technical Director/Animator
www.MocapOnline.com
www.MotusDigital.com
Message 19 of 21

Anonymous
Not applicable

that is amazing thankyou!, I will test it when in get in!

Message 20 of 21

Anonymous
Not applicable

Hi Cris

 

Been AFK

thanks for all the help on this and the example file. I can see the root is rotating in a good way with good rotations in Y.
BUT!

in Unreal, the animation comes in fine but then when EnableRootMotion is ticked it's goes face down on the floor. In the 3 options for Root Motion Root Lock its set to RefPose. If I try Anim First Frame the figure is offset from the root and ingame when the anim loops it sweeps around, bad.
If the Root Motion Root Lock is set to Zero then the animation skates around, also bad

 

So the root needs to be at 0,0 on the first frame. So I did that in MB and imported a new version to Unreal.

Once again its face down when EnableRootMotion is ticked. But setting Root Motion Lock to Anim First Frame fixes it and the root successfully translates and rotates and it behaves as you would want it to! Finally!!

 

Hooray, Hurrah, Applause, thank you Cris!

0 Likes