Animations/ Choreography Basics

Choreography Basics

In the Animation—Getting Started tutorial, you were introduced to a few of the more common features of the choreography window, such as how to move keyframes, and scale an entire timeline. You were also shown that keyframes you define, whether through the view window or by modifying an attribute on the properties window, end up as a choreograph attached to the object. So far, we have only scratched the surface of what can be done using the choreography tools.

Although it is true that you can keyframe animations to your heart's content using the animation record mode and setting keyframes interactively (through a view or property window), this approach will take you only so far. The choreography system provides a number of tools and methods for creating any type of animation, from simple to very complex (for instance, a combination of simple mouth movements to create individualized facial expressions).

This tutorial introduces you to more of the choreography system's features, such as editing animation curves, loading and saving choreographs, and building hierarchical animations. More choreography features are presented in the Choreography Essentials tutorial.

 

Editing animation curves

To begin, delete all previous test objects from your current scene, and do the following:

1. Set up an animation timeline of 120 frames.

2. Set the view window to a front view.

3. Create a cubic NURBS sphere near the left edge of the view window, roughly centered vertically.

4. Turn on animation record mode and set the time slider to the last frame (the index of the last frame is 119 or 120 depending on the indexing convention selected from the 'Animation' tab of the Options window). Then move the sphere in a straight line across to the right edge of the view window. Use the Shift modifier or the red translation handle for accurate horizontal translation.

5. Exit the animation record mode.

6. Open the choreography window, and click on the 'Animateable Attributes' tab. Select the 'mesh1.chor0' object. Find and select the 'Translate' from the list of object attributes.

Whenever you modify an object in the animation recording mode, the animation system saves all your modifications to a set of animation curves, grouped under a choreograph name. These curves determine how the attribute changes during the animation. The 'Animated Properties' tab of the choreography window provides a way to edit these animation curves directly.

Go to the 'Animation Curves' tab and let's have a look at the straight line movement animation we just created for the sphere. In the 'Animation Curves' tab, you should see the following:


The curves defining the translation of the sphere

For object translation, the red line represents the X axis, green the Y axis, and blue the Z axis. Currently, you see an ascending red line because you moved the sphere in the X direction. The green and blue lines have a constant value zero (the green line hides the blue line below it). Study the graph of the animation curves for a moment. The X axis of the graph shows the number of frames of your timeline, and the Y axis shows object position in the current units. Note the positions of the "knots" of the lines (there should be one at each end on both lines).

Note that the curve display graph can be zoomed and panned by dragging with the right mouse button while holding down the Shift or Ctrl key, respectively.

Now compare what you see in the animation curves graph to the information shown on the 'Time Lines' tab. Set 'Show Key Frames' option for the time lines using the popup menu, if not yet set.


A time line showing keyframes for the sphere

Now return to the 'Animation Curves' tab. Try moving the knots on both the X and Y animation curves, and observe the results. As suggestions, do the following:

  1. Move the end knot of the red curve to a value of 80 (this changes the value shown in the 'X' field below the graph). Keep the value of the Y field the same. Move the time slider manually to view the animation. Also look at what has changed on the 'Time Lines' tab.
  2. Return the end knot of the red curve to its original location, and move the beginning knot to an X value of 40. Run the animation, and then check the 'Time Lines' tab.
  3. Move the beginning knot of the red curve to a Y value of 0.3. Note that you can enter values directly in the X and Y fields, and press the Enter key to set the new value. Run the animation, and then check the 'Time Lines' tab.
  4. Set the beginning knot of the red curve back to its original position. Now move the end knot of the green curve to a Y value of 0.4, and observe the animation and the changes in the 'Time Lines' tab.

All the manipulations we have done so far are rather basic; however, maybe you can now envision the type of control you have available for creating animations. Moving on to more interesting things, let's assume you want another keyframe for the movement of the sphere along the X axis. You could go back to the view window and use the animation record mode, but this is not necessary. Try the following:

Make sure the knots of both the red and green curves are set back to their original positions. Now place the cursor over the red X curve at the point where it intersects the line representing frame 60, and left click once. A new knot is inserted. Best of all, this new knot is a keyframe—verify this by viewing the 'Time Lines' tab. Now you can move this new knot, changing the shape of the X curve, and thus, the movement of the sphere along the X axis. Move the new knot to a value of 0.6 for the Y field, and run the animation.

What has happened? The sphere still moves in a straight line, but you have modified how it does so. Now the sphere moves most of the distance across the screen by frame 60, and then takes another 60 frames to travel the remaining distance. The result is as if the sphere has encountered some sort of force field or other type of external resistance. (This isn't really the case, but by adding other elements to the scene you could certainly make your viewers believe the sphere is meeting some type of resistance, and isn't that the point?)

Next, let's modify the movement of the sphere along all three axes. Adjust the translation curves to look like the following:


Modifications to all three translation curves

These are the settings:

  • X (red) curve is left as it was from the last adjustment. Knot 1: 'X=0, Y=0.0'; Knot 2: 'X=60, Y=0.6'; Knot 3: 'X=119, Y=0.7'
  • Y (green) curve settings. Knot 1: 'X=0, Y=0.0'; Knot 2: 'X=119, Y=0.1'
  • Z (blue) curve settings. Knot 1: 'X=0, Y=0.0'; Knot 2: 'X=119, Y=0.4'

