Difference between revisions of "Creating a Simple Animation-Part Two"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
Line 1: Line 1:
 
[[File:work_in_progress.jpg|center]]
 
[[File:work_in_progress.jpg|center]]
 +
 +
Welcome to Part Two of the Creating a Simple Animation tutorial. In Part One we looked at creating an animation using only the main window. If you haven't read through that already you might want to do so, as it describes some things we're doing in this part.
 +
 +
In this part of the tutorial we're going to create a very similar animation using the [[Animation Panel]]. If you want to find out more about the Animation Panel you can read about it [[Animation Panel|here]]. You might want to go that now to get an overview of the panel and its different parts.
 +
 +
Most of the work we do with the Animation Panel in this tutorial will use the [[Curve Editor]]. The Animation Panel also contains the [[Dope Sheet]], which we won't use for now. The difference between the two is that the Curve Editor allows you to change both the frame and value of keys. The Dope Sheet only lets you change the frame of keys, although sometimes that's all you need to do. The Dope Sheet is more convenient work with in that case. For now we'll concentrate on the Curve Editor though.
 +
 +
==Animating with the Curve Editor==
 +
 +
<ol>
 +
<li>
 +
Start Terragen 2.
 +
</li><li>
 +
Create a Sphere object to animate. You can do this by clicking on the Objects layout button and then using Add Object button at the top right. Click the button and choose '''Object > Sphere''' from the menu that pops up.
 +
</li><li>
 +
Set the '''Radius''' of the new sphere to 25.
 +
</li><li>
 +
Set the '''Centre''' of the sphere to 0, 25, 0. This will move it to the scene origin and have it just sitting on the ground. You might like to change the 3D Preview so you can see the sphere better.
 +
</li><li>
 +
Up to now we've done the same as in the previous part. We're now going to set a key on the '''Centre''' param of the sphere object, just like last time. You might also notice that we haven't done anything with the Animation Panel yet.
 +
 +
An important point to note is that params don't shown in the Animation Panel until you have set at least one key on them. The Animation Panel only displays animated params.
 +
 +
Go ahead and set a key on all components of the '''Centre''' param.
 +
</li><li>
 +
Now we'll open the Animation Panel. There are several ways to do this, which you can read about in the [[Animation Panel|Animation panel reference]]. We're going to do it using the [[View Menu|View menu]]. Go up to the View menu and choose '''Animation Panel in New Window'''.
 +
</li><li>
 +
The Animation Panel is now open in a new window. You can see there is a timeline at the top. This is a bit like the main window timeline except it shows more information and has more controls.
 +
 +
By default the Curve Editor will be displayed below the timeline. You can tell this because the Curve Editor button on the right side of the window will be depressed. If the Dope Sheet is showing instead you should click on the Curve Editor button now.
 +
</li><li>
 +
On the left hand side of the Curve Editor is the node list. This shows all the animated nodes in the project, along with the animated params and their components. You will see our sphere object in the list.
 +
 +
Click the plus box (Windows) or triangle (Mac) to expand the '''Sphere 01''' item. You'll see the '''Centre''' param there. Now expand the '''Centre''' param list item. You'll see X, Y and Z list items appear. Each of the items correspond to the X, Y and Z components that make up the '''Centre''' vector.
 +
</li><li>
 +
Click on the X item. The first thing we're going to do is make the sphere move from left to right along the X axis, and to do that we're going to draw the motion we want in the Curve Editor.
 +
 +
The Curve Editor is like a graph. The horizontal axis shows frames. The vertical axis shows values. You will recall that a key is a combination of a frame and a value. The Curve Editor lets us place keys at frames and values we're interested in and then draws the interpolated inbetween values as a line or curve on the graph.
 +
</li><li>
 +
Right now we don't see any lines on the graph because we have only set one key. There is nothing to draw the lines between. Let's add another key.
 +
 +
Where to put it though? Think the animation we did in the last part. Our sphere moved left to right along the X axis. The ''Centre''' param started off with an X value of 0 at frame 1. It ended up with an X value of 600 at frame 60.
 +
 +
We did set other X values along the way but if you look at it carefully you'll see that what happened is that we changed the X value by 100 every 10 frames. For example in Step 7 we changed the frame number to 20 and the X value to 200. At step 11 we set the frame to 30 and the X value to 300. This is a change of 100 every 10 frames.
 +
 +
