Creating Your Own First Person Animations

A Tutorial for Team Fortress 2

Members see zero ads. Membership is 100% free

Updates

Rewrote tutorial 2y
  • - I completely rewrote the tutorial, with new screenshots and technique.
This can be very overwhelming if you've never created anything for the Source Engine or animated before.

I'm not really a writer, so bare with me. Since this has all become like muscle memory for the past few years, it's hard to explain everything to someone who knows nothing about this.

I use Blender, so I'm just going to assume you do too. If you don't, the basics still apply. You can still do this in 3DS Max, but the terminology will be different and you'll have to make your own IK rig set ups. That's easy if you know what you're doing, though.

Tools needed: 

- Blender 
- Blender .SMD tools 
- GCFScape 
- Crowbar
- Notepad++ 
- NppExec for Notepad++ 
- N-cognito's TF2 SCA and Blender Rigs

(Please google these for the download links and how to install them.) 

Part 1: Getting Everything Setup

Create a folder on your desktop, and name it "TF2 Anims". 

In that folder, create more folders called : 

- "Blender Saves" 
- "Models" (If you want to decompile weapons/arms yourself)
- "Animation Compile Files"

Copy N-Cognito's SCA files and place them in "Animation Compile Files". The locations or even the existence of these folders don't actually matter.

Place the rigs you downloaded in a subfolder of "Blender Saves"

For demonstration purposes, we're making new Shotgun animations for the Engineer. We're going to use N-Cognito's rigs, so we don't have to set up our own. You can if you want, but you'll probably mess up even with a tutorial. It's annoying and complicated, and I don't want to put you through it. Or write it.

Make a copy of the "Engineer" folder from SCA and rename it something like "Engineer - New Shotgun animations"

Now we need the frame numbers of all of the animations. There are a couple ways of achieving this. 

The first strategy is to import each animation you're replacing into blender from the SCA files (one at a time) and just look at how many frames they take up. 

The second strategy is to open GCFscape, extract the c_engineer_arms files somewhere, and load it into HLMV.

Write them down or something.

Part 2: Animating

Open up Engineer - Shotgun.blend from the rigs you downloaded.

Since you know the frame numbers, set Blender's "start" frame to 0 and the "end" frame to whatever the amount of frames are in the anim. It's usually like 30 for a draw animation.

Start out with the draw animation, of course. Now that you have the frame numbers, you can start animating it! MAKE SURE YOU SET BLENDER'S FPS TO 30 IN THE RENDER TAB!

If you don't know how to animate, then I'm not sure what you're actually doing here. There are a million billion tutorials on how animation works in Blender and 3DS Max, but here are a couple links that may also come in handy:

My video of animating the Demoman's swords
TF2 first person cameras for blender
Mr. Brightside's channel

I included Mr. Brightside's channel here because he does a lot of animating streams. I haven't really watched them, but I know he's good so I thought it'd be useful. He uses 3DS Max but all technique still applies.

Make sure you make NEW saves instead of overwriting the rig's save!

Part 3: Exporting

Now that you've animated the draw animation, you have a few options. You could test it in-game, or continue working on the animations. You could make the idle animation, the reload animations, the fire animations, whatever. I'd recommend testing out the draw first, to make sure everything's okay.

You may notice that in my video of animating the Demoman, the idle and draw are in the same blend file. You can include every animation for a weapon in the same blender file, and export it as one smd. You have to specify the frame numbers for each anim during compiling, though. More on that later.

Now that you have an animation ready to test in-game, you have to compile it. 

Go into the "Scene" tab on blender, and scroll all the way down to "Source Engine Export." Click "SMD", and specify an export path. This can be on your desktop, or in the "Shotgun" folder of "Engineer - New Shotgun Animations". Either way, it needs to end up in the Shotgun folder.

Under "Source Engine Exportables", click on "EngineerArmAction" or whatever it's called. Just not the weapon or arm models. It's the one with three diamonds next to it, and not a triangle. Now that you've clicked on it, type "/" under where it says "Subfolder". If you don't do this, it'll always make a new folder called "anims" wherever your export path is.

Rename it to "Shotgun" or something. Do this through the little text box where it currently says the name of whatever the animation's currently called, in the "ARMATURE PROPERTIES" box.



Now that it's all set up, just export the animation by selecting the Engineer's bones and pressing "File/Export/Valve smd" (top left corner)

Now Shotgun.smd is in the "Shotgun" folder of "Engineer - New Shotgun Animations". If it isn't, get it there. If it doesn't exist, what did you do?? 

Open the c_engineer_animations.qc file that's in the Shotgun folder with Notepad++. Welcome to compiling. 

Part 4: Compiling

Scroll down to where it starts listing $sequences. These are the animations, and controls how the engine handles them. You can make the animation snap, fade in/out, assign sounds that play during the animation (NOT fire sounds), etc.

I'm assuming you made your animations all in one smd file, or just have a draw animation. You're going to need to make them all in one smd file / blender save anyway, because making them all separate blender saves and whatever is just annoying.

