Difference between revisions of "Template:Painted variants/Tutorial"

From Team Fortress Wiki
Jump to: navigation, search
(Modify VMT Files)
(Updated to include info about the semiautomated methods. The manual method isn't used much any more.)
 
(37 intermediate revisions by 17 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:Painted variants (tutorial)}}
 
{{DISPLAYTITLE:Painted variants (tutorial)}}
This tutorial will document the current method of painting hats using HLMV.
+
{{Help navbar}}
 +
 
 +
This '''painted variants tutorial''' will document the current methods of painting cosmetic items using '''[[vdc:Model Viewer|Half-Life Model Viewer]]''' ('''HLMV'''). This tutorial assumes that you already have HLMV working. If you haven't gotten HLMV set up, navigate to [[Help: Model Viewer|this page]] and read the information on it.
 +
 
 +
== Other necessary programs ==
 +
For this tutorial, we will utilize GCFScape, which may be downloaded [https://web.archive.org/web/20191003064603/http://www.nemesis.thewavelength.net/index.php?p=26 here], as either an installer or a portable archive. In addition, if painting cosmetics which have [[Jiggle bones|jigglebones]], it may be useful to remove them by decompiling the model, removing references to the jigglebones, and recompiling a new model file. For this process, you will also need the [https://steamcommunity.com/groups/CrowbarTool Crowbar] tool.  If you plan on using the semi automatic methods you will need [[vdc:Half-Life Model Viewer++|HLMV++]] and [https://github.com/NeoDement/TFMV TFMV] for capturing the images. Additionally you will need [https://www.gimp.org GIMP] and the [https://www.alessandrofrancesconi.it/projects/bimp/ Batch Image Manipulation Plugin (BIMP)] for processing the images before uploading.
 +
 
 +
== Removing jigglebones from models ==
 +
Cosmetics with jigglebones may prove to be an issue when painting, as their jigglebones may move when you refresh HLMV, in the process of changing paint colors. This may make it difficult to take identical-looking images, in which case, the jigglebones can be removed with the use of the Crowbar tool.
 +
 
 +
=== Decompiling the models ===
 +
# Upon first booting Crowbar, you will be presented with the Set Up Games tab. Here, you may configure which game you would like to use with the program, and enter the location of your Steam executable, so that Crowbar can find the tools it needs to work. Select Team Fortress 2 from the drop down menu at the top, and enter the location of your Steam executable in the {{code|<library1>}} macro section at the bottom.
 +
# Using GCFScape, extract the {{code|.mdl}} file you wish to remove jigglebones from, and all matching {{code|.vtx}} and {{code|.vvd}} files.
 +
# In Crowbar's Decompile tab, you will notice the {{code|MDL input}} field, and the {{code|Output to:}} selector. In the {{code|MDL input}} field, select the {{code|.mdl}} file you extracted previously.
 +
# Set {{code|Output to:}} to the {{code|Work folder}} option, and create a directory where you would like to save the decompiled files on your computer.
 +
# Press the Decompile button. If successful, you should have a {{code|.qc}} file, and {{code|.smd}} files present in your work folder. These files are all necessary to recompile the model, and should follow the same file names as the model file you extracted.
 +
 
 +
=== Removing jigglebones and recompiling ===
 +
# Open the {{code|.qc}} file from your decompilation work folder in a text editor, and remove all references to jigglebones. Save the file.
 +
# Back in Crowbar, select the Compile tab. In the {{code|QC input}} section, select the {{code|.qc}} file from your decompilation work folder.
 +
# Just as before, set {{code|Output to:}} to the {{code|Work folder}} option, and create a directory to save the compiled files to.
 +
# Press the Compile button. If successful, your compilation work folder should now have identical files to the ones you extracted from GCFScape, nested within subfolders.
 +
{{c|note}}: If you run into an error while compiling, it may be that Team Fortress 2, or the location of your Steam executable, was improperly set up in the Set Up Games tab; or that the decompilation process failed to produce the necessary files to recompile the model. Check that you have properly set up Team Fortress 2 and the file paths to its tools, and that you have properly extracted all relevant files from GCFScape.
 +
 
 +
{{c|note}}: Be sure to upload your recompiled files to a file sharing site, and link to them when adding details to the [[Template:Painted variants/Tutorial/Rotations|Rotations]] page! This will help other users to create identical images to yours, should the need arise.
  
 
== Setting up HLMV ==
 
== Setting up HLMV ==
We want the images to be the best quality possible, so you need to set up Half Life Model Viewer 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.
+
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.
 
 
=== DLL Support ===
 
Instead of modifying VTF files, we can set up HLMV to correctly interpret newer VMT files and modify them directly, allowing us to have fully accurate representation of colors. To support this in-model viewer representation of paint, some SDK DLLs need updating:
 
# Run TF2 to ensure the correct binaries are updated prior to copying.
 
# Each time you run the SDK, but before you open the Model Viewer, we'll need to copy the dlls from TF2 into the SDK. A script has been created for your convenience.
 
# Simply copy the script below into a conventional text editor and save it as a .bat file. Now each time you open the SDK, simply run the saved .bat
 
@echo off
 
for /F "tokens=2* delims= " %%A in ('REG QUERY "HKCU\Software\Valve\Steam" /v SteamPath 2^>nul') do set _steamdir=%%B
 
set _steamdir=%_steamdir:/=\%
 
for /f "tokens=2,3 delims= " %%a in ('findstr /C:AutoLoginUser "%_steamdir%\config\SteamAppData.vdf"') do set _steamuser=%%~a
 
copy "%_steamdir%\steamapps\%_steamuser%\team fortress 2\bin\stdshader_dx9.dll" "%_steamdir%\steamapps\%_steamuser%\sourcesdk\bin\orangebox\bin\stdshader_dx9.dll" >nul
 
echo Done.
 
exit /b 0
 
  
 
=== <code>Dxsupport.cfg</code> ===
 
=== <code>Dxsupport.cfg</code> ===
# Navigate to this directory <code>T:\Steam\steamapps\username\sourcesdk\bin\orangebox\bin</code> (where <code>T:\</code> the folder your Steam folder resides in).
+
# Navigate to this directory: {{code|\Steam\steamapps\common\Team Fortress 2\bin\}}.
# Open up <code>Dxsupport.cfg</code> in a text editor of your choice.  If you do not have this file, create it with [http://pastebin.com/8AsEWL19 this content].
+
# Open up {{code|dxsupport.cfg}} in a text editor of your choice.  If you do not have this file, create it with the content from [[Dxsupport.cfg.txt|here]].
# Find your graphics card within that file, if it is not listed go to the bottom and use <code>ATI Unknown</code> or <code>NVidia Unknown</code> depending on your graphics card manufacturer.
+
# Find your graphics card within that file. If it is not listed go to the bottom and use {{code|ATI Unknown}}, {{code|NVidia Unknown}} or {{code|Intel Unknown}} depending on your graphics card manufacturer.
# Add or modify the following lines in <code>Dxsupport.cfg</code> - within the section for your graphics card, and save it.
+
# Add or modify the following lines in {{code|dxsupport.cfg}} within the section for your graphics card, and save it.<br />{{code|"setting.dxlevel" "99"<br />"ConVar.mat_antialias" "8"<br />"ConVar.mat_forceaniso" "8"<br />"ConVar.mat_picmip" "-10"}}
<pre>"DxLevel" "99"
+
# 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.
"ConVar.mat_antialias" "8"
 
"ConVar.mat_forceaniso" "8"
 
"ConVar.mat_picmip" "-10"</pre>
 
:5. Open up a model and ensure there is no anti-aliasing or other quality defects. If there is it's likely your graphics card is not able to render images of high enough quality.
 
  
=== HLMV Options ===
+
=== HLMV options ===
# Open up Model Viewer via the Source SDK.
+
# Open up HLMV through the hlmv.exe in this directory: {{code|\Steam\steamapps\common\Team Fortress 2\bin\}}.
# Check (if it's not already checked) the <code>Normal Mapping</code> checkbox.
+
# Check (if it's not already checked) the "Normal Mapping" checkbox.
# Set the background colour to white for each item: <code>Options... > Background Color...</code>
+
# Set the background colour to white for each item: {{code|Options... > Background Color...}}.
 
# Full-screen HLMV (so you get a nice big image).
 
# Full-screen HLMV (so you get a nice big image).
# 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.
+
# 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.
  
== Modify VMT Files ==
+
== Taking the images ==
{| class="wikitable grid" style="float: right;"
+
=== Rotations ===
! class="header" | Name
+
Before you start taking images, check [[/Rotations|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.
! class="header" | Color
 
! class=header | {R G B}
 
|-
 
| A Deep Commitment to Purple
 
| style="background:#7D4071" | <font color="white">#7D4071</font>
 
| {125 64 113}
 
|-
 
| Aged Moustache Grey
 
| style="background:#7E7E7E" | #7E7E7E
 
| {126 126 126}
 
|-
 
| [[Australium]] Gold
 
| style="background:#E7B53B" | #E7B53B
 
| {231 181 59}
 
|-
 
| Color No. 216-190-216
 
| style="background:#D8BED8" | #D8BED8
 
| {216 190 216}
 
|-
 
| Indubitably Green
 
| style="background:#729E42" | #729E42
 
| {114 158 66}
 
|-
 
| [[Mann Co.]] Orange
 
| style="background:#CF7336" | #CF7336
 
| {207 115 54}
 
|-
 
| Muskelmannbraun
 
| style="background:#A57545" | #A57545
 
| {165 117 69}
 
|-
 
| Noble Hatter's Violet
 
| style="background:#51384A" | <font color="white">#51384A</font>
 
| {81 56 74}
 
|-
 
| Peculiarly Drab Tincture
 
| style="background:#C5AF91" | #C5AF91
 
| {197 175 145}
 
|-
 
| [[Radigan Conagher]] Brown
 
| style="background:#694D3A" | #694D3A
 
| {105 77 58}
 
|-
 
| Ye Olde Rustic Color
 
| style="background:#7C6C57" | #7C6C57
 
| {124 108 87}
 
|-
 
| [[Non-player characters#Zepheniah Mann and Company|Zephaniah]]'s Greed
 
| style="background:#424F3B" | #424F3B
 
| {66 79 59}
 
|-
 
| An Extraordinary Abundance of Tinge
 
| style="background:#E6E6E6" | #E6E6E6
 
| {230 230 230}
 
|-
 
| A Distinctive Lack of Hue
 
| style="background:#141414" | <font color="white">#141414</font>
 
| {20 20 20}
 
|-
 
| Pink as Hell
 
| style="background:#FF69B4" | #FF69B4
 
| {255 105 180}
 
|-
 
| A Color Similar to Slate
 
| style="background:#2F4F4F" | #2F4F4F
 
| {47 79 79}
 
|-
 
| Drably Olive
 
| style="background:#808000" | #808000
 
| {128 128 0}
 
|-
 
| The Bitter Taste of Defeat and Lime
 
| style="background:#32CD32" | #32CD32
 
| {50 205 50}
 
|-
 
| The Color of a Gentlemann's Business Pants
 
| style="background:#F0E68C" | #F0E68C
 
| {240 230 140}
 
|-
 
| Dark Salmon Injustice
 
| style="background:#E9967A" | #E9967A
 
| {233 150 122}
 
|-
 
| An Air of Debonair (RED)
 
| style="background:#654740" | <font color="white">#654740</font>
 
| {101 71 64}
 
|-
 
| An Air of Debonair (BLU)
 
| style="background:#28394D" | <font color="white">#28394D</font>
 
| {40 57 77}
 
|-
 
| Balaclavas are Forever (RED)
 
| style="background:#3B1F23" | <font color="white">#3B1F23</font>
 
| {59 31 35}
 
|-
 
| Balaclavas are Forever (BLU)
 
| style="background:#18233D" | <font color="white">#18233D</font>
 
| {24 35 61}
 
|-
 
| Cream Spirit (RED)
 
| style="background:#C36C2D" | #C36C2D
 
| {195 108 45}
 
|-
 
| Cream Spirit (BLU)
 
| style="background:#B88035" | #B88035
 
| {184 128 53}
 
|-
 
| Operator's Overalls (RED)
 
| style="background:#483838" | <font color="white">#483838</font>
 
| {72 56 56}
 
|-
 
| Operator's Overalls (BLU)
 
| style="background:#384248" | <font color="white">#384248</font>
 
| {56 66 72}
 
|-
 
| Team Spirit (RED)
 
| style="background:#B8383B" | #B8383B
 
| {184 56 59}
 
|-
 
| Team Spirit (BLU)
 
| style="background:#5885A2" | #5885A2
 
| {88 133 162}
 
|-
 
| The Value of Teamwork (RED)
 
| style="background:#803020" | <font color="white">#803020</font>
 
| {128 48 32}
 
|-
 
| The Value of Teamwork (BLU)
 
| style="background:#256D8D" | #256D8D
 
| {37 109 141}
 
|-
 
| Waterlogged Lab Coat (RED)
 
| style="background:#A89A8C" | #A89A8C
 
| {168 154 140}
 
|-
 
| Waterlogged Lab Coat (BLU)
 
| style="background:#839FA3" | #839FA3
 
| {131 159 163}
 
|}
 
  
=== VMT Editing ===
+
==== Setting rotations ====
# For the best view of images, you should remove fire overlay and strong reflections from the [[Classes|class]] model. [http://www.thundermountain.ru/downloads/files/ReflectionsAndFireOverlayFix.zip This file] will fix both problems.
+
# Open regedit.exe (Start - Run).
# Open <code>team fortress 2 materials.gcf</code> in GCFScape.
+
# Navigate to: {{code|HKEY_CURRENT_USER\Software\Valve\hlmv}}
# Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use <code>\tf\materials\models\player\items\heavy\heavy_stocking_cap.vmt</code>, and should be extracted to: <code>T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy</code>.
+
# For your item, pick the associated directory - these will be listed on the rotations page.
 +
# 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.
 +
# Close regedit, and re-open your item in HLMV.
 +
# 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.
 +
# You may need to move the item around a bit to get it to show up correctly, and as large as possible. If this happens, read the "Saving rotations" section.
 +
#* Generally, when choosing your own rotations, you'll need to find an angle that shows off the painted area the most.
 +
 
 +
==== Saving rotations ====
 +
If your item does not have an entry on the rotations page...
 +
# Open the item in HLMV.
 +
# 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.
 +
# 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.
 +
# 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.
 +
# Commence generating the images, sticking to this rotation.
 +
 
 +
== VMT Editing Method ==
 +
# Open {{code|tf2_misc_dir.vpk}} in GCFScape.
 +
# Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use {{code|\materials\models\player\items\heavy\heavy_stocking_cap.vmt}}, and should be extracted to: {{code|\Steam\steamapps\common\Team Fortress 2\tf\custom\folder\materials\models\player\items\heavy}}.
 
# Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
 
# Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
# Near the top of the VMT, change <code>"$detailblendfactor" .01</code> to <code>"$detailblendfactor" .00</code>. This removes the faint fire overlay (most noticeable on black painted items).
+
# Near the top of the VMT, change {{code|$detailblendfactor}} to {{code|.00}}. This removes the faint fire overlay (most noticeable on black painted items).
# Create a new line in the VMT file underneath <code>"$colortint_base" "{VALUE}"</code> and fill it with this content <code>"$color2" "{R G B}"</code>.  You can find a complete list of colours to copy/paste below.
+
#*There is another option to remove the fire overlay, which is [http://www.mediafire.com/download/2i3das2jx2v5fd6/BlackFirePlusBlackBackground.zip downloading and extracting this texture replacement], and copying the contents to {{code|\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.
# Paste the relevant RGB value found in the table to the right.
+
# Create a new line in the VMT file underneath {{code|"$colortint_base" "{VALUE}"}} and fill it with this content {{code|"$color2" "{R G B}"}}.  You can find a complete list of colours to copy/paste below.
# Hit F5 in HLMV and take a screenshot of this color, and paste it in a Photoshop document.
+
# Paste the relevant RGB value found in the table below.
# Repeat steps 5-6 for each color.
+
# Hit {{key|F5}} in HLMV to refresh the model and then take a screenshot of this color, and paste it into a 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.
 +
# Repeat the previous two steps for each color.
 +
 
 +
<pre>
 +
// 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)"
 +
</pre>
 +
 
 +
=== Styles ===
 +
If the item has an alternate [[Styles|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 {{code|demo_dreads.vmt}}, and the style VMTS are {{code|demo_dreads_style01.vmt}} for Burst, {{code|demo_dreads_style02.vmt}} for Bones, and {{code|demo_dreads_style03.vmt}} for Designer. To use the Burst style, rename {{code|demo_dreads_style01.vmt}} to {{code|demo_dreads.vmt}} and hit {{key|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 {{code|scout_headband.mdl}}, whereas the model for the Indifferent style is {{code|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.
 +
 
 +
== Semi Automatic Methods ==
 +
=== HLMV++ Method ===
 +
{{c|note}} While the script is running the background will flash black and white very quickly so be careful if you are sensitve to that sort of thing.
 +
# Load the model in HLMV++
 +
# Download the [https://github.com/Mediarch/HLMV-Stuff/raw/main/AUTO-PaintedVariants%20mvscripts.zip AUTO-PaintedVariants mvscripts].
 +
# In HLMV++ select {{code|File > Run .mvscript}} then open {{code|AUTO-PaintedVariants-Part1.mvscript}}. The script should cylce through the paint colors taking screenshots after each one. The images will be saved to wherever the script is located so you may choose to make a folder and drag the script into it so the images are organized.
 +
# Part1 of the script will handle the single color paints (Pink as Hell, Drabby Olive etc.) and the red team colors (Team Spirit, Value of Teamwork). To get the Blu colors you need to set the skin of the cosmetic to the blu version in the model tab of HLMV++ then hit {{key|F5}} to refresh and reset the cosmetic to unpainted
 +
# Like with Part1, select {{code|File > Run .mvscript}} then open {{code|AUTO-PaintedVariants-Part2.mvscript}}.
 +
# Once the images have been captured open GIMP and select {{code|File > Batch Image Manipulation...}}
 +
# Where it says Manipulation set click {{code|Add > Load set}} and open the {{code|Auto-Crop and Convert to PNG.bimp}} set which can be found [https://github.com/Mediarch/HLMV-Stuff/raw/main/BIMP%20Auto-Crop%20Sets.zip here].
 +
# Click {{code|Add images > Add folders...}} and open the folder where the images are stored and set the {{code|Output folder:}} to your desired location.
 +
# Select Apply and BIMP will crop and convert all of the images.
 +
 
 +
=== TFMV Method ===
 +
# Select the model and class in TFMV and hit Loadout to HLMV
 +
# Some painted variants will require custom materials. For example if you wanted scout's head and his headset you would need to that place the {{code|scout_head+hat+headset_materials}} in your custom folder. These materials can be found on the rotations page.
 +
# Once the model is loaded and the correct materials are setup you need to select "Paints Chart Tool" in the Tools section in the right side of TFMV
 +
:: Now that the Paints Chart Tool is selected make sure that the Screenshot refresh delay is set to an apporiate number. This entirely varies depending on your PC's hardware. If the paints don't change between screenshots increase the delay by a few seconds and try running it again.
 +
# Hit start in the Paints Chart Tool and then Go! TFMV will cycle through the different colored paints one at a time, taking screenshots for each one.
 +
# TFMV will change the cosmetic from red to blu for the appropriate paint however it will not change the color of the class model. You will need to change the class model manually as it cycles through the different color. If you don't do this things The easiest way to do this is to click on the skin drop down in the Model menu and press the down arrow on your keyboard whenever you need the blu class model.
 +
# Once the images have been captured open GIMP and select {{code|File > Batch Image Manipulation...}}
 +
# Where it says Manipulation set click {{code|Add > Load set}} and open the {{code|Auto-Crop.bimp}} set which can be found [https://github.com/Mediarch/HLMV-Stuff/raw/main/BIMP%20Auto-Crop%20Sets.zip here].
 +
# Click {{code|Add images > Add folders...}} and open the folder where the images are stored and set the {{code|Output folder:}} to your desired location.
 +
# Select Apply and BIMP will crop and convert all of the images.
 +
 +
== Upload the images ==
 +
<!--{{c|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.
 +
# Go to File... - Scripts... - Export layers to file and set the destination to wherever you see fit, and the file-type to PNG-24.
 +
# Ensure "Transparency" and "Trim layers" are both ticked, and hit "Run".      Gimp is free and is already explained in the tutorial, not sure if the photoshop bit needs to be here                                        -->
 +
# Upload a new version of the existing files on the Wiki. Use {{tlx|subst=yes|pid}} in the upload summary box when uploading painted item images, and use {{tlx|subst=yes|isd}} when uploading unpainted item images, such as default team color images. These templates will automatically add licensing and proper categories (this saves you from typing out categories or manually selecting a license in the drop down box).
 +
<!-- {{c|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 step one and two of this section of the guide, and follow it from step 3. -->
 +
 
 +
=== Adding the painted variants table to an article ===
 +
To include the Painted variant table to an article, add this section below the main summary for the page:
 +
 
 +
<pre>
 +
== Painted variants ==
 +
{{Painted variants}}
 +
</pre>
 +
 
 +
For documentation as to what parameters this template accepts, such as the inclusion of different Styles, see [[Template:Painted variants/doc]].
 +
 
 +
In rare situations, single color paint cans may have different visuals between teams on certain cosmetics, examples include the [[Frenchman's Beret]] and [[Defiant Spartan]]. On cases like these, add this section to the page:
  
 
<pre>
 
<pre>
// Uncomment and re-comment as necessary.
+
== Painted variants ==
//"$color2" "{}"            // Stock - Copy the value of "$colortint_base" into here.
+
{{Painted variants full}}
//"$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" "{105 77 58}"  // Radigan Conagher Brown
 
//"$color2" "{124 108 87}"  // Ye Olde Rustic Color
 
//"$color2" "{165 117 69}"  // Muskelmannbraun
 
//"$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" "{207 115 54}"  // Mann Co. Orange
 
//"$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" "{50 205 50}"  // The Bitter Taste of Defeat and Lime
 
//"$color2" "{114 158 66}"  // Indubitably Green
 
//"$color2" "{128 128 0}"  // Drably Olive
 
//"$color2" "{66 79 59}"    // Zephaniah's Greed
 
//"$color2" "{101 71 64}" // An Air of Debonair (RED)
 
//"$color2" "{40 57 77}" // An Air of Debonair (BLU)
 
//"$color2" "{59 31 35}" // Balaclavas Are Forever (RED)
 
//"$color2" "{24 35 61}" // Balaclavas Are Forever (BLU)
 
//"$color2" "{195 108 45}" // Cream Spirit (RED)
 
//"$color2" "{184 128 53}" // Cream Spirit (BLU)
 
//"$color2" "{72 56 56}" // Operator's Overalls (RED)
 
//"$color2" "{56 66 72}" // Operator's Overalls (BLU)
 
//"$color2" "{184 56 59}"  // Team Spirit (RED)
 
//"$color2" "{88 133 162}"  // Team Spirit (BLU)
 
//"$color2" "{128 48 32}" // The Value of Teamwork (RED)
 
//"$color2" "{37 109 141}" // The Value of Teamwork (BLU)
 
//"$color2" "{168 154 140}" // Waterlogged Lab Coat (RED)
 
//"$color2" "{131 159 163}" // Waterlogged Lab Coat (BLU)
 
 
</pre>
 
</pre>
  
=== Export and upload the images ===
+
The [[Template:Painted variants full/doc|documentation]] for this template includes the same parameters as the previous one.
# Go to <code>File... > Scripts... > Export layers to file</code> and set the destination to wherever you see fit, and the file-type to PNG-8.
 
# Ensure <code>Transparency</code> and <code>Trim layers</code> are both ticked, and hit <code>Run</code>.
 
# Upload a new version of the existing files on the Wiki. Use one of the following codes 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).
 
#*{{tlx|subst=yes|pid}} for hats.
 
#*{{tlx|subst=yes|pid|misc}} for misc items.
 
  
== Note ==
+
== See also ==
The new DLLs will mean most items will appear washed out in the model viewer. In order to fix this (for Vanilla screenshots) change the {{code|"$color2"}} value to the same value as {{code|"$colortint_base"}} and F5.
+
* There is an experimental automation toolset for the VMT method, found [[/Automation|here]].

Latest revision as of 12:44, 22 August 2024

This painted variants tutorial will document the current methods of painting cosmetic items using Half-Life Model Viewer (HLMV). This tutorial assumes that you already have HLMV working. If you haven't gotten HLMV set up, navigate to this page and read the information on it.

Other necessary programs

For this tutorial, we will utilize GCFScape, which may be downloaded here, as either an installer or a portable archive. In addition, if painting cosmetics which have jigglebones, it may be useful to remove them by decompiling the model, removing references to the jigglebones, and recompiling a new model file. For this process, you will also need the Crowbar tool. If you plan on using the semi automatic methods you will need HLMV++ and TFMV for capturing the images. Additionally you will need GIMP and the Batch Image Manipulation Plugin (BIMP) for processing the images before uploading.

Removing jigglebones from models

Cosmetics with jigglebones may prove to be an issue when painting, as their jigglebones may move when you refresh HLMV, in the process of changing paint colors. This may make it difficult to take identical-looking images, in which case, the jigglebones can be removed with the use of the Crowbar tool.

Decompiling the models

  1. Upon first booting Crowbar, you will be presented with the Set Up Games tab. Here, you may configure which game you would like to use with the program, and enter the location of your Steam executable, so that Crowbar can find the tools it needs to work. Select Team Fortress 2 from the drop down menu at the top, and enter the location of your Steam executable in the <library1> macro section at the bottom.
  2. Using GCFScape, extract the .mdl file you wish to remove jigglebones from, and all matching .vtx and .vvd files.
  3. In Crowbar's Decompile tab, you will notice the MDL input field, and the Output to: selector. In the MDL input field, select the .mdl file you extracted previously.
  4. Set Output to: to the Work folder option, and create a directory where you would like to save the decompiled files on your computer.
  5. Press the Decompile button. If successful, you should have a .qc file, and .smd files present in your work folder. These files are all necessary to recompile the model, and should follow the same file names as the model file you extracted.

Removing jigglebones and recompiling

  1. Open the .qc file from your decompilation work folder in a text editor, and remove all references to jigglebones. Save the file.
  2. Back in Crowbar, select the Compile tab. In the QC input section, select the .qc file from your decompilation work folder.
  3. Just as before, set Output to: to the Work folder option, and create a directory to save the compiled files to.
  4. Press the Compile button. If successful, your compilation work folder should now have identical files to the ones you extracted from GCFScape, nested within subfolders.

Pictogram comment.png Note: If you run into an error while compiling, it may be that Team Fortress 2, or the location of your Steam executable, was improperly set up in the Set Up Games tab; or that the decompilation process failed to produce the necessary files to recompile the model. Check that you have properly set up Team Fortress 2 and the file paths to its tools, and that you have properly extracted all relevant files from GCFScape.

Pictogram comment.png Note: Be sure to upload your recompiled files to a file sharing site, and link to them when adding details to the Rotations page! This will help other users to create identical images to yours, should the need arise.

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 may need to move the item around a bit to get it to show up correctly, and as large as possible. If this happens, read the "Saving rotations" section.
    • Generally, when choosing your own rotations, you'll need to find an angle that shows off the painted area the most.

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 Method

  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 to refresh the model and then take a screenshot of this color, and paste it into a 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.

Semi Automatic Methods

HLMV++ Method

Pictogram comment.png Note While the script is running the background will flash black and white very quickly so be careful if you are sensitve to that sort of thing.

  1. Load the model in HLMV++
  2. Download the AUTO-PaintedVariants mvscripts.
  3. In HLMV++ select File > Run .mvscript then open AUTO-PaintedVariants-Part1.mvscript. The script should cylce through the paint colors taking screenshots after each one. The images will be saved to wherever the script is located so you may choose to make a folder and drag the script into it so the images are organized.
  4. Part1 of the script will handle the single color paints (Pink as Hell, Drabby Olive etc.) and the red team colors (Team Spirit, Value of Teamwork). To get the Blu colors you need to set the skin of the cosmetic to the blu version in the model tab of HLMV++ then hit F5 to refresh and reset the cosmetic to unpainted
  5. Like with Part1, select File > Run .mvscript then open AUTO-PaintedVariants-Part2.mvscript.
  6. Once the images have been captured open GIMP and select File > Batch Image Manipulation...
  7. Where it says Manipulation set click Add > Load set and open the Auto-Crop and Convert to PNG.bimp set which can be found here.
  8. Click Add images > Add folders... and open the folder where the images are stored and set the Output folder: to your desired location.
  9. Select Apply and BIMP will crop and convert all of the images.

TFMV Method

  1. Select the model and class in TFMV and hit Loadout to HLMV
  2. Some painted variants will require custom materials. For example if you wanted scout's head and his headset you would need to that place the scout_head+hat+headset_materials in your custom folder. These materials can be found on the rotations page.
  3. Once the model is loaded and the correct materials are setup you need to select "Paints Chart Tool" in the Tools section in the right side of TFMV
Now that the Paints Chart Tool is selected make sure that the Screenshot refresh delay is set to an apporiate number. This entirely varies depending on your PC's hardware. If the paints don't change between screenshots increase the delay by a few seconds and try running it again.
  1. Hit start in the Paints Chart Tool and then Go! TFMV will cycle through the different colored paints one at a time, taking screenshots for each one.
  2. TFMV will change the cosmetic from red to blu for the appropriate paint however it will not change the color of the class model. You will need to change the class model manually as it cycles through the different color. If you don't do this things The easiest way to do this is to click on the skin drop down in the Model menu and press the down arrow on your keyboard whenever you need the blu class model.
  3. Once the images have been captured open GIMP and select File > Batch Image Manipulation...
  4. Where it says Manipulation set click Add > Load set and open the Auto-Crop.bimp set which can be found here.
  5. Click Add images > Add folders... and open the folder where the images are stored and set the Output folder: to your desired location.
  6. Select Apply and BIMP will crop and convert all of the images.

Upload the images

  1. Upload a new version of the existing files on the Wiki. Use {{subst:pid}} in the upload summary box when uploading painted item images, and use {{subst:isd}} when uploading unpainted item images, such as default team color images. These templates will automatically add licensing and proper categories (this saves you from typing out categories or manually selecting a license in the drop down box).

Adding the painted variants table to an article

To include the Painted variant table to an article, add this section below the main summary for the page:

== Painted variants ==
{{Painted variants}}

For documentation as to what parameters this template accepts, such as the inclusion of different Styles, see Template:Painted variants/doc.

In rare situations, single color paint cans may have different visuals between teams on certain cosmetics, examples include the Frenchman's Beret and Defiant Spartan. On cases like these, add this section to the page:

== Painted variants ==
{{Painted variants full}}

The documentation for this template includes the same parameters as the previous one.

See also

  • There is an experimental automation toolset for the VMT method, found here.