Defining animations in your AnimTree

This recipe shows how to furnish the AnimTree we have been working on with actual animation controls and sequences. It extends the previous recipe, which set up the properties of the AnimTree to include our character assets. We won't be creating an entire animation tree, only the bare bones needed for walking around, including an Idle.

How to do it...

  1. With your TestTree AnimTree asset open, right-click in the editor and choose New Animation Node | UDKAnimBlendByPhysics, shown next, which you can hook up to the Animation output of the AnimTree node. This node is usually the end node for all the animation to parse through. It covers situations such as walking, falling, and swimming. Additional inputs can be added by right-clicking and choosing Add Input.
  2. From the PHYS_Walking output extend to a New Animation Node | BlendBy | UDKAnimBlendByIdle, shown in the next screenshot. This gives us a control to switch between Idle animations and Moving animations. There is a previewing slider at the base of this node which ranges from 0 (Idle) to 1 (Moving).
  3. We could add some additional blends to the idle, such as between sitting and standing, or even lying down, but for now a basic idle will be fine. Right-click and choose New Animation Sequence | AnimNodeSequence. This will produce a node which says None. Connect the Idle output of the UDKAnimBlendByIdle to this. Highlight the AnimNodeSequence None, and look in its Properties. For the Anim Seq Name enter PacktIdle, which renames None. You can get the list of available animations for the preview AnimSet in the rightmost roll-down list at the top of the editor.
    How to do it...
  4. For PacktIdle, in the properties panel, click on Playing and Looping. Further down, in the Anim Node section, for Node Name, enter Idle. Hooking the nodes up will let you see the Idle animation playing in the preview window.
  5. From UDKAnimBlendByIdle extend from its Moving output a New Animation Node | Directional | AnimNodeBlendDirectional. This provides a mixer for user directed movement typically assigned to W A S D keys in a game.
  6. For each output of the new node, assign a New Animation Sequence | AnimNodeSequence, and respectively set their Anim Seq Name channels to FWD, BWD, LeftStep, and RightStep, as defined in the AnimSet Packt_CharAnims.
  7. Your four nodes should all be set to Playing and Looping in their properties. Slide the UDKAnimBlendByIdle slider to 1.0 Moving to see the results. Then slide the AnimNodeBlendDirectional slider (which ranges around 360') to cycle through the movement directions.
    How to do it...
  8. Activate the AnimNodeSequence SkinTail_BWD and in its properties set the Rate to 0.75, since usually a character doesn't move as fast backwards as forwards. The overall speed a character will move is defined in its pawn class.
  9. Just for an extra step, since we have one swimming animation, from the PHYS_Swimming node of the UDKAnimBlendByPhysics node, extend a wire to a New Animation Sequence | AnimNodeSequence and set its properties to Anim Seq Name: SwimFWD, Playing and Looping. Slide the UDKAnimBlendByPhysics slider till Phys_Swimming highlights and is active to see the result. To fill out an AnimTree tree requires many sequences. Get to know the available nodes and how they mix then plan your own sequences.
  10. You will notice that there is an available output off the main AnimTree node called Morph. Using this you can add the morph targets your character uses. The quickest way to examine how this works is to open the Packt_CharTree asset, which already has the EarShrinkL and EarShrinkR morphs added. To add a Morph Target just right-click and choose New Morph Node | MorphNodeWeight. This creates a slider you can name. From that, extend to a New Morph Node | MorphNodePose, which references the actual morph target by its name in the AnimSet Morph section.
    How to do it...
  11. To familiarize yourself with the workings of AnimTrees a good start is to search the content browser using AnimTree as a filter and open up those that ship with UDK. A good next step is to look for the great set of free video tutorials by Wraiyth at: http://udkc.info/index.php?title=Tutorials:Wraiyth's_AnimTree_crash_course.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.61