Search Unity

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,738
    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

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,674
    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,608
    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

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,674
    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,738
    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,738
    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,738
    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:
    107
    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:
    30
    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?
     
unityunity