Friday 24 February 2012

Graph Editor Tutorial - Part One

I've been asked a few times by some people to put one of these together, and after some time finally have the time to do it.

I'm going to start with the very basics. This will start with introducing the graph editor. As the tutorials progress, we will work our way up to some more advanced things.

Stayed tuned for a tips and tricks article. I hope to discuss topics including 'weighted vs non weighted tangents', 'spline vs linear vs stepped', 'How to change things quickly in the polishing stages' and many other fun things.
And if you have any questions or troubles understanding anything fire a comment below, and I'll do my best to address it. So without further ado here we go.

What is the graph editor?
The graph editor is a basic visual representation of how an object is moving in 3D space. It shows you how the computer is interpreting the movement of that object, and where that object is in 3D space at any given frame.

How do I open the graph editor?
You can find the graph editor via Window-Animation Editor-Graph Editor




I opened it but nothing is there.....

You need to have the object or control you want to view in it selected. You can have multiple controls and objects selected and displayed in the editor at the same time. If you only want to see one particular curve you can select that in the left area of the editor.



Tip: If a control is not showing in the graph editor, make sure you have set a key. For example, to show all attributes for a control (translate, rotate, scale etc), select the control and press 's' on your keyboard.

When I animate I want my keys to be linear/stepped/splined, how do I set it up so the computer automatically sets the keys as such?



In the bottom right corner of this image you will see a red icon that looks like a man is running. That opens the preferences menu. Under settings you will see an animation section. With that selected you will see a section that has default in and default out tangents. Simply select the mode you want maya to set your tangents to before you start animating.

How do I understand what my curves are doing?

In this image you will notice some numbers along the bottom. These numbers represent frames. You will notice numbers on the side as well. These numbers tell us where the object is in relation to its "world". 0 denotes that it is completely central in that axis to it's world. On frame 13, you will see a value of 20. This denotes that it is 20 x away from its world in x. At frame 24 it has returned to its world's central point again.

So from frames 1-13 it travels a value of 20 x and from frames 13-25 it travels back. Notice the curve from 1-13 and 13-25 is a completely straight line. This means it is in "linear" Basically this setting is the computer saying the fastest way from a to b is a straight line. So it travels the same distance each frame to get to its destination.


In the next image this is called spline. Notice how the curve has flattened out as it leaves each key and arrives at each key. This is the computers way of applying "slow in" and "slow out" for you. (It rarely does a good job of this, and is definitely not something you want to rely on.)


In this image is an example of stepped mode. In this mode, the computer does nothing for you at all. It lets you tell it what to do and how to do it, and makes no attempt whatsoever to solve how an object goes from a to b.



Despite all of these different curves existing, the ultimate goal of any cg animator is to arrive at a final splined curve. How you chose to get there is up to you.

How do I want my curves not to look?

The below is an example of "overshoot". This means the objects extreme, is not where you set it, which means it is hitting its extreme either several frames before or after you told it to, and the extreme or destination isn't even where you put it in the first place. This ultimately means you are not in control of your animation.


In the next below example, you will notice the keys aren't really placed very strategically at all. I see this alot with animators who work in stepped mode, it will look great and the pose will look great, but the movement just isn't right. The extremes we had wanted were at 1, 13 and 25, but how we got there is very jittery and not smooth at all, which wont be very easy for our audience to follow.



In the next image you will notice all the tangent handles are flat, so the computer is trying to slow in and out of the breakdowns we have set, which is going to make things very floaty and ugly.


How should my curves look?
There really is no right or wrong answer here. It all depends on what you want to happen, and where an object is in the rigs heirarchy. What you are doing, what you were doing before, and what you are doing next will have an effect on how your curves will look. But there are some general guidelines you can follow that may or may not help you out.

Slow in and out
Notice in this image how the object really takes it time in getting going, and really takes its time coming to a stop. This is typically how slow in and slow out should look on a control.

Slow In

There are times you are going to want hit something hard and come to a stop, or settle, or whatever. ie: throwing a punch, putting your hand on a table, putting your foot down, etc....

So you are going to want to slow into that movement and pick up speed gradually until your contact. So your curve should look something like the above image.

Slow Out

Sometimes you are just gonna want to throw on the breaks. But we don't want to hit one of those invisible walls, so in order to stop something we need to slow out of that movement. So you will want your curve to look something like this one above.

The Bouncing Curve

Sometimes you are gonna want to get that bouncing ball feel. Either you are animating a bouncing ball, or a skip, a walk or a run, or a bunny hopping, or whatever. You are going to want your up and down curve to look something like this one.
Just remember the longer it takes for something to rise to that up extreme the heavier it will look. The heavier it is, the faster it will fall.


*Note that for all the diagrams I have used 24 frames and similar values, they are only a visual representation of how certain effects will typically look. There are millions of ways to apply these things. For the bouncing curve also note that I have broken the tangents handles, and is something I will cover under the next article on tips and tricks for the graph editor.
For those of you that struggle with the graph editor, I really hope this article has helped you out. If there is anything you want me to go over in the next article let me know, and I will do my best.
Cheers.