Using the Non Linear Action Editor to mix different actions

It's finally time to use the NLA Editor to compose a longer animation using the actions we built in the previous recipes.

As usual, first let's prepare the screen:

We are going to add Action strips to the Gidiosaurus_proxy rig, so it's mandatory to have at least one bone selected (any one, but in this case, it's the ctrl_mouth bone):

  1. Put the mouse cursor in the Track Region (NLA-stack) of the NLA Editor window, right under where it shows Gidiosaurus_proxy | <No Action> items, and press Shift + A to add a NlaTrack channel:
    How to do it…

    Adding a first track to the NLA Editor window

    Now, take a moment and load the Gidiosaurus_walkcycle action in the bottom Action Editor window to see the action extension; it starts at frame -15 and ends at frame 45.

  2. Unlink the action in the Action Editor and move the Time Cursor to negative frame -15; put the mouse cursor in the Strip Edit area to the right side of the NlaTrack item and again press Shift + A. From the pop-up menu, select the Gidiosaurus_Walkcycle item:
    How to do it…

    Loading the Gidiosaurus_walkcycle action into the track

    A yellow action strip, with the Gidiosaurus_Walkcycle name superimposed, is added to the track at the Time Cursor location (the vertical green bar showing the frame number. If you now press the Play button in the Player Control on the Timeline toolbar, the animation starts at frame 1 and because the animation is only 40 frames long, it loops correctly, exactly as if the action was loaded in the Action Editor window.

  3. If not already present, press the N key to call the Properties sidepanel of the NLA Editor window, right-click on the action strip to select it, and then go to the Action Clip subpanel. Under Playback Settings, set the Repeat value to 3.000.
  4. Click on the End button in the Timeline toolbar and change the frame value from 40 to 120 (40 frames x 3):
    How to do it…

    The Gidiosaurus_walkcycle action set to be repeated three times

    If you press the Play button now, the animation is repeated 3 times but it doesn't loop correctly anymore because the negative frames keys are also included, in both the second and third repetitions. This is because we loaded the action at frame -15, so this is the Start Frame value for Action Extents (Start Frame = -15, End Frame = 45).

    Hence, some adjustment must be done to the action strip:

  5. First, move the Time Cursor to frame 1; with the strip selected, press the Tab key to go into Edit Mode and make the inner keys of the strip visible, both above the strip in the NLA Editor window, and as an Action in the Action Editor window. This way it's simpler to understand what keys are at what frame, and so on.
  6. Second, go to the Active Strip subpanel and under the Strip Extents item, set the Start Frame value to 1.000.
  7. Go to the Action Clip subpanel and under the Action Extents item, set Start Frame to 1.000 as well and the End Frame value to 41.000:
    How to do it…

    The action in Edit Mode and the Strip Extents and Action Extents values in the Properties subpanel of the NLA window

  8. Press Tab to go out of Edit Mode.

    Now, the walk cycle animation loops correctly for all the 120 frames, and obviously it is also possible to loop it even more by raising the Repeat value.

    So, the correct and fastest procedure would have been, from the start:

Now, let's see how to add the other actions:

At this point it could be possible to start to render at least some OpenGL preview to see the result, but there are still several steps missing in our workflow before we reach the final goal, from the texturing to the shaders, lighting, and finally beauty-rendering and compositing; all stuff that we'll see in the next few chapters.