How to transfer the translations from the IK controls to the world control?

Rotemnin248
Contributor
Contributor

How to transfer the translations from the IK controls to the world control?

Rotemnin248
Contributor
Contributor

Hey everyone.
I have a combo animation that I made and its a progressive combo, I mean every attack the character is moving forward.
So I want to export it to a game engine but before that Im looking for a way to transfer my translation from my IK controls to the world controller so that in the game engine(Unreal) I can check the Root Motion.
How can I do it?

Reply
Accepted solutions (1)
1,267 Views
13 Replies
Replies (13)

Kahylan
Advisor
Advisor

Hi!

 

Do your IK controllers follow another control (i.e root or hips) or are the completely free moving?

Rotemnin248
Contributor
Contributor
they are free moving, the thing is that I sometime change to FK and back to IK (the hands)
0 Likes

Kahylan
Advisor
Advisor
Accepted solution

Ok, so here is what you need to do:

 

1) decide on a controller that represents the center of your body center. Normally that is the root or the hip controler. Because you want your limbs to move in relation to the center of the body once you take away the forward movement.

2)  create a locator for each of your IK controllers and for the body center.

3) Parent the IK locators to the Body Center Locator

4) parent contrain the locators to the controls they belong to (maintain offset off)

5) select your locators and use the "Key -> Bake Simulation" command on them, this will animate them in space and break the connection to the constraints. You can delete the contraints.

 

Now comes the a bit more tricky bit.

 

6) open the node edior and display the animation curves of your body center locator. So before you open the node editor, select your body center locator, if it doesn't show up automatically, use the "add selected nodes to graph" button. Then click on the "input connections" button.

 

You should see the animation curves that connect into the locator. Expand the node and look for the connection into translate Z.

 

7) Select that connection and delete it (just the connection, not the node).

 

Your locator should no longer be animated in Translate Z and the other locators should move around it.

 

😎 Set the Translate Z value on your body center locator to 0 in the outliner.

9) Delete the animation on your IK controls

10) parent constrain them to their corresponding locators.

11) Use bake simulation on the constrained controls to bake the new animation onto them.

 

Now your Character should move on the spot. Depending on your game mechanics, this is what you want.

If you need the World control to do the Translate Z movement:

 

12) Take the animationcurve that you disconnected from the body center Translate Z before and connect it to the translate Z of your World control. Now the World control should do the same movement as the body center control did before.

 

It's a pretty long explanation, but this is how you can do this.

 

I hope it helps!

 

Rotemnin248
Contributor
Contributor
Thanks for the detailed answer!! ill do it!
If I have animbot, it can help?
Is there a magic with animbot that I can do it?
0 Likes

Kahylan
Advisor
Advisor

I don't think animbot will help with this, since it isn't a software that is meant to prep animation for export. Atleast the last time I used it, it didn't have any features like this.

 

There are probably scripts out there that do this kind of thing, but I wouldn't know what to search to find them 😕

Rotemnin248
Contributor
Contributor
Hey I have just done it again, and everything works really well, but the thing is when I connect the translate Z of the body to the World Controller of the character, the world controller is moving but the character doesn't move, she is still moving in place and not with the world controller.
and overall it looks like the world controller doesn't affect the character, the character always stays in place.
0 Likes

Kahylan
Advisor
Advisor

Hmm, could there maybe still be an active constraint on your root control that overwrites the translation of the parent hierarchy?

 

0 Likes

Rotemnin248
Contributor
Contributor
the thing is that I parent constrained the controllers to the locators, and the locators is moving in place
0 Likes

Kahylan
Advisor
Advisor

Have you baked the animation onto your controls using Key -> Bake Simulation?

 

0 Likes

Rotemnin248
Contributor
Contributor
Yes I did, but when I remove the locators, the whole position and everything is going crazy and out of place
0 Likes

Rotemnin248
Contributor
Contributor
I understood why.
I have animation layers, and I didn't know its baking and doing everything on the base animation layer, so I removed the whole IK controls from my other layers and now its working fine.
0 Likes

Rotemnin248
Contributor
Contributor
But the thing is that now I don't the translate Z in the node editor,
0 Likes

Rotemnin248
Contributor
Contributor
I want to tell you that I recently started to work in the gaming industry, and this method that you wrote, helps me A LOT!!
when I make jumps, combat, and tons of other stuff, and the Unity developer, or unreal developer, wants them in place in 0,0,0.
I use this method, it's amazing, thank you so much!
0 Likes