PDA

View Full Version : Root Motion, Mocap and Motionbuilder?



Squiz
02-16-2010, 10:03 AM
I'm new to UDK and primarily concerned with character animation. I'm basically at the stage of assembling a tree. Great so far.

I'd like to be able to aslo use motionbuilder and perhaps mocap.

I've read the docs on root motion and was wondering how this relates to mocap data or animation from motionbuilder rig?

Is it simply that the root is ignored and left at the origin while the hips tranlate off? Or the appropriate channels plotted to the root?
I haven't got into gameplay stage, so i don't know how it would play or if I'm going to animate some problems for myself.

I was doing a annoying copy and pasting values from the hips to the root joint
from maya to get root motion, that worked but I know I'm missing something(s) here.

What do you do in regards to root motion when it comes to mocap or motionbuilder rigs? Also If there is no root motion should the animation for walks runs etc... be exported on the spot?

Help a dumm animator :)
Thanx.

Denny
02-16-2010, 10:43 AM
Root motion simply implies the Root bone animation driving the pawn movement. The complex part is setting it up, but yes you should animate the Root bone. The rest I can't help you with as I haven't messed with Root motion yet.

Squiz
02-16-2010, 05:53 PM
Thanks for the reply Denny. So it is something that requires setting up.
As I said I am able to do it by replotting some values after the animation has been baked. My lazy soul was kind of hoping there was some trick I was missing. I suppose I could script something up for that. I've also tried a few other tricks using constraints etc.. without success.

I was wondering about jumps? and other fall type anims. Is the root required for the Jump height? I suppose if your jumping on the spot it wouldn't matter but if you are jumping to a higher level, wouldn't it be required for blending animations? Other wise it may pop the character back down? Is that correct?
Will animations be blended from the point of reference at the Root?

Sorry if these are no brainers. But if I'm understanding correctly then the answers would be yes.

Thanx.

Denny
02-16-2010, 06:08 PM
You can use velocity based root motion, which simply nudges the pawn physically, so I suppose a jump could be based on root motion. I'd suggest making a jump in place movement, which is not root motion, and toggle root motion on/off in code whenever the pawn makes a jump. I'm pretty sure there was an article on UDN regarding how to work with root motion, switching between normal animation and root motion depending on cases.

Squiz
02-16-2010, 10:20 PM
Thanks again, Haven't got into how velocity works yet. So I suppose the best thing is to jump in and get my feet wet.
You've cleared up enough of my confusion to make an animset to try out though. Much appreciated.

Is anyone out there using motionbuilder for animation? I know it's done in the industry, I'd love to get some advice on that side of things. Unfortunately I'm pretty green when it comes to motionbuilder as well. Still having success though, just looking for the most efficient way.

ellement
02-18-2010, 06:49 AM
Thanks again, Haven't got into how velocity works yet. So I suppose the best thing is to jump in and get my feet wet.
You've cleared up enough of my confusion to make an animset to try out though. Much appreciated.

Is anyone out there using motionbuilder for animation? I know it's done in the industry, I'd love to get some advice on that side of things. Unfortunately I'm pretty green when it comes to motionbuilder as well. Still having success though, just looking for the most efficient way.


If success , can you do a little tutorial? thank you

HeroBiX
02-18-2010, 10:35 AM
I use Motionbuilder and Mocap to import it to Unreal, sadly as you probably guessed, you have to go trough Maya to get the animation to Unreal, Iam also struggling with the root bone, what I figured out so far is that Unreal calculates where the character is with the root bones positions, so if you keep the root bone in origo and your character is in hell, he is going to be black, because Unreal thinks it's in origo so it calculates the light for your character at orgio, but... you are in hell =)

Squiz
02-18-2010, 10:28 PM
Sure, I can explain briefly what I've been doing for the time being, it's very simple.

After I bring the baked animation into maya, I'm just cutiing the X and Z translate curves from the hips and pasting them to the Root. I found it a good practise to keep the Hip effector in motionbuilder at zero x and z for the beginning of the animation(s). This places the hips directly over the root at the start.
Otherwise you can offset the hips in maya so that the Hips are again equal with the root in the X and Z. (Y up orientation).

So you end up with the root doing all the horizontal translation and the hips only using Y translation.

I can see some cases where the Y would need to be used instead, like climbing etc...
Not sure about jumps just yet.

All appears to be working, however I'm yet to try how it will play in game.

I'm going to be meeting a rep for motionbuilder next week, so I'll post any advice if it's worthy.

Thanx.

Squiz
02-19-2010, 05:29 AM
Ok, I've thought of a much better way that involves a little setup in motion builder. And be done with the problem once and for all. Woot!

1. Bring your skinned mesh into motion builder and apply the rig.

2. Add a character extension to your character and assign the root joint. This is so it will be plotted with the rest of the skeleton. Assign a reference object to the extension (hips?) and update the stance pose.

3. In the root joint properties enable degrees of freedom and set translate Y min to 0.

3. Add a position constraint to the root and assign the hips effecter as the source.
I line them up by disabling the y on the position constraint, activating it to place the root in the x and z, then hit snap so it maintains the offsett then enable Y on the constraint. Be sure to set to lock.