If we were to plot that out on a graph we would get a straight line. The Curve Editor is a graph and we will draw that line by adding a key at frame 60 that has a value of 600.
 +
</li><li>
 +
Zoom the Curve Editor so you can see 600 on the vertical axis and 60 on the horizontal axis. You may need to make the window bigger and zoom or pan around so you can see things in the best way.
 +
</li><li>
 +
Make sure the Curve Editor has the keyboard focus. Now press the '''I''' key. This is a hot key for inserting a new frame.
 +
</li><li>
 +
Move the mouse so that it's over the intersection between the line for frame 60 and the line for the 600 value. Click the mouse and a new key will be inserted.
 +
</li><li>
 +
You will see a red curve appear in the editor. This curve displays the change of value in the X component between the two keys we've set. You could also think of it as displaying the motion of the sphere in the X direction.
 +
 +
The curves are the colour of their corresponding component. For example X is red and Y is green. Params which only have one component draw their curves in red.
 +
 +
Change back to the main window and use the timeline slider to scrub back and forth. You'll see that the sphere is moving along the X axis.
 +
</li><li>
 +
Change back to the Animation Panel. Look at the curve and you'll see it's actually a slight curve and not a straight line between the two keys. This is because the TCB interpolation method TG2 uses by default smooths or "eases" the values around keys.
 +
 +
We won't discuss exactly what the shape of the curve means here. To find out more please read [[this]] part of the guide, which talks about understanding curves in the Curve Editor.
 +
</li><li>
 +
As we talked about above, what we really want is a straight line between the two keys. To do this we will change the interpolation mode to Linear. Underneath the node list is the '''Mode''' popup list. Make sure that the X component is still selected in the node list and the click the '''Mode''' popup and select '''Linear'''.
 +
 +
You will see the curve in the editor change to a straight line. If you go back to the main window and move the timeline slider you may see that motion of the sphere is slightly different.
 +
 +
We've now finished animating the X component. The sphere is moving in a straight line along the X axis at a constant speed, just like it was at the end of Part One.
 +
</li><li>
 +