We're handling the draw animation right now. 

It should look something like:

$sequence "fj_draw" "fj_draw.smd" {
	fps 30
	activity "ACT_PRIMARY_VM_DRAW" 1
	snap
	node "raised"
	{ event 5004 0.999999962747097 "Weapon_Shotgun.Draw" }
}

Let me explain all of this in a picture:


Now that you know all that, let me explain a few extra things:

In order to specify the draw animation's start and end in your smd, you have to use an extra command.

Frames 0 30

The 0 is the start of the draw animation, and the 30 is the end. If it were an idle, it could be like "Frames 30 90"

Also, make sure you change fj_draw.smd to shotgun.smd, whatever the name of your exported animation was.

For draw animations ONLY, change the fps from 30 to 22. This will prevent the game from speeding up the animation by itself. Thanks, Tough Break.

Proceed to do this with any other animations you're replacing.

If you have NppExec installed in Notepad++ correctly, pressing F6 should open this little window. In the command(s) box, paste (WITH QUOTATION MARKS); 

"C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\studiomdl.exe" "$(FULL_CURRENT_PATH)"
Or
"C:\Program Files\Steam\steamapps\common\Team Fortress 2\bin\studiomdl.exe" "$(FULL_CURRENT_PATH)" 
if you have a x32 bit OS.



Save it as "studiomdl", and press OK. There now should be a 'model' folder inside of \tf\. Cut it, make a new folder inside of "custom", and paste the folder in there. 

If it's giving an error like "cannot find gameinfo.txt", then get TF2's gameinfo.txt from online and place it on your desktop. It'll now place a 'models' folder on your desktop instead.

Since this is SCA, you need to compile every qc in your "Engineer - New Shotgun Animations" folder. Place 'models' (wherever it might have ended up) in a new folder in tf/custom, and launch the game.

Part 5: Testing

Go ahead and load up itemtest and pick Engineer. Did it work? 

If so, great! You might not be happy with the animation, but welcome to animating. Now that it's in a usable state, if you want to edit the animation, all you have to do is reexport it from blender, and compile the c_engineer_animations.qc in the Shotgun folder, and place models into tf/custom/yournewfolder.

If not, then a lot could have gone wrong. Just try and absorb all of the info in the tutorial and make sure you did everything right.

Part 6: Advanced

This is where I discuss some advanced stuff, like animating in 60 FPS, and getting seamless transitions in your anims.

To animate in 60 FPS, you need to multiply all frame numbers by 2. A 30 frame draw animation is now 60, or a 5 frame fire animation is now 10 frames long.

Change the fps in the QC of your edited sequences to 60. Change Blender's settings in the Render tab to 60. That's it.

Making seamless transitions are simple, yet very, VERY annoying. Here's a copy of what I wrote on Kiyoshi's New Heavy animation WiP page:

To avoid animation hiccup, bleeding, and stuttering in-game, do this (this is only visible in online servers) :

