Friday 26 March 2010

Animation exercises

Currently I am doing a few animated pieces. Nothing massive, just a few segments with motion and some lip sync bits with short soundbytes of about 10 seconds. The plan is to get some more decent tests that show off my animation skills with my finished stock rig (although this still has a few bugs. However this is why reference files are so handy. I can fix the original character rig, which is then updated in the animated scene)

One lip sync is using the Blake rig I have been raving about, which is pretty motion-heavy as it is due to the content being pretty enthusiastic. However, I've been stripping this down a lot to as few poses as possible. One reason is that the piece would eventually become a mime, and although body language is expressible, nobody really acts out every single word, and the whole lip sync gets very cluttered. Stripping the whole piece down to a couple of strong poses has a much better effect.

I am also using a couple of Muybridge's sequence of images as handy reference for motion. Once these sets of poses are established, I can then exaggerate arm swings, head motions and such to really bring some life to an otherwise natural action.

Sorry for the short post, hopefully I'll be able to put up some WIP when they are more polished.

Thursday 11 March 2010

Osipa Rig without the MEL script or expressions

If you've played with Blake, Package Man, Andy, Bloke or anything that refers to Osipa rigs or the Stop Staring book, I'm sure you will have come across Jason Osipa's facial setup. If not, it is essentially a way to reduce the number of sliders to activate blend shapes, by combining left and right sides of the face, as well as opposing expressions. For example, you can't smile and pout at the same time, so they go at different ends of a single control, as you're not going to need to use both at the same time. And if you have them separate, you will have to zero one out as the other increases. This then turns 2 different sliders into one, and if you control both left and right sides of the face with one control, then you have 4 blend shapes to control with just 1 slider. Pretty handy!

After mucking around with different techniques, such as building a number of GUIs to represent different parts of the face, where you rotate, scale and translate different handles for different effects, I decided that I wanted to implement the Osipa GUI into my rig. All the blend shapes had been built, separate left and right poses that merge together correctly, and then it dawned on me... I have NO clue how to get this to work when you have 2 axes to deal with in a slider.

It seems as if you should be able to set a driven key that switches the expressions on and off along the Y axis, then another to turn the left and right poses on and off along the X axis. However in practice this does not work, as the blends then go into negative values if you try to drive them with both translations. And this results in some weird effects, unless you like the vertices going in the complete mirror opposite direction half the time. Which I doubt you will.

Now, the Osipa melscript is kicking about on the internet to automate these sliders. However it failed to work for me on a combo of Windows 7 and Maya 2009, so that goes out the window. Also, being the control freak I am, I would like to know exactly what is going into this script to making it work (I am the equivalent of the kid who takes apart their TV to see how the men inside get on the screen, or the folk at the supermarket who meticulously read all the ingredients in their yoghurt). And I feel that simply blindly copying a chunk of script is cheating in the world of rigging. I also picked apart Blake's rig to see how that worked. It turns out that there's a lot of expressions in there (you can usually tell from the start when a channel is purple); none of which I really understood enough to create my own expressions to control the facial GUI.

Now, there are a couple of things I do know in Maya. Two of those are point constraints and driven keys. Luckily, these can be combined in a nice intricate system to make the 2 dimensional Osipa rig. Let me illustrate my methods:



This is the simple facial GUI. But there are a number of hidden treats:



I have a load of sneaky extra sliders that independently control left and right blend shapes. These work in single directions, along the Y axis. And what are the locators for? I'll show you in a bit. All I'll say now is they are locked; they don't move at all, just sit on the 0 on the X axis.


So as the sliders move up, or down, the blend shapes turn on and off, pretty much how the Blend Shape Editor works. However, we want to control both sides with one slider. In this case, the slider is point constrained (just the Translate Y, as that's the only way it moves) to the main controller, as well as that locked locator that will keep the slider, and therefore the blend shape, at zero. However, let's set that point constraint at zero, so the two do not interfere with each other incorrectly. These point constraints will be switched over as the main slider moves along the X axis, away from the corresponding side, using our friend, the driven key.


The reason we have to have the locator at zero also point constraining the slider is because if we just set the constraint to 0, it does not slide evenly; it merely snaps on or off whether the figure is at or above 0. Not what we want to get a near-infinite range of merging blends. What happens now is the two constraints will work together to equate to 1. The blend between the two figures brings the slider down at a happy gradient, so once the main slider moves along the X axis, one side of the face will fall at a steady pace, so we can move just the left side for example, without the right being affected at all.


This leaves us with a much simpler facial GUI. In fact I have just over 30 blend shapes (not including the brows or tongue. 11 of these sliders are used to control all those blends, with a few extra sliders to rotate the jaw, tongue, and to toggle the eye shifts as the eye control moves up and down. That's cut down roughly two thirds of the sliders originally needed. Result: a cleaner, easier to use rig, while keeping as much variety in the motion as possible. In fact, you only need to translate the sliders about, meaning you do not have to switch between rotations, scales, or sliding anything in the controllers' channels.

Actually, that's a fib, there is one rotation node to twist the tongue on rare occasions, but I shall ignore that.

This brings my rig construction to an end, with the exception of some texture/render jobs, but generally the character is pretty much ready for an animated piece. Keep your eyes peeled. For a treat, here's a quick snippet of what the facial rig can achieve.



Watch this space