UDK Tutorial

This is pretty much a complete tutorial on how to import your custom character and animations into the UDK.
I created this tutorial because I had some trouble getting my character into the UDK myself and I had to browse so many forums.

Please feel free to correct me on stuff if I'm wrong or add important things.

I will try to explain the following steps:
1. Import into UDK
2. Creating Sockets
3. Creating a Basic AnimTree
4. Making UDK recognize your stuff
5. Animations for Melee Attacks

I assume you know how to export a character and animations otherwise take a look here:
http://udn.epicgames.com/Two/ActorXMayaTutorial.html

!!IMPORTANT!!
-Your Rig/Skeleton needs a rootjoint placed at (0,0,0) at top of your hierarchy
-ActorX only exports Meshes and Bones, so clean up your scene before you export either by baking your animation to your bindjoints and deleting all stuff you don't need anymore or by placing the suffix _noexport (for single bone) or _ignore (for a hierarchy) for ALL joints you DON'T want to export
NO groups in your bindjoints hierarchy, this will mess up your animations in UDK
-In the ActorX options (axoptions in MEL) uncheck the "bake smoothing groups" option, smoothing groups will split your mesh and increase the vertex count.

1. Import into UDK

Ok, the first step should be pretty easy.
Click on import, choose your Character.PSK file and open it.
The Importer has an options for Maya Coordinates. You can use this, but I recommend to rotate your character by 90, 0, 90 before you export.
Your Character has to face the positive X-Axis and the Z-Axis should be the Up-Axis.
If you forgot to do this, you can use the “Rot Origin” (rotate origin) inside the AnimSet-Viewer.

importoptions

Now right-click in the Content Browser and choose New AnimSet.
After creating your AnimSet open it.
Choose File -> Import PSA and open your Animations.PSA

In the Browser Tab under Skeletal Mesh select your Character.
You should be able to play your animations now.
In the Properties Tab click on AnimSet and check the option "Anim Rotations Only?"
Click on "Use Translation Bones" and create at least 2 Translation Bones.
The first one should be your rootbone and the next one your pelvis/hip bone.
You have to create Translation Bones for every bone that should take translation from your animations.
It should look something like this:

animsetprefs

You don't need to do this, your Character will still be able to move/jump but it will NOT play any animations like Taunts or Melee Attacks.

This completes Part 1 of the tutorial.

2. Creating Sockets

In the AnimSet Editor click on Mesh and choose Socket Manager.

Click on New Socket
Choose your right-hand-weapon-bone click OK, enter WeaponPoint as socket name and click OK again.
Click on New Socket again, choose your left-hand-weapon-bone click OK and enter DualWeaponPoint as socket name, click OK again.
Click on New Socket, choose your right-ankle-bone, enter R_JB as socket name.
Do the same for your left-ankle-bone.
Click on New Socket again, choose your neck or head bone and enter HeadShotGoreSocket.

You can close the AnimSet Editor now. (Time to save your work)

This completes Part 2 of the tutorial.

3. Creating a Basic AnimTree
(For reference take a look at the AT_CH_Human AnimTree)

Right-Click in the Content Browser and choose New AnimTree.

You need to tell Unreal when and how it should play your animations.
So open your AnimTree by double-clicking on it.

The first Node you need is a AnimNodeBlendByPhysics. This Node contains pretty much every situation your character can be in.

Connect the Out Option of your AnimNodeBlendByPhysics with the Animation Option of your AnimTree.
Now Create a UTAnimBlendByIdle Node and connect the Out Option with the Walking Option of the AnimNodeBlendByPhysics Node.

Create a UTAnimNodeSequence and enter the name of your idle animation as Anim Seq Name in the properties tab.

Connect it to the Idle option of the UTAnimBlendByIdle Node.

Create a AnimNodeBlendDirectional Node and 4 UTAnimNodeSequence Nodes.
Enter the names of your forward run, backward run and strafe animations and connect the Nodes to the right slot.

Create a UTAnimBlendByFall Node and 8 UTAnimNodeSequence Nodes.
This is where you define your jump animations or the animations that should be played when the character is in the air.
If you don't have all the necessary animations you have to improvise or just export parts of your jump animations for this.

Connect the UTAnimNodeSequence Nodes to the UTAnimBlendByFall Node.

Your character should now be able to move and jump.

basicanimtree

This completes part 3 of the tutorial.

4. Making UDK recognize your stuff
NOTE: I know you shouldn't change the original files and always create your own ones. But this isn't part of this tutorial and for testing purposes only.

Now we have to change some of the .uc files in [your UDK folder]/Development/Src/UTGame/classes.
I recommend to make a back-up of the files.

Open the UTPawn.uc file.
Scroll down to defaultproperties and find the line
Quote:
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
and change it to
Quote:
AnimTreeTemplate=AnimTree'YourPackage.YourGroup.Yo urAnimTree'
This is where we tell Unreal which AnimationTree the Playercharacter should use.

Now open the UTFamilyInfo_Liandri_Male.uc file
Scroll down to defaultproperties and find the line
Quote:
CharacterMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK _CH_LIAM_Cathode'
and change it to
Quote:
CharacterMesh=SkeletalMesh'YourPackage.YourGroup.Y ourCharacter'
In the same file find the line
Quote:
AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
and change it to
Quote:
AnimSets(0)=AnimSet'YourPackage.YourGroup.YourAnim Set'
This is where we tell Unreal which character to show and which AnimSet to use.

If your character doesn't show up and Unreal shows the default character with no animations then you have to open the UTFamilyInfo_Liandri.uc file and do the same things as in UTFamilyInfo_Liandri_Male.uc

This completes part 4 of the tutorial

5. Animations for Melee Attacks
This is actually pretty easy.

Open the UTFamilyInfo.uc file and add some FamilyEmotes as EmoteAnim enter the name of your Melee Attack animations.

Open a UTWeapon_XXXXX.uc file the LinkGun would be pretty handy since it is the default weapon
find the line
Quote:
super.ConsumeAmmo(FireModeNum);
and add below this line
Quote:
UTPawn(Instigator).PlayEmote('(The name of the EmoteTag that should be played)', -1);
Now your character should be playing the Melee Attack animation when you press fire.

This completes part 5 of the tutorial.