Search Unity

Generic Animation: Is there a way to mirror generic clips?

Discussion in 'Animation' started by robman88, Jun 10, 2015.

  1. robman88

    robman88

    Joined:
    Feb 21, 2015
    Posts:
    12
    Hey, I chose to go with generic animation instead of humanoid for aesthetic reasons for my 3D side scroller game. I've come to the point where I'm ready to mirror my anims now but I can't seem to find a way to do it with Generic.

    The mirror check box is there in the animator but has no effect. Does anyone know if it is possible to mirror a generic animation? If not are there any other methods of gaining the same results without having to animate everything again?

    Many thanks! Rob
     
  2. Adrian-Anta

    Adrian-Anta

    Joined:
    Oct 26, 2012
    Posts:
    35
    As far as I know you don't have that option, it's available only for humanoid rigs.

    In this post (mirror clips) you can find an editor script which allows you to get it. You have to decide if it's worth the CPU overhead of this script compared with the memory overhead of having 2 animations.

    Another approach nobody seems to like is to swap the local scale of the mesh to -1. It's worth a try though.

    I hope this helps.
     
    LabOSM, Azurne and theANMATOR2b like this.
  3. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    We cannot mirror generic animation because we don't know if the hierarchy can be mirror. For a humanoid rig there is a pre define set of transform that must be there to apply an humanoid rig so it pretty easy to mirror such a rig, For generic it could be a chair, a door, etc...

    This is not recommended, as negative scaling a skinnedMesh can lead to performance issue.
     
  4. robman88

    robman88

    Joined:
    Feb 21, 2015
    Posts:
    12
    Hey man, thanks for replying.

    Ah ok, thanks for the info. I would use a humanoid rig, but I cant animate the translate on bones and create the bouncy/stretchy aesthetic im looking for. So I'll just put in the extra effort and get animating.
     
    theANMATOR2b likes this.
  5. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    We did add support for Translation animation on Humanoid rig in 5.2 to improve Biped support. We are supporting right now a few bone only: Upper Leg, shoulder, spines and neck.
    But eventually we would like to add support for more bone
     
    robman88 likes this.
  6. robman88

    robman88

    Joined:
    Feb 21, 2015
    Posts:
    12
    ah wow. That would be fantastic!
     
  7. robman88

    robman88

    Joined:
    Feb 21, 2015
    Posts:
    12
    Sorry, just to clarify. When you said 5.2, you did mean 5.2 right? Not the 5.1 that just came out to the public?
    So it'd be out in a few months or so?

    Many Thanks!
     
  8. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    right, When I said 5.2 I was meaning 5.2 which is not yet available
     
  9. Deleted User

    Deleted User

    Guest

    when is 5.2 available? for using generic couldn't you just allow mirroring and it be up to the developer to ensure the skeleton can mirror? if breaks or looks dump then it's my fault. this would be more flexible and would allow non-biped to mirror. Or allow us to create a skeleton mapping in which you could use to mirror.
     
    adamvfc, artaka and awesomedata like this.
  10. legoblaster1234

    legoblaster1234

    Joined:
    Aug 7, 2017
    Posts:
    27
    2020 and we still don't have this. I really need it. I don't want to try and make two different animations that look exactly the same.
    I can't use the Humanoid avatar option because it buggs out my animations and just isn't worth the effort
     
    adamvfc likes this.
  11. thePostFuturistUnity

    thePostFuturistUnity

    Joined:
    Nov 16, 2012
    Posts:
    53
    ^^ same here. I have to use Legacy everything and flip the scale, damn the performance cost.
     
  12. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    167
    I really need this too, having to copy and edit every animation by hand is incredibly time consuming, not to mention finding the correctly mirrored rotations :/
     
  13. BIGTXY

    BIGTXY

    Joined:
    Jan 20, 2017
    Posts:
    7
    Thanks for the reply, when you said negative scaling, does that include negative scaling in the parent object of skinnedMesh as well
     
  14. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    296
    +1 for the ability to mirror generic animations. This would be a major time saver!
     
    adamvfc likes this.
  15. Davon92

    Davon92

    Joined:
    Oct 24, 2014
    Posts:
    17
    I understand that you cannot predict what can and cant be mirrored but wouldn't a simple naming convention like Beast-Leg_L, Beast-Leg_R + an error log if only 1 is found let you know straight away if an element is mirrorable?
     
    adamvfc likes this.
  16. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Wouldn't it just work to mirror an animation by putting the scale of x to -1?
     
  17. ToruTheRedFox

    ToruTheRedFox

    Joined:
    Dec 22, 2015
    Posts:
    6
    no as this doesn't look great with models that have any sort of asymmetric feature (which can be anything from a texture to the mesh itself)