Installing ActorX and exporting skeletal animation

Getting ready

ActorX is provided with UDK. It can be found in the folder C:UDK~BinariesActorX (where ~ is your version number). You will notice there are many variants, supporting popular 3D software. For 3ds Max users like myself, all that is required to get ActorX working is to choose the version of the supplied ActorX.dlu files which matches the 3ds Max version, and copy it to C:Program filesAutodesk3ds Max ~plugins. At the time of writing, users of 3ds Max 2012 have to use the .FBX format instead of ActorX, which is discussed later. Maya and XSI tutorials can be found at http://udn.epicgames.com/Three/ActorX.html.

If you don't use 3ds Max but still want to read the UDK importing information, skip to the next recipe.

There is a pipeline for handling characters in UDK:

  1. Create and skin a model that matches the rigs supplied by Epic Games, or create a model and rig it yourself using a rig naming convention that matches the convention established for UDK. Create any LODs and morph targets too.
  2. Export the mesh from 3ds Max to .PSK or .FBX into the UDK content folder along with the textures needed by the character.
  3. Export any animations you want to use on the character to .PSA, or use .FBX.

    If you are using ActorX, export morph targets and any LODs you have made.

  4. Import the textures to UDK, and create a Material that uses them.
  5. Import the Skeletal Mesh to UDK.
  6. Create an AnimSet and add the mesh and animations.
  7. Apply the Material, and import the morphs and LODs if needed. Generating a physics asset may also be required.
  8. Create an AnimTree to drive the character animations in game.
  9. Define a custom pawn class MyPawn.UC for your character by extending the game character class or maybe try writing one of your own. Here, you essentially tell the player what assets to use, and what drives the player's behavior.
  10. Set the MyGame.UC class to use your new character class. Finally, in its engine configuration, instruct UDK to compile the code for MyGame.

How to do it...

Accessing ActorX after installation and accessing the UDK export rig:

  1. Upon reloading 3ds Max go to the Utilities panel (the little hammer icon) [ How to do it... ] and press More. ActorX should now appear in the list. It is a good idea to add ActorX to the shortcut for Utilities using the Configure Button Sets [ How to do it... ] icon.
  2. Once you have opened ActorX, you will see that it provides two export options. You can export SkeletalMesh files (.PSK) and export animation sequences (.PSA), sets of keyed bone transforms and rotations. We'll provide these.
  3. Load the file PACKT_FemaleMesh_Idle.MAX. This scene provides a 14K polygon mesh that has a Skin modifier and a Morpher modifier. 14K polygons is an acceptable target for a UDK character model. The model design follows the joint locations of the rig UT3_Female. The biped skeleton overlays and directly drives the b_ boned based skeleton which itself matches the preset UDK rig used for the default player character animation set that UDK ships with: K_AnimHuman_BaseMale. The K_AnimHuman_BaseMale set of animations works well with UT3_Female bones (despite the engendered names). In the scene, these two rigs can be accessed through the Layers Manager [ How to do it... ].
    How to do it...
  4. The next screenshot shows, on the left, the Motion panel of the Biped. This is where animation is driven from, and on the right, the ActorX utility allows you to export animation.
    How to do it...
  5. Press H, or Select by Name [ How to do it... ], and from the listed objects choose Bip_01.
  6. Go to the Motion panel [ How to do it... ] in the Biped control section, and choose Figure mode [ How to do it... ]. It turns blue when active. With it active, expand the roll out called Copy/Paste and use the Collection called Packt, that's already been added to this biped. These steps are indicated with arrows in the previous screenshot.
  7. In the collections panel, make sure Pose mode (not Posture mode) is active, and press the Copy Pose button. You can rename the pose snapshot to Set Up.
  8. Now leave Figure mode by pressing its icon again, and turn on Animation mode by pressing the N key.
  9. In the Motion panel [ How to do it... ], press the Paste Pose icon to set at frame 0 a reference pose for our character.
  10. Your model should now be keyed standing with its arms out. This is all we'll export for now to UDK.

    Tip

    This model uses only one Material. In UDK, this will lead the imported SkeletalMesh to have one available Material channel (or chunk in UDK parlance). If you want to include several different Materials in UDK for different body parts it is a good idea to add a multi-sub object Material to your model (by applying Materials to relevant polygon selections). It doesn't actually matter what maps you assign to the Materials in 3ds Max. You'll still have to assign textures to a Material asset in UDK

