Answered

Import Animation Issue

tom 8 months ago updated by Peter - Soxware Developer 8 months ago 4

First thanks for the great tool! However I have a issue I'm puzzling over.

I have some mocap FBX. I want to edit it in Umotion to tweak them.

Each FBX has been exported together with its model. I import the FBX as humanoid rig - everything is fine..

No Umotion:

When I play the animation in Unity straight from the imported FBX on its original model everything looks good - the arms are where I expect.


In UMotion.

I take the same model, make a new UMotion project, drag in the model and set it up in the Pose Editor as per instructions. Then I import the same animation clip from the FBX file into Umotion and play - but now the arms intersect the body and whole body position is different.

See photos below - I placed two models side by side at same frame in the same scene, one with Animator the other in UMotion, but with same model and animation.

Any tips, settings I need to look at??


UMotion Version:
1.20p08
Unity Version:
2019.2.21f1

Answer

Answer

Hi Tom,
thank you very much for providing all this very detailed information.

When importing the animation and comparing it to the original, I get the same rotational difference as shown in your screenshot. The difference is coming from the non-humanoid bone named "hips":

UMotion stores the rotation of non-humanoid bones only once (when assigning the character to the Pose Editor). This pose is then saved as "reference pose". When importing/exporting an animation, generic bone are always kept at reference pose (as it is a non-humanoid bone it is not animated). In the case of your character, Untiy seems to treat this bone differently though: As soon as the Unity plays your animation once, it actually modifies this hips bones orientation. UMotion keeps using the old value and this is causing the difference that you see.

In this screenshot you see your model added twice. One model played the animation once (using Unity's animation window) and the other never played the animation. Notice how the hips suddenly have a different position/rotation on the character that already played your animation.


There is an easy fix to get the correct Hips orientation into UMotion:

  1. Preview the animation on your character using Unity's animation window.
  2. Stop the "Preview".
  3. Assign the character to your UMotion project. If it's a fresh UMotion project, you're already done (UMotion now uses the correct hips orientation as reference pose).
  4. If it's an existing UMotion project, go into Config Mode and click on the "Apply Scene Pose" button followed by the "Save Reference Pose" button. This saves the new hips position/rotation into your reference pose.
  5. Re-importing your animation is not needed, they should be perfectly equal now.
  6. Re-exporting your animation is necessary.

I have to think about what I can implement to avoid such a situation in the future...

Subtle differences (in the range of a few millimeters) can still happen (this is expected due to the lossy nature of the humanoid animation system). If you want a more direct (lossless) approach, use your character as generic. Then export the animation into the *.FBX of your character (set "Write Mode" to "Update Existing File"). Once done, change your character's *.FBX back to "humanoid".

Best regards,
Peter

GOOD, I'M SATISFIED

Thanks a lot - using Update Existing File works great for me and solved the issues.

Satisfaction mark by tom 8 months ago

When in Config mode using the scene pose everything looks the same:

As soon as click in Pose Mode the object moves back. Presumably this is because it applies the first frame of animation, but now its not in the same pose as the first frame of the original animation.


Answered

Hi,
thank you very much for your support request.

UMotion imports your animation with the Unity Animator IK being applied by default. Unity plays an animation with Animator IK being disabled by default. So please try to re-import your animation but with "Animator Foot/Hand IK" being disabled to get the same hand/foot pose:

If this doesn't completely solve the issue, could you send me your *.FBX (with the character and the animation) so that I can further investigate? You can send it to me via the email support form. Thank you very much.


Best regards,
Peter

Thanks I've just submitted a request as per below:


Reproduction steps:
1. Set up new Umotion project and scene in Unity
2. Import the attached model file and set to Humanoid.
3. Add the model to the empty scene.
4. Add her to Pose Editor and accept dialog, don't import blendshapes.
5. In Umotion - import the animation clip that was in the model file. Setting Hands/Feet IK to Off, Loseless
Note Once this imported, the character has change their pose is now rotated leaning backward (not sure why?)
6. Export this clip out again (without making any changes)
7. Play the clip on the same model and compare to playing the original animation - the position of body/arms has changed causing intersections.


This image shows same model, same animation superimposed on each other... grey is original FBX animation, red is imported/exported straight out of Umotion with no changes.

Answer

Hi Tom,
thank you very much for providing all this very detailed information.

When importing the animation and comparing it to the original, I get the same rotational difference as shown in your screenshot. The difference is coming from the non-humanoid bone named "hips":

UMotion stores the rotation of non-humanoid bones only once (when assigning the character to the Pose Editor). This pose is then saved as "reference pose". When importing/exporting an animation, generic bone are always kept at reference pose (as it is a non-humanoid bone it is not animated). In the case of your character, Untiy seems to treat this bone differently though: As soon as the Unity plays your animation once, it actually modifies this hips bones orientation. UMotion keeps using the old value and this is causing the difference that you see.

In this screenshot you see your model added twice. One model played the animation once (using Unity's animation window) and the other never played the animation. Notice how the hips suddenly have a different position/rotation on the character that already played your animation.


There is an easy fix to get the correct Hips orientation into UMotion:

  1. Preview the animation on your character using Unity's animation window.
  2. Stop the "Preview".
  3. Assign the character to your UMotion project. If it's a fresh UMotion project, you're already done (UMotion now uses the correct hips orientation as reference pose).
  4. If it's an existing UMotion project, go into Config Mode and click on the "Apply Scene Pose" button followed by the "Save Reference Pose" button. This saves the new hips position/rotation into your reference pose.
  5. Re-importing your animation is not needed, they should be perfectly equal now.
  6. Re-exporting your animation is necessary.

I have to think about what I can implement to avoid such a situation in the future...

Subtle differences (in the range of a few millimeters) can still happen (this is expected due to the lossy nature of the humanoid animation system). If you want a more direct (lossless) approach, use your character as generic. Then export the animation into the *.FBX of your character (set "Write Mode" to "Update Existing File"). Once done, change your character's *.FBX back to "humanoid".

Best regards,
Peter