Search Unity

Need help with animation retargeting

Discussion in 'Animation' started by Cyber1551, Dec 29, 2021.

  1. Cyber1551

    Cyber1551

    Joined:
    May 20, 2018
    Posts:
    18
    Hello,
    So I have a model and a set of animations, both humanoid.

    Due to them being humanoid, unity handles most of the retargeting for me despite their hierarchy being different.

    However, there are 2 gameobjects located in the Hand_L and Hand_R bones in the animation that don't exist in the models avatar. This causes the animations to not work correctly.

    Inside the "Animation" window the 2 gameobjects are yellow as they can't be found.

    How can I add those two gameobjects to the model's avatar so the animation works correctly?
    Thanks in advance
     
    jeroll3d likes this.
  2. jeroll3d

    jeroll3d

    Joined:
    Nov 6, 2010
    Posts:
    249
    It's hard to help with little information and without seeing what's happening, what are these 'two objects', are they 'bones', something that we only find in the model (which generates the avatar) of the animation?

    A suggestion, make 'prints' and post here, I'll try to help with the little I know. In general, I always make my animations starting from the 'base' model (character itself that I'll use in the game). I always start from either 'T' or 'A' position, which makes it easier for me to some extent.
     
  3. jeroll3d

    jeroll3d

    Joined:
    Nov 6, 2010
    Posts:
    249
    Maybe some helpful suggestions.

    Always keep complete control of what you do or plan. Avoid using Mixamo animations, besides being horrible, aesthetically, you have the headache of having to re-edit 'frame by frame' when something is not good. Use Blender (or any other program) to get control of this. From a model, you can make a thousand different animations. Of course, it is labor intensive and takes time. But the advantages are immense compared to third-party animations.
     
  4. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84
    If this objects are not part of the humanoid Rig, there may be two reason for this :
    - check into the FBX model that contain the humanoid animation, under Rig panel, there is options that can cause you to not have some objects into the character's hireachie : Optimise Bones & Optimize GameObjects, disable both to be sure that you custom stuff his here.

    - (Humanoid Animation are editable if they are out of a fbx model) So try to to duplicate it out of the fbx model (ctrl+d), and then check the animation for the key's property you are looking for.
    You will not found your custom properties for the bones under the hands because Humanoid just translate stuff for HumanBodyBones description (avatar bones in humanoid mode) no custom one,
    but what you can still do is to duplicate the source FBX model a second time and put it into generics, look at the animation property for the local transform you want into this model, then just copy/paste the related keys/animations properties of your custom objects into the humanoid animation, as it is transform properties for existing objects in your Character hierachie, it will work and follow the hand, applying your "local transform keys" by the way.
    And so on, you can edit your humanoid animation or create animation layer to add/copy/paste this "local transform properties" keys for this objects into the humanoid animation.
    The correct way to work on this stuff is to create a layer synchronized (because you may use some more stuff and hand's stuff animation, like VFX trigger, IK constraint or whatever and so you could adjust it into the animation tab and direct access to control weapon's animation stuff for exemple...)

    So you will never really address this hand's object to the avatar (we can't), so just put the animation data for this GO transform into animation and it will work if the GO is a Hand's child, I remind that is something that Humanoid setup don't "translate".
    Hope it help, gl!

    ps : I have a pretty simple "mass import" process for humanoid stuff, with just 3-4 steps for importing and start to use a full library of animation like mixamo, blended with custom stuff, i'll share process asap.

    @jeroll3d : I agree yes, Mixamo is like Mocap data, if you don't clean it with curve filtering in third party like maya, you will just to many key to edit so it's impossible, it will be horrible to edit. (but It's just a 10 sec operation on Maya for an animator to simplify curves and keep only 10% keys, so even on mocap data it's doable, but not in Unity, only in third party like Maya).
     
    Last edited: Dec 30, 2021