Home Technical Talk

Animating Eyes: Maya / Unity Workflow

Offline / Send Message
Pinned
Hi

I'm looking for some advice on animating eyes using a Maya into Unity workflow. 

Due to this the shape of the eyesocket I can't use a sphere as I usually would.

I need to control the eye dynamically in Unity using blend shapes or animated texture.

If anyone can point me in the best direction that would be awesome. 

Thanks.



Replies

  • Mark Dygert
    Options
    Offline / Send Message
    Oblong eyes aren't a problem (in rendered projects) there are quite a few ways to handle them, it happens all the time in film and tv shows. The tricky part is making it realtime ready. Once you throw that technical constraint into the mix, most of those methods go right out the window and what you're left with isn't very easy to work with.

    So... you really need to balance how important oblong eyes are to the character, the game and the project that you'll invest the time and technical resources into fixing all of the things that will break and freak out.

    If you can alter the shape of the character to work with round eyes, do it. If the impact is fairly minimal? Do it, you'll side step a mother-fuck-ton of technical issues and busy work. I strongly encourage character artists to stay within the realm of what can work in whatever engine the project is using, when pitching characters. Which is why it is important for character artists to at least understand a tiny bit of rigging before they start cooking up characters. It's critical that they don't paint your project into a corner with untenable designs, before a single polygon is laid down. 

    Usually when oblong eyes get pitched, it's lazy character design, "I want this shape of eye socket so I'll squash and stretch a sphere into the right shape". Sometimes it can be reconciled, other times it can't and they're so married to the untenable concept that you have to make it work, that's when life sucks...

    If you can't use spherical eyes (RIP pipeline) prepare for life to get much more difficult and the technical skill required to shoot up. It's not an impossible task, it can be solved, it's just a colossal pain in the ass.

    The solution really depends on how important the eyes are to the game and how much animation they're being asked to do, but really you have two separate issues. A Getting the eye to look around and B The eyelids.

    A - Possible solutions for eye movement:
    A1) The pupil is a separate mesh that slides around on the surface of the eye. You can do this with a joint that set to follow something that is constrained to the surface of the eye. Similar to this:
    https://www.youtube.com/watch?v=zPPXAWFxzzo
    But with joints as the final skinned solution.

    A2) Use UV mapping and driven keys to animate the material on the surface of the eye, think Cars. This raises some red flags because there needs to be a way to export those animations, recreate the link between UVs and the anim curves and have it sync up in unity. There is quite a bit of tech that needs to be invented to support this and creating a robust and flexible pipeline is going to be a challenge. Still it's an option...

    A3) Blendshapes, this will probably be problematic for the eye movement, the eye could easily clip through the eyelids. I would probably try to set up some world space deformers and lattices that push a spherical eye shape into the oblong shape and then take snapshots of the eye mesh at different positions and use those as blendshapes to animate the eye.

    A4) Blendshapes, never alter the shape of the eye, just slide the pupil geometry around on the surface. You just edit the loops while they are face constrained to move the pupil around the surface. It will stretch the sclera (white part of eye) but that shouldn't have that much texture info that you'll see the stretching. You capture the blendshapes and animate them a few different ways.
    - Driven keys hooked into a look-at target
    - Animate the blendshapes directly
    - A 2 axis joystick control 

    B - Possible solutions for eyelids:
    B1) Joints. I would always first try joints they can close a lot of crazy eyelid shapes and they can work with oblong eyes. They're easy to setup and test. they're probably the most bullet proof method and I would 

    B2) Blendspapes. This is probably the easiest way do blinks and various expressions with the eyes, but it can be technically expensive when in a game. I've done a similar setup in Unreal and it handles animated blendshapes really well, I have less confidence in Unity tho...

  • Pembo101
    Options
    Offline / Send Message
    Thank you so much for the comprehensive reply. I'm currently re-drawing the topology on the head. I'll keep the thread updated with progress. 
Sign In or Register to comment.