Now play the animation. First view from a front view. Then rerun it and view it from a top view. Now the sphere moves along all three axes. As you should now start to realize, this form of editing, when applied to other parameters such as Rotation, Scale, Skew, Color, Transparency, etc., gives you very precise control over your animations.

Let's do one more adjustment before closing this discussion, which is, let's make the sphere move along a circular path in the XY plane, using the starting and ending positions that we have defining along the X axis.

To do this, set the end point of the blue curve back to a Y value of 0.0, and set the X curve back to its original state. To do this, select the knot at frame 60 that you added to the red curve (left click the knot to select it). Right click and select 'Delete Points' from the popup menu. Now we have no Z motion, and the X motion is set to what it was originally.

Now we need to do two things: make the X movement return to its starting point at frame 119, and adjust the movement of the sphere in Y so that the sphere goes to the bottom and the top of the screen when the sphere is at the middle of the screen in its movement along X.

To modify the sphere's movement in X:

1. Add a knot to the red curve at frame 60. Move this knot to a Y value of 0.7

2. Move the end knot of the red curve at frame 119 to a Y value of 0.0

3. Right click over the curve graph and select 'Types/Polyline' from the popup menu. If you now play the animation, the sphere moves back and forth across the screen.

To modify the sphere's movement in Y (the green curve):

5. Move the end knot of the green curve to a value of 0.2 so you can more easily see the curve. Add new knots to the curve at frames 30, 60, and 90.

6. Set the Y value of the knot at frame 30 to -0.5. Ooops! The knot disappeared from the graph. No problem. Right click over the graph and select 'Set Minimum and Maximum Values' from the popup, and set the 'Min Y' field to a value of -0.7. Click OK. The graph is re-mapped accordingly.

7. Now set the knot at frame 60 to 0.0, the knot at frame 90 to 0.5, and the knot at frame 119 to 0.0

8. Play the animation.

Note that the sphere does not really move along a smooth circular path. This is because we earlier set the animation curve type to 'Polyline'. The curve type applies to all of the animation curves for a particular attribute. Right click over the curve graph again and select 'Type/Pnurbs' from the popup. Now the Y curve is rounded, which is what we want, but so is the X curve, which is not what we want. To make the line segments of the X curve more linear (similar to a Polyline), add a new point to the red line at frame 61. Now play the animation. The sphere moves along a (roughly) circular path, returning to its starting position.

The final translation curves

Note: The animation system uses special PNurbs curves by default. These curves attempt to pass through the key points as smoothly as possible. However, they also allow you to define sharp edges and straight lines easily. Just add a couple of new points to the curves and modify their vertical and horizontal positions and you'll quickly find out how to get sharp edges, straight lines, or any other shape.

Note2: Animated transformations are defined in object's space. The red X curve does not show you movement in 'world' space but with respect to its own native orientation. The red axis of the object handles shows you this direction. Therefore, you can edit animation components of an object independently of the motions of its parent levels. For example, a butterfly moves its wings up and down. When you insert the butterfly to a moving space ship, up direction may become unclear - however, editing the wing motion remains quite as easy.

This section has only scratched the surface of what you can do by editing animation curves. As always, the best course of action is to experiment. Save the project you just completed because we'll use it in the next section.

 

Adding animated attributes to a choreograph

In the previous section, we used the 'Animation Curves' tab to modify an animation that was initially defined interactively. If we now want to add rotation or scaling effects, for instance, is it necessary to do this first by using the animation recording mode? The answer is No. In fact, you do not even have to set up an initial animation in animation recording mode at all (more about this in the next section).

Using the animation we created in the previous section, let's animate the color attribute of the sphere so it changes color as it moves. Scroll down the list of attributes at the top of the 'Animateable Attributes' tab, highlight 'Color', and then click the 'Animated' checkbox. An asterisk to the left of an attribute name indicates that it is animated (even if the animation settings do nothing).


Select the 'Color' attribute from the list and click the 'Animated' checkbox

Go to the Animation Curves tab, right click over the graph window and select 'Create Predefined Curve/Constant curve' from the popup. Four animation curves are created for the Color attribute: red, green, and blue lines for the corresponding color, and a black line for the Alpha component. These lines will be set one on top another initially. Move the knots of the red, green, and blue curves so that you have something similar to that shown in the following illustration. Set both knots of the black curve to zero.

Curves defining object color

Note that for the green color component, two knots were added around frame 60 (the curve type is the default of PNurbs) to achieve straight line segments. However, since all the other color curves are straight lines, you could achieve the same effect by adding only one knot to the green curve at frame 60, and changing the line type to Polyline.

Play the animation. You now have a sphere that changes color as it moves, and you were able to add this effect solely in the choreography editor.

 

Creating a choreograph for an object

As mentioned in the previous section, it is not necessary to use the animation recording mode to create an initial choreograph for an object. Realsoft 3D's choreography editor can be used exclusively to construct your animations.

