Answered

Reverse animation so that root motion's origin is also reversed

Anonymous 1 year ago updated 11 months ago 8

I'm finally able to go back to using the animation I created in November. Well, I want to use the reverse of it.

I keyframed the animation of boarding the bike. Perfect. I can use it in the scene. It looks like it applies the root motion as expected, throughout.

I then duplicated the clip, selected all, and reversed the keyframes. Also seems great when I scrub through the animation in UMotion, the character hops off the bike and is left standing where he started on the boarding animation.

But now I am realizing that the reversed keyframes must still measure everything relative to the original position on the ground, not the seated position. I was expecting to be able to play "boarding" to board, and then "leaving" to get back off the bike. When I try to run the "boarding" then subsequently the "leaving" clip in the game, the first frame of the "leaving" animation jumps 90º and a bit off, then clambers backwards and ends up somewhere in the front tire looking backward.

After reversing the keyframes, is there a way to say "hey, frame 1's position is the starting root position, everything else is a delta from that"?

I'm sure people have done similar things with boarding/exiting ladders and other situations. What am I missing?

UMotion Version:
Unity Version:

Answer

Answer
Answered

Hi,
thank you very much for your support request.

You might want to check out the root motion settings of the exported animation clip. Select the exported clip, then in the inspector you get a lot of different root motion settings:

Image 1288

More information about root motion: https://docs.unity3d.com/Manual/RootMotion.html

Please let me know in case you have any follow-up questions.

Best regards,
Peter

Answer
Answered

Hi,
thank you very much for your support request.

You might want to check out the root motion settings of the exported animation clip. Select the exported clip, then in the inspector you get a lot of different root motion settings:

Image 1288

More information about root motion: https://docs.unity3d.com/Manual/RootMotion.html

Please let me know in case you have any follow-up questions.

Best regards,
Peter

That got me a lot closer, but there's still a Y offset I will have to patch over in code, since the ending position of the forward animation does not align to either the Original nor the Feet nor the Center of Mass of the start of the reverse animation.

You can apply an Y offset via this field:

Image 1289

You could also try to let UMotion generate the root motion curves for you instead of Unity:

https://www.soxware.com/umotion-manual/ClipSettings.html

Please also note that this might have something to do with the root motion settings of your starting animation.

Best regards,
Peter

I still would like to have some way of "shifting" a whole animation's keyframes to make starting or ending poses end up exactly where I want them.  If I re-open a project, but the character is not exactly at the right spot for a specific clip that I want to edit, I end up with the animation jumping on frame 1 to some other position.  Same thing happens if I change which clip I want to edit.  I tried to edit by selecting the keyframes in the Curves editor, and shifting all the Y components, which kinda works but has problems with pinned keyframes.

A lot of my cases involve a person "boarding" a vehicle or ladder, so the body is rotating and shifting throughout the animation.  Getting them aligned every time I want to make minor changes is eating up a ton of time.

For example, I tried to go back to edit this ladder clip, because frame 1 has a big unintended jump.  If I set the character exactly where I thought frame 1 was supposed to be, then add him in the Pose window, he suddenly jumps up 3m and turns 90º.  The animation carries on from that point, but with that frame 1 jump, it's useless and I will have to basically do it all over again.  I can't just shift keyframes down because the IK pins don't follow.

he suddenly jumps up 3m and turns 90º

Sounds like you've initially animated the character on the ground. That "jump" is a result of the position/rotation offsets stored in frame 0 which are then added to your characters current position/rotation when added to the pose editor. 


I still would like to have some way of "shifting" a whole animation's keyframes to make starting or ending poses end up exactly where I want them.

You can add offsets to your animation by using an additive animation layer. On frame 0 of the additive animation layer, offset everything to the position you want it to be and then create key frames for all modifications. this offset is applied to the whole animation.


More information about animation layers: https://www.soxware.com/umotion-manual/Layers.html

Video tutorial that shows the basic principle of additive animation layers: https://www.soxware.com/umotion-manual/InPractice2.html


Please let me know in case you have any follow-up questions.

Best regards,
Peter

Disappointing answer.  The animation asset has data that your tool cannot edit.  I will just redo the animation.

I guess in the future I will just save an entire scene for every animation, so that the initial character position is properly preserved, in case I ever need to go back to edit one.