Painted variants (tutorial)

From Team Fortress Wiki
Jump to: navigation, search

This painted variants tutorial will document the current method of painting hats using Half-Life Model Viewer (HLMV). There is an experimental automation toolset for experienced users, found here. This tutorial assumes that you already have HLMV installed. If you don't, navigate to this page and read the information on it.

Setting up HLMV

We want the images to be the best quality possible, so you need to set up HLMV so that it generates high quality images. You can force high quality settings in your graphics cards control panel, but this does not work for some people - so I will document the alternate method.

Dxsupport.cfg

  1. Navigate to this directory: \Steam\steamapps\common\Team Fortress 2\bin\.
  2. Open up dxsupport.cfg in a text editor of your choice. If you do not have this file, create it with the content from here.
  3. Find your graphics card within that file. If it is not listed go to the bottom and use ATI Unknown, NVidia Unknown or Intel Unknown depending on your graphics card manufacturer.
  4. Add or modify the following lines in dxsupport.cfg within the section for your graphics card, and save it.
    "setting.dxlevel" "99"
    "ConVar.mat_antialias" "8"
    "ConVar.mat_forceaniso" "8"
    "ConVar.mat_picmip" "-10"
  5. Open up a model and ensure there is no aliasing or other quality defects. If there is it's likely your graphics card is not able to render images of high enough quality, or you will need to adjust the settings in your graphics card's control panel.

