Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Humanoid Rigs and extra bones?

Discussion in 'Animation' started by Antony-Blackett, Oct 13, 2015.

  1. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Is it possible to get a humanoid Rig in unity to animate extra bones that aren't set on the humanoid rig in unity?

    We have a few extra bones we need to animate on our character but I'd also like to take advantage of the humanoid 'Mirror' functionality. The extra bones we want to animate are weapon attachment points and also a helmet attachment point (that bobs around when the character runs so we can't just attach it to the head). We've also got a couple extra bones in the face of our character to move his eyebrows and get a little more expression going.

    It seems odd to me that the Humanoid Rig can't handle extra bones as this seems severely limiting to anyone that wants to use it for a character that has a tail or a hair or anything like that...

    Is there something I'm missing? Or is it simply not possible to have animating bones that aren't part of the standard Unity Humanoid Rig.

    P.S. I know I can use a Generic Rig but this means I cannot use the Mirror function in the Animator and I'll need to double up on all our animations on import... increasing data and making the animator controller more complex so if i can use a humanoid I'd like to.
     
    mandisaw and theANMATOR2b like this.
  2. trasher258

    trasher258

    Joined:
    Apr 2, 2013
    Posts:
    21
    I don't think it's possible to append additional bones as the slots that you can assign bones to on an Avatar asset for Humanoids appears to be fixed. If there's some hidden button that allows you to add additional slots for unique appendages such as tails, I haven't found it yet.

    It feels odd that it's limited to Humanoid skeletons only because from my understanding, isn't retargeting just transferring transform data from one bone to another? That would mean that as long as two hierarchies are similar to each other, it'll retarget just fine, quadruped to quadruped, biped to biped, ship to ship, etc. so having it limited only to bipeds seems rather silly to me.
     
    mysticvalleycsa likes this.
  3. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Yes you can animate extra bone with a Humanoid rig, by default extra bone animation are not imported. You need to explicitly open the mask foldout in your model importer setting and select the extra bone that you would like to animate.

    mask.png

    That been said, extra bone animation won't be retargeted automatically like all the human bone. The only way to have extra bone retargeting is to have identical rigs: same transform hierarchy with same name.

    Human bone are retargeted using the mecanim muscle retargeter: a FK pose from the source avatar is converted to a muscle pose(there is a predefined set of muscle and this is why we have predefined set of human bone) and then the muscle pose is converted to destination avatar FK pose.

    For Extra bone animation, if both rig match the animation curves are simply played on the destination avatar. This has some limitation like if both rig match but have different proportion, longer arm or leg, the retargeting may not look good.
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Mecanim.Dev: Hello there, if I may ask, does mecanim actually do any retargeting in scope of modifying animation data of extra bones, or does it simply copy/transfer matching tracks? To me it sounds it only does matching of object A animation tracks to object B.
     
  5. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Exactly, animation curve from A are used directly to animate B.
    This is why i'm saying that if both rig have different proportion you may not get the same exact result.
     
  6. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I have selected the extra bones in the importer mask for all the animations and they were all already checked so something else is going wrong here... I've logged a bug (case #736277). It's got my character setup with a Humanoid Rig and another with a Generic Rig so you can see the difference.

    I noticed the Humanoid Rig has a warning on the importer that you can see in the image, would that mess with the extra bone animations?

    Screen Shot 2015-10-15 at 10.53.56 am.png
     
  7. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Omg! I fixed it!

    So just out of curiosity I uncheck the Hero_Mesh box on the mask and now it's all working, minus the jaw looking a little bit different due to the translation warning.

    What I find strange though is that with that box checked on a Generic Rig it all works fine so it seems there's still some issue here.
     
    Last edited: Oct 15, 2015
  8. super-wind

    super-wind

    Joined:
    Jan 6, 2015
    Posts:
    3
    I know this is an old thread but it seems like the Mirror function for extra bones doesn't work well, extra bone's animation getting pretty weird after mirror, anybody got a clue about that? thanks.
     
  9. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Yeah I think in my experience mirroring only really worked on the default humanoid skeleton bones.
     
  10. Tracer2069

    Tracer2069

    Joined:
    Jan 1, 2021
    Posts:
    1
    tailissues1.png tailissues2.png hey, really old thread but probably the only place i can really ask anyone for help. ive been trying to get an animation to work with the tail, i selected and enabled the tail bones, not the mesh, but it still doesnt animate. im not sure if its supposed to show on the avatar but it isnt enabled there either. if anyone knows why this may not be working for me, please help
     
    TigerHix likes this.
  11. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    this was very helpful. thank you! I think this should be added into an official manual somewhere
     
  12. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    69
    Same issue, above fixes didn't fix it for me. I still do not have the extra bones animated even if I toggled all nodes in the avatar mask.

    I am also pretty sure I have the same transform hierarchy. My .fbx object is like this in the Project window:

    ▽ Prefab
    Arm
    Mesh
    Avatar

    And in the avatar mask section of the import window, it shows:

    Use | Node Name
    √ Arm
    √ Mesh

    So by @Mecanim-Dev 's suggestion, the animation should animate the extra bones; but it doesn't. If I change my model to a generic rig, then I see the extra bone animations.

    Anyone could provide some pointers?
     
    somkin0 and Yamitachi like this.
  13. Predacom

    Predacom

    Joined:
    Mar 2, 2015
    Posts:
    6
    Coming back to this threat I just wanted to leave a post with note
    Humanoid rig has issue dealing with animation that are made far from center of world (something like 100 meter from center, for cinematic purpose), SPECIALLY for extra bones.
    the precision goes all crazy, so I just decided to stick with generic, ik thing I will need to rely on some third party asset like Human IK.
     
  14. FellowPlayer123

    FellowPlayer123

    Joined:
    Dec 23, 2016
    Posts:
    114

    How to apply those extra bones to all animations that are inside FBX file? When I apply it only applies to the current selected animation.
     
  15. Haapavuo

    Haapavuo

    Joined:
    Sep 19, 2015
    Posts:
    97
    We are also stuck here. This is a terrible situation. We cannot create any facial animations because we are relying on eyebrow and lip bones that do not exist in the humanoid rig...

    Where can I even find that Mask Foldout on Unity 2021.2? Seems like it just doesn't exist anywhere. Our model does not have animations within. We are using external animation files instead.
     
    Last edited: Oct 13, 2022
    a436t4ataf likes this.
  16. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,539
    Seconding this, this is extremely annoying when dealing with characters that have a lot of animations.
    We use some third party animations as well so our rigs need to be Humanoid for the retargeting. Sorry but it baffles me there isn't a checkbox to just "Include all bones in Humanoid animations". Having to manually set the mask on each animation is a huge workflow impedance.

    For anyone with this issue, I've made a simple importer to solve the problem:
    https://gist.github.com/Invertex/21d1ede1d5fa722afbfa6c36ce37d411

    Just put the script in an Editor folder somewhere in your Assets (can be a sub-folder), and edit the
    restrictToPathsContaining
    line to choose what paths you want to restrict to. Partial paths supported.
     
    tsukimi likes this.
  17. rtcheteden

    rtcheteden

    Joined:
    Dec 30, 2020
    Posts:
    22
    so my problem was how i transitioned between animations so its worth checking youre code if youre using ANYTHING BUT animation.play in code (you wont get this problem if not animating through your own code and are using something like unitys animation tab with bools to trigger) and the above post is a problem with humanoid rig, ANY BONES NOT MADE FOR THE HUMANOID RIG WILL NOT WORK WITH THE HUMANOID RIG ENABLED, for any characters like the above post or my character with a tail and no legs (and a melee weapon as a bone from blender because i use the dynamic parent add on to animate that) you need to use another rig type, it may be the same with extra bones like shoulder turrets or weapons even on a human rig but i havent tested this