Exporting the asset

  1. Select the Packt_Character model, then press Utilities | ActorX and scroll down to find Output, and press Browse to define a folder in C:UDK~UDKGameContentYOURFOLDERCharacters. When you have done so, press Use Path which lets you set the output for the exported content. YOURFOLDER is just a name for a folder. You may have established it already at an earlier stage. Many designers prefer to use a dedicated character asset folder and package. That is so they only need to load relevant assets when testing the character.
  2. We also need to give the exported content a name. Let's use Test_Character. The supplied content already includes a completed Packt_Character for later use. The first step is to export the mesh with its skin data (that matches to bones in UDK's provided skeleton). It is possible that you will see vertex skin data warnings when you export.
  3. To prevent errors, a good first step is to turn on the following filters in the Actor XSetup roll out: All Skin Type (because we only want to export skinned models); Only Selected (because we only want to export the mesh we selected already); Force Reference Pose = 0 (because we want the pose to accurately represent the skinning solution on the model); and Cull Unused Dummies (so that bones that aren't relevant to the skinning solution will not be included).

Exporting Animations

  1. Now we need to export the animation too, which is something ActorX does separately from model export. We'll look at how to export our idle sequence, create a copy of the K_AnimHuman_BaseMale set, and add our idle into it.
  2. We have an idle animation that can be exported. So we can use the Animation Exporter part of ActorX to deal with that. The components in ActorX we'll define are a file name and path to save everything into, each animation sequence in the file (the unique moves to include one by one), and the animation range in frames for the sequence.
  3. Click ActorX in the utilities. In the dialog for ActorX, enter the Animation File Name: Packt_TestCharAnim, Animation Sequence name: PacktIdle, and Animation Range: 0-219 (a frame count of 220 matches the range of the default UDK idle). As with the mesh export, the path to set would be C:UDK~UDKGameContentYOURFOLDERCharacters.

    Tip

    UDK cannot import single frames of animation, so if you want to import just a pose (perhaps for pose to pose blending using the AnimTree) make the frame range to export 0-1.

  4. Press Digest Animation to send the PacktIdle motion to the Animation Manager.
  5. Press Animation Manager to open it, then highlight PacktIdle in the dialog (where it will be the only entry), and press the right facing arrow to move the digested sequence into the output list.
  6. Optionally, in the Group field, type Anims. Note that here you can also set the target frame rate and a key reduction value. In most cases there is no need.
  7. Press Save As, and make sure the output folder is in the UDK content folder structure, and set the file name to Test_CharAnims.PSA and press Save. Now we've exported the model and animations, we can move on to the next recipe on importing them into UDK.

    Tip

    Suppose you plan to animate all the moves a character might need; it is worthwhile to consider the speed with which your character will move and the dimensions of the space in which they will move, and the obstacles in that space. The height in units of the standard character in UDK is 96 unreal units = 192 cm = 75.59 inches = a bit over 6 feet. Another influencing factor is weight. Most Epic Games characters are heavily armored and don't jump very high or far, and also don't move all that fast.

    While the values for these can be changed in configuration settings and by creating character classes, the nature of game animation is that it tends to suffice if a cycle loops well for a given distance moved. A sequence's playback speed can be adjusted in its properties in the UDK animation tree. If you want to replace the UDK animations with those of your own, it is worth considering that there are 124 key framed animation clips and poses in the K_AnimHuman_BaseMale set.

..................Content has been hidden....................

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