(keep in mind I'm talking about 60 fps, if you animate in 30 fps still then just do half)

- Delay reload_start/end and inspect_start_end by 5 frames, so the first 5 frames of the animation are just nothing and it lasts an extra 5 frames as compared to Valve's animations. You have to delay them, because the first 5 frames are always cut off.

- Add 5 frames of very slight movement to the end of reload_idle. When the looping animation is played for the first time, it's kinda frozen for 5 frames before it loops again. The extra movement keeps it from being totally still.

- Add 5 frames to the end of the draw animations, so they don't freeze before transitioning to idle. I'm also pretty sure 5 frames from the beginning are completely cut out.

- Remove 'loop' from your reloading qcs

- Make sure you change every draw animation's fps in the qc to "22" (30fps) or "44" (60fps) to avoid them from being cosmetically sped up in game. If you don't, they'll be frozen before transitioning to idle for even longer.



1-10 of 135
1
Pages
Go to page:
  • ZcyTHe avatar
    ZcyTHe Joined 5y ago
    Offline
    163 points Ranked 58399th
    3mo
    I went on game to check the animations so far and they just don't work, my weapons are stuck at the top right corner of the screen for some reason
    http://prntscr.com/mz62eg
    EPIC GAMER
    URL to post:
  • KaidemonLP avatar
    KaidemonLP username pic Joined 3y ago
    Offline
    13,187 points Ranked 422nd
    20 medals 2 legendary 3 rare
    • 2017 Top Contributor Medal icon
    • 30 submissions featured Medal icon
    • 10 submissions featured Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • One month a member Medal icon
    2y 2y
    So, i would like to make multiple animations for 1 action ( like the multiple attack animations in melees but for primaries) but i dont know how.

    Is it even possible?

    EDIT:
    Ive done some more testing and i got it to work.
    • Disagree x 1
    • Sorry x 1
    The Juice King avatar
    Mantra
    The Juice King
    URL to post:
  • Zedwick avatar
    Zedwick Joined 2y ago
    Offline
    2y
    Just curious is there a way to use Source Filmmaker when making new animations or does it have to be blender?
    Bananite
    URL to post:
  • MarioDox avatar
    MarioDox username pic Joined 5y ago
    Searchin' love
    ?
    Mario's Company Flag Affiliation: Mario's Company
    9,452 points Ranked 603rd
    34 medals 3 legendary 5 rare
    • Returned 5000 times Medal icon
    • Submitted 50 Maps Medal icon
    • 30 submissions featured Medal icon
    • Returned 1000 times Medal icon
    • 10 submissions featured Medal icon
    • Submitted 50 Skins Medal icon
    MarioDox avatar
    MarioDox
    Mario's Company Flag
    Affiliation
    Mario's Company
    2y
    Activity in the qc is the animation id, that can be used for multiple animations that sadly don't work online. (aka various shoot, idle and draw animations)
    URL to post:
  • ScrapGB avatar
    ScrapGB Joined 3y ago
    Offline
    595 points Ranked 43766th
    2y
    Why the hell would you mess with w_models? As far as I know the game doesn't even use them.
    I just wanted Scrap...
    URL to post:
  • Paysus avatar
    Paysus Joined 6y ago
    Offline
    68,781 points Ranked 59th
    26 medals 2 legendary 5 rare
    • Returned 5000 times Medal icon
    • Reached 100 subscribers Medal icon
    • Received thanks 50 times Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • 10 submissions featured Medal icon
    Paysus Skinning/Modelling Expert
    2y
    Posted by sir strawberry

    It's a w model, so no arms.
    We aren't messing with w models here. These are c models.
    I like to make things. avatar
    Mantra
    I like to make things.
    URL to post:
  • It's a w model, so no arms.
    Bananite
    URL to post:
  • Preggo Waffles avatar
    Preggo Waffles Joined 5y ago
    Offline
    Refraction Studios Flag Affiliation: Refraction Studios
    2,060 points Ranked 20573rd
    14 medals 2 rare
    • Returned 1000 times Medal icon
    • 10 submissions featured Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    • Became a Studio Leader Medal icon
    Preggo Waffles Refraction Studios Flag
    Affiliation
    Refraction Studios
    2y
    i believe fadein 0.04 works just as well as snap, it just doesnt remove the smoothing.
    Top Quality Shitposter
    URL to post:
  • Paysus avatar
    Paysus Joined 6y ago
    Offline
    68,781 points Ranked 59th
    26 medals 2 legendary 5 rare
    • Returned 5000 times Medal icon
    • Reached 100 subscribers Medal icon
    • Received thanks 50 times Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • 10 submissions featured Medal icon
    Paysus Skinning/Modelling Expert
    2y
    Posted by sir strawberry

    If you created your own custom weapon model, would you just open up the default arms? I am creating a custom disguise kit for spy. Do I open up my disguisekit.blend file, and then open the arms.blend along with them? Thanks.
    Does the disguise kit still use a v model? I dont remember

    Either way you'd open up the IK rig save and import your custom disguise kit smd. If its a v model and has arms, just delete the additional arms from the smd. Delete the IK rig's previous weapon_bone and weapon model, and combine the IK rig and newly imported disguise kit models and armatures
    I like to make things. avatar
    Mantra
    I like to make things.
    URL to post:
  • If you created your own custom weapon model, would you just open up the default arms? I am creating a custom disguise kit for spy. Do I open up my disguisekit.blend file, and then open the arms.blend along with them? Thanks.
    Bananite
    URL to post:

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
Paysus
Paysus Joined 6y ago
Offline
68,781 points Ranked 59th
26 medals 2 legendary 5 rare
  • Returned 5000 times Medal icon
  • Reached 100 subscribers Medal icon
  • Received thanks 50 times Medal icon
  • Returned 1000 times Medal icon
  • Reached 50 subscribers Medal icon
  • 10 submissions featured Medal icon
Author
Contributers
[N-Cognito] avatar
[N-Cognito] username pic Joined 7y ago
TF2 Manager
Offline
33,868 points Ranked 134th
39 medals 5 legendary 7 rare
  • 1st Place - Halloween Concept Art Contest 2014 Medal icon
  • Returned 5000 times Medal icon
  • Reached 100 subscribers Medal icon
  • 30 submissions featured Medal icon
  • 2017 Top Contributor Medal icon
  • Received thanks 50 times Medal icon
Maintains SCA, created Rigs

Submitter

Paysus avatar
Paysus Joined 6y ago
Offline
68,781 points Ranked 59th
26 medals 2 legendary 5 rare
  • Returned 5000 times Medal icon
  • Reached 100 subscribers Medal icon
  • Received thanks 50 times Medal icon
  • Returned 1000 times Medal icon
  • Reached 50 subscribers Medal icon
  • 10 submissions featured Medal icon
Paysus
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 11
  • 59.4k
  • 146
  • 6y
  • 2y
  • 2y

WiPs by Submitter

More Skinning Tutorials