HLMV options

  1. Open up HLMV through the hlmv.exe in this directory: \Steam\steamapps\common\Team Fortress 2\bin\.
  2. Check (if it's not already checked) the "Normal Mapping" checkbox.
  3. Set the background colour to white for each item: Options... > Background Color....
  4. Full-screen HLMV (so you get a nice big image).
  5. When generating hat images, you should use the red team texture and angle the hat slightly forward and facing left or right (get as much of the hat in view as possible). For example: File:Painted_Tough_Guy's_Toque_7D4071.png. All the painted images of a certain hat should be in the same position.

Taking the images

Rotations

Before you start taking images, check rotations and see if the item you're painting is noted on there. If it is, follow the "Setting rotations" section, otherwise when you've finished, follow the "Saving rotations" section.

Setting rotations

  1. Open regedit.exe (Start - Run).
  2. Navigate to: HKEY_CURRENT_USER\Software\Valve\hlmv
  3. For your item, pick the associated directory - these will be listed on the rotations page.
  4. In the right-panel, double click "Rot" and copy-paste the value in the Rotations page for your item.
    • Also do this for any "trans" and "lightrot" values, if provided.
  5. Close regedit, and re-open your item in HLMV.
  6. If there is a "FOV" value on the Rotations page for your item, you can enter this into HLMV - at the bottom left of the "Render" tab.
  7. You made need to move the item around a bit to get it show up correctly, and as large as possible. If this happens, read the "Saving rotations" section.

Saving rotations

If your item does not have an entry on the rotations page...

  1. Open the item in HLMV.
  2. Play around with the positioning - positioning it slightly forward, and then left or right - until you get a good view of the hat. The positioning should show as much of the item as possible.
  3. Follow the "Setting rotations" section, however instead of replacing the "Rot" value - copy it.
    • Do the same for "trans" and "lightrot" - if they have been adjusted.
  4. Make an entry in the Rotations page, in the relevant position, documenting your item. Note the name of the item, it's registry-folder name and the rotation used.
  5. Commence generating the images, sticking to this rotation.

VMT Editing

  1. Open tf2_misc_dir.vpk in GCFScape.
  2. Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use \materials\models\player\items\heavy\heavy_stocking_cap.vmt, and should be extracted to: \Steam\steamapps\common\Team Fortress 2\tf\custom\folder\materials\models\player\items\heavy.
  3. Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
  4. Near the top of the VMT, change $detailblendfactor to .00. This removes the faint fire overlay (most noticeable on black painted items).
    • There is another option to remove the fire overlay, which is downloading and extracting this texture replacement, and copying the contents to \Steam\steamapps\common\Team Fortress 2\tf\custom\. This will replace the default file texture with a 512x512 black material, effectively nullifying the effect for all models.
  5. Create a new line in the VMT file underneath "$colortint_base" "{VALUE}" and fill it with this content "$color2" "{R G B}". You can find a complete list of colours to copy/paste below.
  6. Paste the relevant RGB value found in the table below.
  7. Hit F5 in HLMV and take a screenshot of this color, and paste it into new document in an image editor of your choice.
    • If the image editor you are using supports layers, and you are taking multiple screenshots, paste the first one into a new document. Any screenshots of that image you take after that should then go into a new layer in that document.
  8. Repeat the previous two steps for each color.
//	Uncomment and re-comment as necessary."
//	"$color2"		"{}"    		// Stock - Copy the value of "$colortint_base" into here."
//	"$color2"		"{230 230 230}"		// An Extraordinary Abundance of Tinge"
//	"$color2"		"{216 190 216}"		// Color No. 216-190-216"
//	"$color2"		"{197 175 145}"		// Peculiarly Drab Tincture"
//	"$color2"		"{126 126 126}"		// Aged Moustache Grey"
//	"$color2"		"{20 20 20}"		// A Distinctive Lack of Hue"
//	"$color2"		"{45 45 36}"		// After Eight"
//	"$color2"		"{105 77 58}"		// Radigan Conagher Brown"
//	"$color2"		"{124 108 87}"		// Ye Olde Rustic Color"
//	"$color2"		"{165 117 69}"		// Muskelmannbraun"
//	"$color2"		"{207 115 54}"		// Mann Co. Orange"
//	"$color2"		"{231 181 59}"		// Australium Gold"
//	"$color2"		"{240 230 140}"		// The Color of a Gentlemann's Business Pants"
//	"$color2"		"{233 150 122}"		// Dark Salmon Injustice"
//	"$color2"		"{255 105 180}"		// Pink as Hell"
//	"$color2"		"{125 64 113}"		// A Deep Commitment to Purple"
//	"$color2"		"{81 56 74}"		// Noble Hatter's Violet"
//	"$color2"		"{47 79 79}"		// A Color Similar to Slate"
//	"$color2"		"{66 79 59}"		// Zephaniah's Greed
//	"$color2"		"{128 128 0}"		// Drably Olive"
//	"$color2"		"{114 158 66}"		// Indubitably Green"
//	"$color2"		"{50 205 50}"		// The Bitter Taste of Defeat and Lime"
//	"$color2"		"{188 221 179}"		// A Mann's Mint"
//	"$color2"		"{168 154 140}"		// Waterlogged Lab Coat (RED)"
//	"$color2"		"{131 159 163}"		// Waterlogged Lab Coat (BLU)"
//	"$color2"		"{59 31 35}"		// Balaclavas Are Forever (RED)"
//	"$color2"		"{24 35 61}"		// Balaclavas Are Forever (BLU)"
//	"$color2"		"{184 56 59}"		// Team Spirit (RED)"
//	"$color2"		"{88 133 162}"		// Team Spirit (BLU)"
//	"$color2"		"{72 56 56}"		// Operator's Overalls (RED)"
//	"$color2"		"{56 66 72}"		// Operator's Overalls (BLU)"
//	"$color2"		"{128 48 32}"		// The Value of Teamwork (RED)"
//	"$color2"		"{37 109 141}"		// The Value of Teamwork (BLU)"
//	"$color2"		"{101 71 64}"		// An Air of Debonair (RED)"
//	"$color2"		"{40 57 77}"		// An Air of Debonair (BLU)"
//	"$color2"		"{195 108 45}"		// Cream Spirit (RED)"
//	"$color2"		"{184 128 53}"		// Cream Spirit (BLU)"

Styles

If the item has an alternate style that's not a separate model, rename the style's VMT to the normal VMT. For instance, for the Reggaelator, the normal VMT (and the Original style) is demo_dreads.vmt, and the style VMTS are demo_dreads_style01.vmt for Burst, demo_dreads_style02.vmt for Bones, and demo_dreads_style03.vmt for Designer. To use the Burst style, rename demo_dreads_style01.vmt to demo_dreads.vmt and hit F5 in HLMV. The same thing would then be done for each other style, just using the appropriate VMT for it. Everything else on this page will then apply in the same way.

If an item has an alternate style that is a separate model, the style's model has to be loaded separately. For instance, for the Front Runner, the model for the Stylin' style is scout_headband.mdl, whereas the model for the Indifferent style is scout_headband_s01.mdl. For most items, the registry settings for it can be set exactly the same for each style, and then everything else on this page will apply in the same way.

Export and upload the images

Pictogram comment.png Note: This section of the Tutorial assumes you are using Photoshop. Other image editors might not have this option, or might have it named differently or in a different location.

  1. Go to File... - Scripts... - Export layers to file and set the destination to wherever you see fit, and the file-type to PNG-24.
  2. Ensure "Transparency" and "Trim layers" are both ticked, and hit "Run".
  3. Upload a new version of the existing files on the Wiki. Use {{subst:pid}} in the upload summary box to automatically add licensing and proper categories (this saves you from typing out categories or manually selecting a license in the drop down box).

Pictogram comment.png Note: You may get an error when you try to run this script. If you do, you will have to save all of the images manually yourself. If that is the case, ignore steps one and two of this section of the guide, and follow it from step 3.