Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Adding eye blink to my mecanim mixamo animations

Discussion in 'Animation' started by blogsabout, Jul 9, 2017.

  1. blogsabout

    blogsabout

    Joined:
    Aug 20, 2014
    Posts:
    50
    Hello there

    I have setup a character in my game, being done in Adventure Creator.
    I'm using animations (walk, run etc) from mixamo, but miss some eyebliniking when using close ups.
    Is there away to add eyeblink either using bones or blendshapes, without breaking the skinning and animations

    Any direction would me much appreciated

    Cheers,
     
  2. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    My preferred method is to use blendshapes and a direct blendtree, which is discussed in this video:

    You could also manipulate the blendshapes directly in code as long as the code is executed in LateUpdate(), that way it happens after the internal animation update and doesn't get overwritten.

    Cheers,
    TrickyHandz
     
    theANMATOR2b likes this.
  3. blogsabout

    blogsabout

    Joined:
    Aug 20, 2014
    Posts:
    50
    Thanks Tricky

    My intention was to have some kind of bone setup
    But with blendtrees, I will need to similar rigs if I use bones?

    With blendshapes, will I be able to use the mixamo characters I already have en my game and running and make blendshapes from those without "breaking" anything?

    Basically my characters are a bit "dead" now - so I somehow want a flexible way to make them blink.
    My idea was first to have an anim clip where the character blink and have it blended "randomly".

    Cheers, B
     
  4. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    You could do a direct blendtree setup with bone animations as well. You would need to have identically named rigs if you want to easily reuse a single animation clip...this is because Unity's animations are based on name-based paths to the animated object. Also, having variant rigs could probably be done using AnimatorOverrideControllers, though I admittedly have less experience with those. For blendtrees, I would recommend having a single-frame animation that has the eyes completely closed. Manipulating a float that drives the direct blend can give you the ability to treat the end state of the bones and the subsequent effect on the skinned mesh just like you were using a blendshape. So you can get those types of behaviors where the eyes are half closed as well...just like in the video. Also, utilizing this type of technique you could pose any combination of bones to create different facial expressions. I'm not sure how easy such a task would be in Unity, but I think it is really worth a go.

    For Mixamo characters you already have, you can totally utilize their blendshape set up and not break anything. AnimatorOverrideControllers might come in handy here as you could have some characters driven by bones and others driven by blendshapes. I haven't actually tried out doing as set up where I have a set up like this, but I will try to make some time to test something out in the next few days. If you want to manipulate the blendshapes entirely through script and not use animations, just make sure the code is in LateUpdate() to ensure something in Mecanim doesn't accidently override your change.

    If you need further details on such a workflow you can PM me and we can discuss it. If you have a reference model with the rig you'll be using available I might be able to set it up in a test case for you to look at.

    Cheers,
    TrickyHandz
     
  5. blogsabout

    blogsabout

    Joined:
    Aug 20, 2014
    Posts:
    50
    Interesting that it's possible without breaking the rig.
    I have send you a PM.

    Cheers