How to obtain bone locations from an animation node in anim graphs (for IK foot placement purpose)

Hi All,

I want to get a bone location from an animation node in an anim graph for IK foot placement purpose. IK is usually used as a post process on animations. That means that the FK animation is going to be calculated completely and the IK is going to modify it to create more accurate animations. So here for a foot placement system, I need the FK animation first and from the updated foot position of the FK animation, I’m going to cast a ray to obtain desired foot location on ground. Please have a look at this picture:

The FK animation is calculated in “default state machine”. Then I implemented a custom animation node. I want the animation node to get the updated foot bone location from its input pose and use it to cast rays and find the desired foot location on ground. Then the foot location on ground has to be passed to the “Two Bones IK” node.

The custom animation node has three overridden functions, Evaluate, Update and initialize. I think I have to do the job in the evaluate function but I didn’t find how to do it. And unfortunately the documentation are bare on the animation node sections. Almost no description about their methods and classes. So any help would be appreciated :slight_smile:

Thanks in advance for your help.

P.S: There is a [tutorial][2] on Epic documentation which is offering a foot placement system. The system is not working correctly because it uses non-updated foot positions to cast rays. That means it uses the previous frame position of the feet to cast rays and find the desired foot location on ground. Although it works fine with stationary animations like standing idles but it would not work fine with the animations which have noticeable displacements between two consecutive frames like run and sprints. In a sprint animation the feet translates significantly between two consecutive frames and using the feet’s previous frame location to cast rays can cause unacceptable results.

I found the solution and wrote it here.