Animation Retargeting Produces Twisted Finger And Artifacts

Hello guys,
I would like to ask about a problem I encountered when retargeting a character to UE4 mannequin humanoid rig. I have a model of a ninja originally created for and compatible with Unity’s Mecanim system (so it has a different skeleton compared to EPIC’s default UE4 rig).
I imported the character to Unreal and assigned proper bones for retargeting. All seemed right until I noticed strange pose of LEFT MIDDLE finger when retargeting standard UE4 mannequin Run (“Mannequin/Animations/ThirdPersonRun” is the proper path from default Content folder) animation to ninja character.
I understand that the pose of other fingers is also not absolutely ideal as they lean to one side a little, but this should probably be caused by slightly different retarget poses of both characters - so it was understandable for me.
Nevertheless, only the crooked left middle finger seems like it follows some different axis when rotation of bone is applied to it in the animation.
The problem is shown on three following images:

[another image][4]

Also I only noticed this behaviour with default third-person template run animation (when the character forms the fingers into proper fists). I tried a different animation, when the UE4 mannequin character clutches fingers - from “AnimStarter Pack” (specifically “Prone_Reload_Rifle”) and the finger seemed to move correctly.

After a few long nights trying I am still unable to isolate the problem.

I should add that I posed both characters before and retarget poses seemed almost identical (perhaps some minor adjustments could be done further). Also, all bones except for root and hips (pelvis) have translation retargeting set to “Skeleton”. Root and hips have “Animation scaled” option set.

To tell the truth, I am no artist, so I have only minimal knowledge about armature construction, so I am still learning. I tried to take a look at the skeleton with Blender where I noticed that fingers’ rig has different local axes’ orientation assigned to bones. I am attaching links to images comparing the orientation of bones in UE4 mannequin and ninja character.
I actually thought that the bones do not retain their local axes’ orientation upon import (only their location is preserved) and these are replaced by some globally calculated axes to account for pose equality.
The fact that bone orientation on ninja’s legs is also different from UE4 mannequin’s bone orientation and that legs work correctly after retarget could mean my assumption is partly right.

[ninja hand’s bone orientation][6]

[mannequin hand’s bone orientation][7]

There is another one small problem (also visible on previous images) that occurs when animation is running - artifacts caused by normal map when character’s skin is stretched to accomodate finger’s bone movement. I wonder, perhaps this also has something to do with the way bones move after retargeting (some slight twisting of fingers produces more visible seams) ? Is there any proper way to fight against such behaviour other than trying different retarget pose ?

Perhaps someone dealt with something similar and could provide a hint to where I am supposed to look to fix the animation.
Thank you very much.

Hey IndyJo,

I have been doing some retargeting skeletons myself and it very tedious to get right - especially using skeletons that don’t exactly match the UE4 skeleton.
My best guess for the problem is that the pose of the skeleton is not in the exact pose of the UE4 skeleton pose.
Another issue I have found is that if your skeleton is missing bones or the bone structure is not the same. I have a lot frustration with this myself and hope you get it working. In my experience I try to use the UE4 skeleton whenever I can.

Hello JayWebb,
thank you for your answer. I understand that many of the issues I mentioned could be solved by making the poses exact (the artifacts and fingers leaning outwards a little) or by swapping the entire rig with EPIC’s rig. Unfortunately, the theory behind retargeting makes me wonder why such a huge visible glitch only appeared in one of the fingers - this seems like there is something wrong with it and I would like to find out what it is (and also why it only appeared in one of the animations).
In order to find the core of the problem I tried messing with bone orientations but I guess this is not the problem.

Well here’s the page in the documentation.

https://docs.unrealengine.com/latest/INT/Engine/Animation/RetargetingDifferentSkeletons/index.html

Those strange artifacting problems can often be fixed by viewing the skeleton, pressing the button to show advanced and right clicking on the final bone in each finger to select “recursively setting translation retargeting to the Skeleton”. Here’s a youtube tutorial showing the technique being used if you’d prefer a visual example.

(between 13:40 and 15:40 on the video)

Not sure if that’s the specific solution to your issue, but hope that it may help.

1 Like

Hey guys, I read the documentation (and went through several videos on Youtube) and set the skeleton just like described. All bones except for root and hips (pelvis) have translation retargeting set to Skeleton. Root and hips have Animation scaled option set. The base poses for retargetting were very similar.

Thank you MKenner for the information, it was helpful but this eventually did not end up as a retargeting problem - I mean the twisted finger, not the normal map artifacts - these probably require a different solution.

Finally I found the error to be where I least expected it - being the animation from Mannequin folder in TPP Template itself: ThirdPersonRun.
Bones middle_02_l and middle_03_l have their axes’ orientation different from all the other fingers.
This cannot be seen very well when using the manneqin mesh as the mannequin’s fingers are divided to segments and each segment has its own bone - but you can see that they actually are flipped upside down when viewing from close distance. This can also be seen in the following image.

I exported the animation from Unreal, imported it to Blender (this process however created an animation with 16 frames instead of original 18, I do not know if this is an error or not, but the starting and ending frame seemed the same as in the original animation, so I continued), I changed the orientation of bones middle_02_l and middle_03_l to be the same as in the rest of the fingers and copied their pose to all the animation frames. I eventually ended up with what can be seen in the image below.

You can also find the exported animation in the following link - it is not perfect but it is the correction I was looking for (you can import it to UE4 by assigning Mannequin skeleton to it upon import).

[ThirdPersonRunCor][3]

What I found is that when re-targeting animation, even to a skeleton almost exactly like UE4 default, the finders local translation and rotation seem to ever so slightly “move” while when observing the same bone in the default skeleton on non-re-targeted (but identical) animation, the bones do not “move” in local space. Besides the fingers being “mangled”…

Look at the translation and rotation numbers, they should be identical but are not, and in the new skeleton and re-targeted animation they shift every frame, only by extremely small amounts, I don’t know if this is a floating point error…

Oh my god. I was having the same exact problem, the retargeted animation was perfect except for the left middle finger. I was trying everything, short of starting from scratch. Thank god I saw this post… Thank you hahaha