Home Animation Showcase & Critiques

Mapping pole vector/mocap to UE4 Mannequin Knee Twist channel

polycounter lvl 8
Offline / Send Message
KielFiggins polycounter lvl 8
I recently worked on a UE4 project that required putting custom skeletal mocap data on to the Mannequin rig.  The majority went fine, except for mapping the knee direction/angle to the knee_twist channel on the ik feet.  

Has anyone else came across this?  I dug around but couldn't find a toggle to have the legs have a pole vector control which would resolve this issue entirely.

The solution I ended up using, which was really hacky / slow, was writing a script to:
-go frame by frame
-get the distance between the mocap knee joint and the rig knee joint
-set the knee_twist channel to go from 0-360 to find the shortest distance, store that knee_twist value
-key that knee_twist value to channel

 Not the most elegant solution by far, but I can't be the only one to try and put custom mocap on a rig this popular.

Any other thoughts/approaches would be greatly appreciated.


Replies

  • Ollarin
    Offline / Send Message
    Ollarin polycounter lvl 7
    Hey Kiel,

    Replied to this on Twitter as well, figured I'd toss it up here incase anyone can improve on the idea.

    "Just thinking off the top of my head. You could get the direction of the plane for the leg on the mocap skeleton (Similar way you'd calculate the proper location of a pole vector). Use that vector to compare it to what the original pose was (legs pointing forward),

    Then get the angle between the original pose vector and the current vector. Using something like (arccos(dot(v1.normal(),v1.normal()))). After converting that to degrees you should be able to input that into the twist angle?"
Sign In or Register to comment.