Answered

How to rotate / translate the whole animation (all key frames) globally (additive layer not in global coordinates)

Robert 4 years ago updated by Peter - Soxware Developer 2 months ago 3

Hi,

I have a number of motion capture animations that start with a T-Pose that's oriented in-line with one of the depth cameras used for motion capture, which determines the orientation of the global coordinates. These animations then include some exercise animations that are performed diagonally and offset from the origin, based on the location of an exercise mat, and maximising visibility from multiple cameras.

I have a number of these animations which I want to have a consistent origin and rotation that corresponds to the center of an exercise mat.

I've seen others asking similar questions and I have experimented with the possibility of using an additive layer or translating the x/y/z position key frames and converting the pelvis rotations to euler and translating the euler component key frames.


The problem with those options is that they are applying the rotations in the wrong coordinate space - the coordinates of the pelvis, but I'm simply trying to rotate everything in global coordinates.


I want to effectively rotate/translate the root bone, not add a local-coordinate rotation to the pelvis for every frame.


Currently I can manage the translation with an additive layer ok, but if I try and rotate everything then I end up tilting my whole animation instead of rotating everything in global/world coordinates.


This feels like it must be a common requirement to be able to rotate an animation to fixup its orientation so I'm hoping there's some trick I'm missing here?

Any help much appreciated!



UMotion Version:
1.20p08
Unity Version:
2019.2.20f1

Answer

Answer
Answered

Hi,
thank you very much for your support request.

Yes a rotation that is applied to the hips/pelvis does not rotate the translation of the hips/pelvis (that's due to the order how Unity applies those transformations).

The easiest way to rotate the whole animation is via the inspector of your animation:

If you change this setting before you import the animation to UMotion, UMotion is going to bake the offset into the animation.

When exporting to *.FBX (from UMotion) you can also use the "Rotation Offset" shown in the "Export Settings". For further information, please refer to the manual (click on the question mark in the UI).

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

Best regards,
Peter

GOOD, I'M SATISFIED

Thanks, yeah, handling this via Unity's import settings seems practical here. Thanks again!

Satisfaction mark by Robert 4 years ago
Answer
Answered

Hi,
thank you very much for your support request.

Yes a rotation that is applied to the hips/pelvis does not rotate the translation of the hips/pelvis (that's due to the order how Unity applies those transformations).

The easiest way to rotate the whole animation is via the inspector of your animation:

If you change this setting before you import the animation to UMotion, UMotion is going to bake the offset into the animation.

When exporting to *.FBX (from UMotion) you can also use the "Rotation Offset" shown in the "Export Settings". For further information, please refer to the manual (click on the question mark in the UI).

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

Best regards,
Peter

Hi, I have the very same problem but with shifting the whole animation onto zero point. I work a lot with mocap animations and always need to shift every each keyframe to same vector for hips position track. The root rotation change I do exactly as it was described before. But position shift is still a problem. I tried to select all keys in Umotion, but changes is always applied only to the first key. Finally, I end up by wrote own external script to do this shifting, just because couldn't find any proper solution for this problem. So, Is there any way to do this? With Umotion or any other way? Maybe this solution already exists, but I missed it?

And Another thing that I think should be very useful - is to add some video/image reference player, same as it was in old MMD app. Often happens that there is a real need to create animation from a video example, but it is so crazy difficult to open in some vireo editor video file at exact time create screenshots and build a pose by screenshots imported in unity. I think this procedure must be much easier: like just open video behind the unity scene and by umotion select videoframe at some timepoint and build pose right at the spot. And see animation and video mismatches when animation plays along with video.

Hi,
yes this is indeed possible with UMotion. Create a new animation layer of type "additive". At frame 0, move the character's hips to the position you want it to be and save the change as a key frame. This change is now added on-top of the existing animation affectively offsetting the entire animation.

Related page in the manual: https://www.soxware.com/umotion-manual/Layers.html

Video Tutorials using animation layers:

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

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

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

Best regards,
Peter