Now we're going to make the ball rise up in the air and drop back down. To do this we need to animate the Y component of the '''Centre''' param. If we look back at Part One, these are the Y values we initially used (before fixing the dipping):
 +
 +
*25 at frame 1
 +
*25 at frame 20
 +
*200 at frame 30
 +
*25 at frame 40
 +
*25 at frame 60
 +
 +
Let's insert a key at all these locations. Please note that you may need to pan and zoom around the editor to do this. First make sure the editor has keyboard focus...
 +
</li><li>
 +
We already have a key at frame 1, which we created when we originally keyed the param. That means the first key is at frame 20 with a value of 25. Press the '''I''' key to insert a key, and now click at the intersection of the line at frame 20 and the line for the 25 value. If you don't see a line for 25 you may need to zoom in a bit more.
 +
</li><li>
 +
Now insert a key at frame 30 with a value of 200.
 +
</li><li>
 +
Next insert a key at frame 40 with a value of 25.
 +
</li><li>
 +
Finally insert a key at frame 60 with a value of 25.
 +
</li><li>
 +
Now we've curve that shows the motion that we had in Part One, except this time we can actually see the path the sphere is going to move along. If you can't see all the curve click the '''Fit to Curve''' button below the editor.
 +
 +
Let's scrub through the animation to see the what it looks like. You can actually scrub with the Curve Editor. See that green vertical line in the editor? That's called the frame cursor. Click on it and then drag it to move the current frame. This is just like moving the slider in the main window timeline. If you arrange the windows so you can see the 3D Preview you'll see the sphere move as you move the frame cursor.
 +
</li><li>
 +
If we were to render the animation now we would have something very similar to first movie from Part One:
 +
 +
<mediaplayer>file:simple_anim_tut_pt1_dipping.mp4</mediaplayer>
 +
 +
We still have the dipping problem, but now it's much easier to see why. The green curve is showing the path the centre of the sphere moves along. We haven't changed the terrain in the scene so that means all the ground is at an elevation of 0. Looking at the curve we can see that the Y value is decreasing from frame 1 through to about frames 13-14 where it's practically at 0. After that it starts to rise again but it's not until the key at frame 20 that the sphere is entirely above the ground again. What we want is for the centre of the sphere to stay at 25m above the ground until around frame 20 and then start rising. With the Curve Editor we can easily edit keys to get what we want.
 +
</li><li>
 +
First we're going to fix the dip in the first half of the animation by moving the key at frame 20. You can click on the key to select it and then click and drag it to move it. We'll do that now. I moved the key to frame 27 and a value of about 117.
 +
 +
An important thing to note is that as we move the key the param changes as well. In Part One when we wanted to change the values of keys we'd already set then we had to change the param value and then use the animation button to set a new key. You don't need to do that with the curve editor.
 +
 +
Of course we've also change the frame of the key as well as the value. If we wanted to do this entirely with the main window then we'd first have to delete the key at the previous frame, change the frame number to the new frame, change the param value and then set a new key. It's much easier to use the Curve Editor (or Dope Sheet) and just drag keys to where we want them.
 +
</li><li>
 +
Watch how the curve changes as you move the key. With the key moved to the position in the previous step you can see that the curve is much more horizontal. It's still not perfect but we'll look at that later.
 +
 +
It can be a bit tricky to see exactly where the curve is horizontally. The Curve Editor has a value guide. Press the '''V''' key. A horizontal green line appears, much like the frame cursor. The value guide shows the value where it's currently positioned in a little green box on the right. Click on the value guide and drag it until the value reads 25, or thereabouts, in the little green box.
 +
</li><li>
 +
Now we'll fix the dip in the second half of the curve, which is where the sphere drops back down to the ground and then continues along the ground. When we did it for the first half of the curve, just by moving the existing key, we didn't get quite the curve we wanted. This time we're going to do it by both moving keys and inserting new ones.
 +
 +
First we'll move the key at frame 40 so it's at frame 33 with a value of about 117. This makes the curve pretty symmetrical.
 +
</li><li>
 +
Now we want to bring the curve down a bit so it drops back to 25 closer to frame 40. Let's insert a key at frame 40 and a value of 25. The easiest way to do it is click on value guide at frame 40.
 +
</li><li>
 +
You will notice that the curve is now dipping back down below 25 again. What's going on? To get smooth motion we're using TCB interpolation for this curve. TCB tries to make the curve pass smoothly through keys to give a good motion. Unfortunately it doesn't always do quite what we might want. The good news is that we can take control the of curve by inserting more keys.
 +
 +
You might be wondering why we can't use Linear interpolation if we want straight lines, between frame 40 and 60 for example. The simple answer is that you can't mix interpolation modes to make one part of the curve straight and another curved. Try changing the curve interpolation to Linear, using the '''Mode popup''' under the node list. You can see that's not really want we want. Here's a movie showing what this motion looks like:
 +
 +
 +
</li><li>
 +
We can make a part of the curve straighter by inserting more keys. Insert a key at frame 47 with a value of 25. Notice how the curve between the key we've just inserted and the final key is now pretty straight.
 +
 +
You might want to hide the value guide to see the curve. Press the '''V''' key to hide it. Press the '''V''' key again to show it if you want to.
 +
</li><li>
 +
Part of the curve is still dipping. Insert a key at frame 41 with a value of 25. The curve is now straight from frame 40 to frame 60.
 +
</li><li>
 +
The change from the sphere dropping to moving along the ground is quite abrupt. We can smooth that out by moving keys at frames 40 and 41. You may experiment yourself with moving the keys until you find something you like. I moved the key at frame 40 to around a value of 30 and the key at frame 41 to frame 42 with a value of 26.
 +
</li><li>
 +
Zoom in on the keys we've created to straighten out the curve. Although we clicked pretty close to a value of 25 you'll probably see that they vary a bit up and down. We can move keys to certain values (or frames) using the Action button below the editor. The Action button has a gear icon.
 +
</li><li>
 +
Click the Action button to see the choices in the menu which pops up. We're going to use '''Move to value'''. The Action button menu items use the value in the text field to the left of the button for their operations.
 +
</li><li>
 +
Select a key you want to move.
 +
</li><li>
 +
Enter 25 in the Action text field.
 +
</li><li>
 +
Click the Action button and choose '''Move to value'''. The key will move to the 25 value.
 +
</li><li>
 +
Repeat the above steps for other keys you want to move have a value of 25. You don't need to enter a value in the Action text field every time, just select a key and choose '''Move to value''' from the Action button menu.
 +
</li>
 +
</ol>
 +
 +
That's the end of the tutorial. We've now created an animation using the Animation Panel and the Curve Editor. Here's what the animation looks like when rendered:
 +
 +
Although there are quite a lot of steps in this part of the tutorial it all takes longer to describe than do. When you get used to working with Curve Editor you'll find it's a very convenient way to create and edit animations.
 +
 +
You can download a project file for this part of the tutorial here.

Revision as of 00:12, 19 February 2012

Work in progress.jpg

Welcome to Part Two of the Creating a Simple Animation tutorial. In Part One we looked at creating an animation using only the main window. If you haven't read through that already you might want to do so, as it describes some things we're doing in this part.

In this part of the tutorial we're going to create a very similar animation using the Animation Panel. If you want to find out more about the Animation Panel you can read about it here. You might want to go that now to get an overview of the panel and its different parts.

Most of the work we do with the Animation Panel in this tutorial will use the Curve Editor. The Animation Panel also contains the Dope Sheet, which we won't use for now. The difference between the two is that the Curve Editor allows you to change both the frame and value of keys. The Dope Sheet only lets you change the frame of keys, although sometimes that's all you need to do. The Dope Sheet is more convenient work with in that case. For now we'll concentrate on the Curve Editor though.

Animating with the Curve Editor[edit]

  1. Start Terragen 2.
  2. Create a Sphere object to animate. You can do this by clicking on the Objects layout button and then using Add Object button at the top right. Click the button and choose Object > Sphere from the menu that pops up.

  3. Set the Radius of the new sphere to 25.

  4. Set the Centre of the sphere to 0, 25, 0. This will move it to the scene origin and have it just sitting on the ground. You might like to change the 3D Preview so you can see the sphere better.

  5. Up to now we've done the same as in the previous part. We're now going to set a key on the Centre param of the sphere object, just like last time. You might also notice that we haven't done anything with the Animation Panel yet.

    An important point to note is that params don't shown in the Animation Panel until you have set at least one key on them. The Animation Panel only displays animated params.

    Go ahead and set a key on all components of the Centre param.

  6. Now we'll open the Animation Panel. There are several ways to do this, which you can read about in the Animation panel reference. We're going to do it using the View menu. Go up to the View menu and choose Animation Panel in New Window.

  7. The Animation Panel is now open in a new window. You can see there is a timeline at the top. This is a bit like the main window timeline except it shows more information and has more controls.

    By default the Curve Editor will be displayed below the timeline. You can tell this because the Curve Editor button on the right side of the window will be depressed. If the Dope Sheet is showing instead you should click on the Curve Editor button now.

  8. On the left hand side of the Curve Editor is the node list. This shows all the animated nodes in the project, along with the animated params and their components. You will see our sphere object in the list.

    Click the plus box (Windows) or triangle (Mac) to expand the Sphere 01 item. You'll see the Centre param there. Now expand the Centre param list item. You'll see X, Y and Z list items appear. Each of the items correspond to the X, Y and Z components that make up the Centre vector.

  9. Click on the X item. The first thing we're going to do is make the sphere move from left to right along the X axis, and to do that we're going to draw the motion we want in the Curve Editor.

    The Curve Editor is like a graph. The horizontal axis shows frames. The vertical axis shows values. You will recall that a key is a combination of a frame and a value. The Curve Editor lets us place keys at frames and values we're interested in and then draws the interpolated inbetween values as a line or curve on the graph.

  10. Right now we don't see any lines on the graph because we have only set one key. There is nothing to draw the lines between. Let's add another key.

    Where to put it though? Think the animation we did in the last part. Our sphere moved left to right along the X axis. The Centre' param started off with an X value of 0 at frame 1. It ended up with an X value of 600 at frame 60.

    We did set other X values along the way but if you look at it carefully you'll see that what happened is that we changed the X value by 100 every 10 frames. For example in Step 7 we changed the frame number to 20 and the X value to 200. At step 11 we set the frame to 30 and the X value to 300. This is a change of 100 every 10 frames.

    If we were to plot that out on a graph we would get a straight line. The Curve Editor is a graph and we will draw that line by adding a key at frame 60 that has a value of 600.

  11. Zoom the Curve Editor so you can see 600 on the vertical axis and 60 on the horizontal axis. You may need to make the window bigger and zoom or pan around so you can see things in the best way.

  12. Make sure the Curve Editor has the keyboard focus. Now press the I key. This is a hot key for inserting a new frame.

  13. Move the mouse so that it's over the intersection between the line for frame 60 and the line for the 600 value. Click the mouse and a new key will be inserted.

  14. You will see a red curve appear in the editor. This curve displays the change of value in the X component between the two keys we've set. You could also think of it as displaying the motion of the sphere in the X direction.

    The curves are the colour of their corresponding component. For example X is red and Y is green. Params which only have one component draw their curves in red.

    Change back to the main window and use the timeline slider to scrub back and forth. You'll see that the sphere is moving along the X axis.

  15. Change back to the Animation Panel. Look at the curve and you'll see it's actually a slight curve and not a straight line between the two keys. This is because the TCB interpolation method TG2 uses by default smooths or "eases" the values around keys.

    We won't discuss exactly what the shape of the curve means here. To find out more please read this part of the guide, which talks about understanding curves in the Curve Editor.

  16. As we talked about above, what we really want is a straight line between the two keys. To do this we will change the interpolation mode to Linear. Underneath the node list is the Mode popup list. Make sure that the X component is still selected in the node list and the click the Mode popup and select Linear.

    You will see the curve in the editor change to a straight line. If you go back to the main window and move the timeline slider you may see that motion of the sphere is slightly different.

    We've now finished animating the X component. The sphere is moving in a straight line along the X axis at a constant speed, just like it was at the end of Part One.

  17. Now we're going to make the ball rise up in the air and drop back down. To do this we need to animate the Y component of the Centre param. If we look back at Part One, these are the Y values we initially used (before fixing the dipping):

    • 25 at frame 1
    • 25 at frame 20
    • 200 at frame 30
    • 25 at frame 40
    • 25 at frame 60

    Let's insert a key at all these locations. Please note that you may need to pan and zoom around the editor to do this. First make sure the editor has keyboard focus...

  18. We already have a key at frame 1, which we created when we originally keyed the param. That means the first key is at frame 20 with a value of 25. Press the I key to insert a key, and now click at the intersection of the line at frame 20 and the line for the 25 value. If you don't see a line for 25 you may need to zoom in a bit more.

  19. Now insert a key at frame 30 with a value of 200.

  20. Next insert a key at frame 40 with a value of 25.

  21. Finally insert a key at frame 60 with a value of 25.

  22. Now we've curve that shows the motion that we had in Part One, except this time we can actually see the path the sphere is going to move along. If you can't see all the curve click the Fit to Curve button below the editor.

    Let's scrub through the animation to see the what it looks like. You can actually scrub with the Curve Editor. See that green vertical line in the editor? That's called the frame cursor. Click on it and then drag it to move the current frame. This is just like moving the slider in the main window timeline. If you arrange the windows so you can see the 3D Preview you'll see the sphere move as you move the frame cursor.

  23. If we were to render the animation now we would have something very similar to first movie from Part One:

    <mediaplayer>file:simple_anim_tut_pt1_dipping.mp4</mediaplayer>

    We still have the dipping problem, but now it's much easier to see why. The green curve is showing the path the centre of the sphere moves along. We haven't changed the terrain in the scene so that means all the ground is at an elevation of 0. Looking at the curve we can see that the Y value is decreasing from frame 1 through to about frames 13-14 where it's practically at 0. After that it starts to rise again but it's not until the key at frame 20 that the sphere is entirely above the ground again. What we want is for the centre of the sphere to stay at 25m above the ground until around frame 20 and then start rising. With the Curve Editor we can easily edit keys to get what we want.

  24. First we're going to fix the dip in the first half of the animation by moving the key at frame 20. You can click on the key to select it and then click and drag it to move it. We'll do that now. I moved the key to frame 27 and a value of about 117.

    An important thing to note is that as we move the key the param changes as well. In Part One when we wanted to change the values of keys we'd already set then we had to change the param value and then use the animation button to set a new key. You don't need to do that with the curve editor.

    Of course we've also change the frame of the key as well as the value. If we wanted to do this entirely with the main window then we'd first have to delete the key at the previous frame, change the frame number to the new frame, change the param value and then set a new key. It's much easier to use the Curve Editor (or Dope Sheet) and just drag keys to where we want them.

  25. Watch how the curve changes as you move the key. With the key moved to the position in the previous step you can see that the curve is much more horizontal. It's still not perfect but we'll look at that later.

    It can be a bit tricky to see exactly where the curve is horizontally. The Curve Editor has a value guide. Press the V key. A horizontal green line appears, much like the frame cursor. The value guide shows the value where it's currently positioned in a little green box on the right. Click on the value guide and drag it until the value reads 25, or thereabouts, in the little green box.

  26. Now we'll fix the dip in the second half of the curve, which is where the sphere drops back down to the ground and then continues along the ground. When we did it for the first half of the curve, just by moving the existing key, we didn't get quite the curve we wanted. This time we're going to do it by both moving keys and inserting new ones.

    First we'll move the key at frame 40 so it's at frame 33 with a value of about 117. This makes the curve pretty symmetrical.

  27. Now we want to bring the curve down a bit so it drops back to 25 closer to frame 40. Let's insert a key at frame 40 and a value of 25. The easiest way to do it is click on value guide at frame 40.

  28. You will notice that the curve is now dipping back down below 25 again. What's going on? To get smooth motion we're using TCB interpolation for this curve. TCB tries to make the curve pass smoothly through keys to give a good motion. Unfortunately it doesn't always do quite what we might want. The good news is that we can take control the of curve by inserting more keys.

    You might be wondering why we can't use Linear interpolation if we want straight lines, between frame 40 and 60 for example. The simple answer is that you can't mix interpolation modes to make one part of the curve straight and another curved. Try changing the curve interpolation to Linear, using the Mode popup under the node list. You can see that's not really want we want. Here's a movie showing what this motion looks like:


  29. We can make a part of the curve straighter by inserting more keys. Insert a key at frame 47 with a value of 25. Notice how the curve between the key we've just inserted and the final key is now pretty straight.

    You might want to hide the value guide to see the curve. Press the V key to hide it. Press the V key again to show it if you want to.

  30. Part of the curve is still dipping. Insert a key at frame 41 with a value of 25. The curve is now straight from frame 40 to frame 60.

  31. The change from the sphere dropping to moving along the ground is quite abrupt. We can smooth that out by moving keys at frames 40 and 41. You may experiment yourself with moving the keys until you find something you like. I moved the key at frame 40 to around a value of 30 and the key at frame 41 to frame 42 with a value of 26.

  32. Zoom in on the keys we've created to straighten out the curve. Although we clicked pretty close to a value of 25 you'll probably see that they vary a bit up and down. We can move keys to certain values (or frames) using the Action button below the editor. The Action button has a gear icon.

  33. Click the Action button to see the choices in the menu which pops up. We're going to use Move to value. The Action button menu items use the value in the text field to the left of the button for their operations.

  34. Select a key you want to move.

  35. Enter 25 in the Action text field.

  36. Click the Action button and choose Move to value. The key will move to the 25 value.

  37. Repeat the above steps for other keys you want to move have a value of 25. You don't need to enter a value in the Action text field every time, just select a key and choose Move to value from the Action button menu.

That's the end of the tutorial. We've now created an animation using the Animation Panel and the Curve Editor. Here's what the animation looks like when rendered:

Although there are quite a lot of steps in this part of the tutorial it all takes longer to describe than do. When you get used to working with Curve Editor you'll find it's a very convenient way to create and edit animations.

You can download a project file for this part of the tutorial here.

The Node List is a part of the Terragen interface that shows a list of nodes along the left side of the application window. The Node List generally shows only those nodes that are relevant to the current Layout (e.g. Terrain, Atmosphere). It sometimes includes buttons or other controls that are specific to a particular Layout as well. The Node List is hierarchical and each level is collapsible.

A vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.