1
$\begingroup$

this is my first time posting a question on online forums. I am relatively new to blender and have been working on an attack animation for the past few days. I've been using the Mr. Mannequin add-on to streamline the process of importing the animation to unreal engine 5, however, I've run into a problem near the end of the animation.

When I've copy pasted my first key-frame (which is basically the 'default fighting stance'), to the very end of the animation, my mesh deforms really weirdly in between the 2 last key frames. Here's a gif of what it looks like.

Deforming Animation

From scouring the internet in the last few days, I think the problem stems from the way Quaternions and Euler's are calculated in blender. However, I haven't found a way to the fix the problem.

Any helpful tips or just an explanation on what to do will really help.

You can find my project at Paste all here

Thanks in advance, Silver

EDIT 1: Here's my new file moonboots: https://pasteall.org/blend/006ee94f23f44211856d65cb010e240b

EDIT 2: Hey guys, I've managed to fix my animation by just brute forcing it and adding keyframes in between the 2 problem frames and I'm pretty happy on how it's looking right now: here's my improved animation.

There are a few areas I'd like a bit of advice on though:

  1. While all the other bones look good, the left leg still seems a bit jittery on the last segment.

  2. If you look closely at the part where the kick happens, right after when the legs are beginning to retract, the entire mesh seems to have moved backwards on the y-axis. I don't know how and when this happened but I was wondering if there was a way to move this and all subsequent keyframes along the y-axis a certain distance at the same time.

  3. Finally I was wondering how to speed up the entire animation as a whole.

Thanks a lot in advance, Silver.

Final Edit: Hey guys, I've been working on the animation for the last couple of days and I think I've finally done it:

Thanks to everyone who helped me, Silver.

enter image description here

$\endgroup$
0

2 Answers 2

0
$\begingroup$

I have trouble recreating your problem. It doesn't show up on the animation that runs in the file you provided, not on my machine. Duplicating all bones' frames from frame 1 onto frame 50 gives me a different animation-- there's a problem, but it looks a lot different than what you're showing. So I can't be certain that I'm addressing the exact problem you're experiencing. But I can guess at what the issue is:

For any orientation, there are two different quaternions that represent it: one with a positive W, and one with a negative W. However, they are interpreted by Blender as rotation in opposite directions. If you interpolate a bone from the positive W quaternion to the functionally identical negative W quaternion, you will see the bone go through a full rotation-- up to two full rotations, actually. This happens frequently when you have spinning models.

If you're working with different engines, and you're not baking animations, it's not always necessary to fix this. Blender handles quaternions differently than most animation engines do (most animation engines run quaternions as "shortest path" rotation, so the direction is never encoded in the sign of the W component.) You'll have to see in your own engine, with the techniques you plan to use, if there is a problem.

The fix to this is to use two closely spaced keyframes at the problematic frame, each with different W signs. If two keyframes are on adjacent frames, the extra rotation will never be seen (except if you're doing motion blur or something, then you have to be more careful.) A different way to do this is to use constant interpolation for the section where the W sign flips.

You can find problem places wherever a bone's W component crosses the X axis. My knowledge isn't perfect, but the first thing you should consider to fix the interpolation is just scaling later keyframes' W by -1 to stop it from crossing the axis. This should usually get you the same orientation (but I've seen times where it hasn't, and I don't know why, so that's why I don't have a lot of confidence in my understanding of it all.)

This can be a little tricker for blended animations in the NLA. You should expect NLA blending to behave the same as game engine blending, so if you're rendering elsewhere, test your animation blending where you're rendering and forget about NLA. When I've had trouble with NLA work in Blender and animations that started/began with different W signs, I've managed it by creating blend-out strips on hold to hold the quaternion sign until the exact beginning of the next strip.

There is discussion among Blender developers to change the way Blender handles quaternions (to add "slerp" interpolation) so hopefully some day this will no longer be an issue.

$\endgroup$
2
  • $\begingroup$ I see thanks a lot for the explanation. If I understand correctly you're asking me to first test the raw animation in the game engine I'm planning to use to check if the problem carries over and if it does, you're asking me to multiply all the bone W values by -1 where the problem happens. Right now, I've kind of fixed the animation by just brute forcing every frame in between the 2 frames where the problem happens, but I'll definitely give your suggestions a try in case they turn out to be more efficient ways of dealing with the situation. Thanks, Silver $\endgroup$ Oct 27, 2021 at 10:04
  • 1
    $\begingroup$ Hey Nathan, I tried playing the animation in unreal engine and unfortunately the deformation carries over. I've also tried to invert all the W values I've had no luck with that either. Good thing is I've got the overall animation working correctly now so it should be completed in a few more days. Thanks for your help, Silver $\endgroup$ Oct 28, 2021 at 20:31
0
$\begingroup$

You need to keyframe your legs IK controllers and IK pole targets, they have no keyframe during the final rotation so your legs begin to cross and go mad. Here I gave them some keyframes:

enter image description here

See the final kick, I've moved the knee pole target away and it works fine:

enter image description here

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.