To demonstrate this, first delete all objects from your current scene to get a clean start. We will use the same frame count as in the previous example, 120 frames (you can set this using the 'Total' field of the animation window).

Create a NURBS sphere at the left side of the view window. Select the sphere in the select window, and then right click to display the popup menu. Near the bottom of this menu is the 'Make Choreographable' option. Select this option, then display the choreography window, and go to the 'Time Lines' tab. There is now an entry called 'meshn.chor0'. If you double-click this choreograph, no sub items are displayed because it currently does not have any animated properties.

A new choreograph

Let's make this sphere expand and contract as it moves back and forth across the view window. First we define the motion to make the sphere move across the view and back to its starting position:

  1. On the 'Time Lines' tab, highlight the 'meshn.chor0' choreograph. Move the end of the time line to frame 119.
  2. On the 'Animateable Attributes' tab, select 'Translate' from the list of attributes, and click the 'Animated' checkbox.
  3. On the Animation Curves tab, click on 'Translate' and then over the curve graph, right click and select 'Create Predefined Curve/Constant curve' from the popup.
  4. Right click again and select 'Type/Polyline'.

At this point, you should notice that the curve graph probably is not displaying useful values along its X and Y axes, so let's change them. Right click over the graph again and select 'Set Minimum and Maximum Values'. Set the fields as follows: Min X = 0; Max X = 119; Min Y = -0.8; Max Y = 0.8. Do not check the 'Rescale' option. Click the OK button. Note that the length of the animation curves did not change.

Click on the end point of the red curve and move it to frame 119 (be sure to keep the Y value at zero). Now click on this line at frame 75 to add a new knot, and move it upwards to a Y value of 0.5 (you may need to adjust the Y value to match the scale of your view window—the main point is to have the sphere move from one edge of the view to the other and then back).

Now let's animate the sphere's scale. Find the 'Scale' attribute in the properties list, select it and check 'Animated'. Right click over the Curve graph, and select 'Create Predefined Curve/45 deg curve' from the popup. Right click again and select 'Type/Polyline'. Add points to the X and Y scale curves so that they look as follows:


Animate the 'Scale' property

Now play with the time slider to see how the scale curves affect the shape of the object.

 

Loading and saving choreographs

So, you have created a nice animation that moves an object and causes it to "pulse", increasing and decreasing in size. What if you wanted other objects to do the same thing, or wanted to save this motion into a library of animation effects? Well, choreographs can be saved to a file. This allows you to create choreography libraries.

To save a choreograph to a file, such as the 'mesh1.chor0' created earlier, select the choreograph and choose 'Save' from the pop-up menu. Do this now and save it as 'Pulse'.

Now create another object, for example an analytic cube. On the select window, choose the popup menu 'Load Choreography'. From the file loading dialog, select the 'Pulse' choreograph you just saved, then play the animation. The cube moves and pulses in exactly the same way as the sphere did.

Rules for Attaching Choreographs to Objects

In general, any choreograph can be attached to any type of object even if the new target object does not have a common set or subset of object attributes. When a choreograph is attached to a new target object, all features that the target object does not support are removed.
For example, an analytic sphere object defines a Center attribute, but a NURBS curve does not have a Center attribute. A choreograph created for an analytic sphere that only contains animation of the Center attribute would produce no effect if assigned to a NURBS curve.

The default installation includes a number of sample choreographs. If you like, spend some time loading and attaching these predefined choreographs to objects to see what they do. See the next section for how to delete choreographs from an object.

 

Deleting animation effects

If you are working with animating an object, and decide that a particular choreograph is not what you want, you can easily delete it from the object. If a choreograph has been saved as a file previously, deleting it from an object does not delete the choreograph file, just its attachment to a particular object.

Using our example from the previous sections, if you want to delete the 'Pulse' choreograph from the cube object, do the following:

  1. Go, for example, to the 'Time Lines' tab of the choreography window and select the 'Pulse' choreograph.
  2. Select 'Delete' from the pop-up menu.

You can also remove, or turn off, all animation effects from a certain attribute. For example, maybe you want the 'Pulse' choreograph just for the scaling that causes the pulsing behavior, and not the movement. To remove all animation effects (i.e. the animation curves) from the 'Translate' attribute:

  1. In the choreography window click the 'Animateable Attributes' tab.
  2. Select the 'Translate' attribute and remove the check from the 'Animated' check box in the upper left corner.

Note: this deletes the translation curves permanently. Rechecking 'Animated' will not restore them.

You can also remove all choreographs from an object. To do this, select one of the object's choreographs, and then select 'Delete all Choreographs from this Object' from the popup. 

 

Exchanging choreographs

In the tutorials above, a choreography was assigned from a NURBS mesh to a cube by saving and reloading it. You can also assign a choreography to a new object using drag & drop.

For example:

1. Create a cube. Turn animation recording on, go to the last frame, then rotate and move the cube. Turn animation recording off.

2. Create a sphere.

3. Open the choreography window. Make sure that the sphere is selected, then drag the 'cube.chor' choreography from the choreography window and drop it into the select window. This attaches the dragged choreography to the selected sphere object.

If you now play the animation, both objects will follow the same choreography.