4. At this point the root will follow the hips but not penetrate the floor. The distance between the hips and the root will be maintained when translating the character off the floor. This can be adjusted using the position constraints translate Y in it's properties (you'll have to unlock temporarily). That way you can adjust at what height the hips have to be before the root will begin to raise of the floor.

That's it, you can pretty much forget about the root for the most part. still early stages so no guarantees. More stuff to tackle still.

ellement
02-19-2010, 08:27 AM
Thanks a lot for saving my time, i am gonna try it out , see what happens. Thanks again

Squiz
03-28-2010, 09:14 PM
I've manged to get my guy in game with some place holder animations for now.

But I'm not sure where to set the options on the Actor, the docs tell me to set one of the RootMotionModes, eg. RMM_Translate, RMM_Velocity etc...

Is this meant to be part of the skeletalmesh components in the code? I've see references to it in the code. I'm not sure where to set it?

I'm sure this is an easy one. Any help?

Shelke
03-28-2010, 10:01 PM
I've been messing with root motion lately, with little success.

RootMotionModes are set in the AnimNodeSequence and also in the skeletalmesh component. you can do both from code so it should be no problem. here is a little function I use for this.



function EnableRootMotion(AnimNodeSequence SeqNode)
{
// Here we set the settings for the sequence node
SeqNode.RootBoneOption[0] = RBA_Translate;
SeqNode.RootBoneOption[1] = RBA_Translate;
SeqNode.RootBoneOption[2] = RBA_Translate;

// Then set the settings in the mesh.
Mesh.RootMotionMode = RMM_Velocity; // RMM_Translations and RMM_Accell
}


sadly, I can't get the mesh to forward the velocity to the pawn physics unless i set it to RMM_Translate. see here http://forums.epicgames.com/showthread.php?p=27201267 to see how I got around it.

if you could test RMM_Velocity to see if it works for you, I would appreciated. hope this helps.

Squiz
03-28-2010, 11:24 PM
Thanks Shelke, That answers my question as to where it's set.
I was using "RootMotionMode = RMM_Velocity" in my default properties as part of the skeletalmeshcomponent block.

I also tried "Mesh.RootMotionMode = RMM_Velocity" in the PostBeginPlay() event. I don't get any errors but..

Both ways locked my character in place, only RMM_Translate gets him to move, however it just reverts to using the groundspeed and is not using root motion.

I tried using the Tick as you mentioned but no luck so far.
Thanks for the reply.

I'm starting to think my rig may have something to do with it, Joint orientation perhaps? or possibbly something is broken in the code.

Squiz
03-29-2010, 08:18 AM
I've made a little progress, My problem seems to be in my animtree.
I have a blend by physics node from walking to a blend by idle node. A simple setup I got from a thread here.

If I remove the blend by idle it works, kind of need it though, not sure how else to set it up. More tinkering needed.

Squiz
03-29-2010, 12:02 PM
I finally got it working, I used a blend by speed node instead of the UDK blend by idle.
And have the use acceleration checked in the node properties.

The animnode sequences are set to the translate option and I set the "RootMotionMode = RMM_Velocity" in my skeletalmesh. Just in case anyones interested.

Yay! I can sleep now :)

Shelke
03-29-2010, 12:11 PM
Glad you got it working. but did you manage to get RMM_Velocity to work? no matter what I try, RMM_Velocity & RMM_Accel will simply keep the character in place. I can see the change they make in Mesh.RootMotionVelocity, but it does not forward it to the pawns velocity. :(


- It looks like you replied as I was typing this.. could you elaborate as to how you set up the anim tree to use RMM_Velocity?

Squiz
03-29-2010, 07:15 PM
Hi Shelke, This is my simple tree, the node that made the difference was the blend by speed with use acceleration checked. I'm not sure why it works when I am using velocity?
http://i53.photobucket.com/albums/g52/ebgb_2006/animtree.jpg
I was getting some pretty funky results using the UDK nodes in the animtree, The UDK blend by physics was performing my walk animation when in jump. Amongst other weirdness. Originally I was using UDKBlendByIdle which appears to be the problem.

In my Pawns default properties as part of the skeletalMeshComponent block I added...

RootMotionMode = RMM_Velocity

That was the only code that I added.

Shelke
03-29-2010, 08:39 PM
Thank you Squiz, I'll give it a try!

zipstick
04-07-2010, 05:27 AM
hmm..this is so much easier in Max for some reason..
I don't have to worry about origo or having my mesh in Motion Builder..Actually all I use MB for is translating the data between raw capture and Max.

brunomartelli
04-29-2011, 04:15 PM
Hi ive been following the method of Squiz, which is similar to the method of Jaze on Autodesk Area (http://www.the-area.com/forum/autodesk-motionbuilder/autodesk-motionbuilder-2009/mb-for-udk-what-about-root-motion/). so ive dont that, what then? plot to skeleton? CTRL rig? what would the plot settings be? ...any clues appreciated.

brunomartelli
04-29-2011, 04:17 PM
Hi ive been following your method Squiz, which is similar to the method of Jaze on Autodesk Area (http://www.the-area.com/forum/autodesk-motionbuilder/autodesk-motionbuilder-2009/mb-for-udk-what-about-root-motion/). so ive dont that, what then? plot to skeleton? CTRL rig? what would the plot settings be? ...any clues appreciated.