0 votes
asked in General Help by
Hi,

I've been fiddling around with UMotion for 10-12 hours now and still can't quite grasp it. I'm hoping you can give me a step-by-step walk through for what I'm trying to do.

Here's my current workflow:

0. Import my Character, set 'Animation Type' to humanoid, and create an 'Avatar Definition' from this model. So far so good.

1. Import Generic motion capture animation from another unity scene (.anim format -only option when using Gameobject Recorder).

2. Add a Two-Handed sword object to my Character by parenting it to his 'Hip' bone, as suggested in another answer on here: https://support.soxware.com/566/how-to-set-up-holding-a-two-handed-weapon?show=569#c569

? - I want the sword to be "stuck" in the ground and not moving for a portion of the animation. Parenting the sword to the 'Hip' bone prevents me from being able to animate the hips without moving the sword too. I wasn't able to attach the sword to the root instead because my root doesn't seem to be classified as part of the rig. Not sure what to do here! I do want the hands to be "stuck" to the sword handle so they will move when I animate the sword movement and stay in place when the character animates around the "stuck" sword.

2. Duplicate my Humanoid Character and change the rig type to 'Generic'.

3. Create a 'Generic' UMotion project and import the mocap clip using the duplicated Generic Character. These clips are normally quite long because you can't trim .anim files in the Unity inspector 'Import' options like you do with .fbx (as suggested in your video tutorial).

4. Create another UMotion project, this time 'Humanoid'. Use the original 'Humanoid' Character as the animation target.

5. Import the 'Generic' UMotion project into the 'Humanoid' UMotion project to convert.

6. Create an IK Rig using the wizard.

7. Convert the animation from FK to IK.

8. Uncheck 'IK Pinning' on the Right and Left hand IK Handles.

9. Set the Sword as a parent in the 'Channels' for each hand and remove the IK Handle 'Position' keyframes.

? -  In half of my attempts, this stage works perfectly in UMotion but in the Unity the hands will drift away from the sword even after following the advice in other answers. I made sure there was no root motion and set a keyframe for every property.

10. Now I cleanup and adjust the animation by following the tips in your "Editing Existing Animations" video tutorial.

11. Export the entire animation clip as .fbx because I need to trim the animation.

? - I'm still not sure if there is a better way to trim the large mocap animation into smaller separate animations for each action.

12. The .fbx is exported as 'Generic' and works! But only if I use the 'Generic' 'Avatar' definition created by UMoition.This won't work because I need to use the same Humanoid character rig for several animations.

13. Change the exported .fbx from 'Generic' to 'Humanoid' in the Unity inspector. !Error: Avatar rig configuration mis-match! Attempting to create the Avatar definition from this model causes the same error.

? - Aside from all my other questions about odd behavior, I'm not sure how to manage all the 'Avatar Definitions' at this point or even how to set the exported animation to 'Humanoid' even though it was exported from a 'Humanoid' UMotion project.

This has become incredibly complex and frustrating. Am I trying to do too much with UMotion? I have 8 playable characters that each have half a dozen animations, so I'll need to repeat this process 48 times. I would really appreciate a streamlined step-by-step as well as any other help you could provide.

Thanks

1 Answer

0 votes
answered by Expert (155k points)
selected by
 
Best answer

Hi,
thanks for your support request.

I want the sword to be "stuck" in the ground and not moving for a portion of the animation.

Just verified this to be completly sure. You should be able to select the top most transform (i.e. the Root transform) as a parent in the Child-Of constraint:

I'm not sure how to manage all the 'Avatar Definitions' at this point or even how to set the exported animation to 'Humanoid' even though it was exported from a 'Humanoid' UMotion project. 

The best approach would be to just set the rig type to humanoid and set Avatar definition at "Create from this model". If you get an error click on "configure" and try to fix it. A typical problem is that your reference pose in UMotion is not a T-Pose. If that is the case, you need to manually click on "Pose --> Enforce T-Pose" in Unity's Avatar editor or set UMotion's reference pose to T-Pose and re-export.

Configuring the avatar only needs to be done once. When exporting the animation again, UMotion will keep all existing settings done for that *.FBX.

I'm still not sure if there is a better way to trim the large mocap animation into smaller separate animations for each action.

You can cut them inside UMotion or in Unity. It's probably easier to deal with smaller animations inside UMotion so you might consider cutting them there. Duplicate the whole clip (clicking on the duplicate button). Then in the duplicated clip, use the white arrows in the time ruler to define the part of the animation you want to keep. Click on "Edit --> Crop to Playback" to remove all keys outside of the defined area.

In half of my attempts, this stage works perfectly in UMotion but in the Unity the hands will drift away from the sword even after following the advice in other answers. 

Try to preview the animation with your model inside Unity's Preview Window (usually at the bottom left) and make sure to enable "IK". This will use Animator's IK to correct any drift introduced by the humanoid animation re-targeting.

One big problem I see here is that your sword is a generic bone and that the humanoid animation system can't re-target your sword. So when the sword is a parent of the Hips (inside Unity's Hierarchy) and you used the Child-Of constraint to parent it to the hands, might probably only work for exactly that model you've worked with in UMotion. As soon as you re-target that animation to a different character you might get problems. The swords position is measured relative to the hips of a character with different proportions than. So it might appear at a different position relative to the hands. I'm not 100% sure if tha Animator's IK system can compensate that.

So I would recommend you to test that. If that's an issue, it might be better that you put the sword as a child to the right hand (in the hierarchy).

If you're aiming for the visually perfect solution, then you're only option is to use generic for all your characters and then correct the animation by hand for every character. Animation re-targeting (humanoid) is just an approximation method and will never produce 100% perfect results.

Am I trying to do too much with UMotion?

I don't think so. You just need to fiddle a lot with the Humanoid animation system which can be quite cumbersome. I good understanding of what the humanoid animation system is all about is definetely an eye opener in some situations so I really recommend to read this blog post: https://blogs.unity3d.com/2014/05/26/mecanim-humanoids/

Other than that I think your workflow is OK as it is.

Please let me know if you have any further questions.

Best regards,
Peter

Soxware Support

Here you get official product support by the developer and the community for all Soxware Products for Unity®.

Post as guest, login via Facebook or create an account.

Ask questions, report bugs or provide feedback. Please use the correct category and always post in english.

For private email support, please use the Support Form to create a support ticket.

Copyright © 2017 Soxware Interactive | All Rights Reserved | Impressum

...