Tutorial 6

Introducing Animation Trees

Animation Trees (Anim Tree) tell the engine when and how to play animations.

Open the Content Browser and open the package you have been using for importing your skeletal mesh with the animation set. Right click on a space in the window and select New AnimTree.

Give it a name in the dialog box and hit OK. It may be wise to create a group name for the type, in this case, e.g., AnimTrees.

You will see the new AnimTree appear in the browser window and the Editor will load.

Click on the AnimTree in the Workspace window to show the Properties. Expand the Anim Tree and locate the Preview Mesh List.

Add a new item by clicking on the little green plus sign.

Expand the Preview Mesh List. Select the skeletal mesh in the content browser and in the Preview Skel Mesh box click the little green arrow. You will see the skeletal mesh appear in the preview window and the ‘Root Animation Node’.

Scroll down to the Preview Anim Set List, expand it and click the green plus sign to add a new item. Expand the array. Select the AnimSet in the Content Browser and in the Preview Anim Sets [0] array, click the green arrow to use the animation set.

We’ll proceed by adding a walking animation. Right click in the workspace window and select New Animation Node > Blend By > UTAnimationBlendByIdle.

Right click in the workspace again and select New Animation Sequence > AnimNode Sequence.

We’ll create the Idle sequence first.

In Properties locate the Animation Sequence Name and give it a name from one of the idle sequences in the Animation Set. You can select a sequence by clicking on the last down arrow on the top of your window.

This will give you a drop down list of all available sequences within the animation set which when selected, updates the name of the Idle sequence box.

Check the Playing and Looping boxes. Now hook the Animation Node to the Out node of the UTAnimBlendByIdle and the Idle node to the Out node of the Idle_Character02 (or whatever you selected!).

Notice in the preview window, the mesh has taken the idle stance.

Right click in the window again and choose the following: New Animation Node > Directional > AnimNodeBlendDirectional

Hook the Moving node of the UTAnimBlendByIdle to the Out node of the AnimNodeBlendDirectional. Create another New Animation sequence and whilst it is still selected, CTR W to duplicate it … do this three times.

Select the top Anim box and go to the drop down sequence list. Select a walk forward sequence. Select the next sequence and assign an appropriate sequence to it. Do the same for the others. Link them to the corresponding nodes as shown below.

Make sure all the Playing and Looping boxes are checked for all the sequences in Properties.

The character should now be walking forward in the preview window. Select the UTAnimBlendByIdle and move the black slider at the bottom to the beginning. The character should be performing the idle sequence. Slide it to the middle and notice how it changes to walking.

Move the slider under the AnimNodeBlendDirectional and watch the character in the preview window to see how the sequences blend (you’ll notice the strength of the orange links change accordingly too).

Although the actions are blended, they now need to be synchronised. If you do not do this, there will be a ‘blip’ between animation changes. Click the Anim Tree in the window. Expand Anim Tree, Anim Groups and 0 array. Give a Group Name, e.g., walking

Expand Preview Anim Set List, Preview Anim Sets and make sure the correct Anim Set is being used.

Hold down CTRL and select all the animations (see left screenshot below). Under Group select the Synchronise and apply the Synch Group Name.

A very useful site about Animation Nodes and Blending plus more can be found at:

http://udn.epicgames.com/Three/AnimationNodes.html

7