Difference between revisions of "Help:Model Viewer"

From Team Fortress Wiki
Jump to: navigation, search
m (Corrects code)
m (Oops. Extra things that aren't needed got left behind.)
Line 200: Line 200:
 
: HLMV applies a fire overlay material to most models. Although not noticeable under most circumstances, it can become particularly apparent when working with models that have dark or black textures.  
 
: HLMV applies a fire overlay material to most models. Although not noticeable under most circumstances, it can become particularly apparent when working with models that have dark or black textures.  
 
: There are two methods to remove this effect:
 
: There are two methods to remove this effect:
:# The more preferred option is to [http://dl.dropbox.com/u/5827839/fireLayeredSlowTiled512.vtf download this texture replacement] and save it under "{{code|\\Steam\steamapps\common\Team Fortress 2\tf\custom\folder\materials\effects\tiledfire}}" (create the folders if needed). This will replace the default file texture with a 512x512 black material, effectively nullifying the effect for all models.  
+
:# The more preferred option is to [http://dl.dropbox.com/u/5827839/fireLayeredSlowTiled512.vtf download this texture replacement] and save it under {{code|\Steam\steamapps\common\Team Fortress 2\tf\custom\folder\materials\effects\tiledfire}} (create the folders if needed). This will replace the default file texture with a 512x512 black material, effectively nullifying the effect for all models.  
 
:# Alternatively, setting {{code|$detailblendfactor}} in the individual model's texture file(s) to {{code|.00}} will achieve to the same end; however, this setting must be enabled manually per model.
 
:# Alternatively, setting {{code|$detailblendfactor}} in the individual model's texture file(s) to {{code|.00}} will achieve to the same end; however, this setting must be enabled manually per model.
 
:: That setting is to be changed in the VMT texture file, not the VTF texture file.
 
:: That setting is to be changed in the VMT texture file, not the VTF texture file.

Revision as of 00:55, 25 June 2013

The Half-Life Model Viewer (HLMV) is a program used to view and manipulate Source engine models.

Setup

To use HLMV, you will need to opt into sdktools_beta for Team Fortress 2. To do this, right click on Team Fortress 2 in your Steam library, and then click on the Properties button on the menu that appears. Once the Properties menu is open, navigate to the Betas tab, and select the sdktools_beta in the drop down menu.

After you have opted into the sdktools_beta, Team Fortress 2 should start a download. If it doesn't, starting the game should force it to download. Once the download has finished, navigate to Steam\steamapps\common\Team Fortress 2\bin, and run HLMV.bat. Once that has finished, you should be able to run hlmv.exe.

A number of options and settings need to be tweaked in order to achieve best performance from the Model Viewer. The program has no GUI-based video settings like the game, so several other steps need to be taken.

Graphics card settings

For ATi/AMD cards, under '3D' in Catalyst Control Center's drop down menu, uncheck "Use Application Settings" in the "AA" section and move the slider to 8x.

For NVIDIA cards, open the "NVIDIA Control Panel" and navigate to "Manage 3D settings" or similar. Add a program-specific setting for hlmv.exe. The location of this file is: Steam\steamapps\common\Team Fortress 2\bin\hlmv.exe

Ensure that the following settings are enabled:

  • Anti-aliasing set to "override" and on highest setting possible
  • Texture filtering quality on highest setting possible

dxsupport.cfg

The Model Viewer also pulls settings from the config file 'dxsupport.cfg'. If the graphics card settings above do not work, then this method should still force the Viewer to output with high settings.

  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 File:Dxsupport.cfg.txt. this content
  3. Find your graphics card within that file.
  4. Add or modify the following lines in dxsupport.cfg - within the section for your graphics card and save it, the Viewer should now be using high settings.
    "setting.dxlevel" "99"
    "ConVar.mat_antialias" "8"
    "ConVar.mat_forceaniso" "8"
    "ConVar.mat_picmip" "-10"
  5. If your card isn't listed, go to Control Panel, open Device Manager, find your graphics card under Display adapters section, open Details tab of its Properties and select Hardware Ids. The IDs are 4-character hexadecimal numbers. The Vendor ID is located after VEN_, and the Device ID is located after DEV_.
  6. Navigate to the bottom of the file, and find the Unknown sections. Choose the one that refers to your graphics card, which will beATI Unknown if you're using an ATI/AMD graphics card, NVidia Unknown if using an Nvidia graphics card, or Intel Unknown if using an Intel graphics card.
  7. Once you have located this, change the lines of the one that matche, so that looks like the following:"name" "Any name you want here"
    "VendorID" "0x[Insert Vendor ID from step 5 here]"
    "MinDeviceID" "0x[Insert Device ID from step 5 here]"
    "MaxDeviceID" "0x[Insert Device ID from step 5 here]"
    "setting.dxlevel" "99"
    "ConVar.mat_antialias" "8"
    "ConVar.mat_forceaniso" "8"
    :"ConVar.mat_picmip" "-10"
    :"ConVar.mat_motion_blur_enabled" "1"
  8. Only if your card is an AMD Radeon HD5000 series or above, you may enable "Super-Sample AA" under "3D" in the drop down menu in Catalyst Control Center to further increase image quality when used with the above settings. It is advised to revert "Super-Sample AA" back to "Multi-Sample AA" when you are done using the Viewer, as performance in games will be reduced significantly.

Models

Pictogram comment.png Note: directly viewing some models will ignore the $colortint_base attribute (which provides the texture's normal color tint to the model), forcing the model to appear grey or washed out. This can be worked around by extracting the model's texture file and adding a new attribute $color2 with the same value as $colortint_base.

Model locations

Most models have standard names but others have vague or confusing names. All model file paths can be found by searching "items_game.txt" (\tf\scripts\items\items_game.txt) for the item's entry and checking the value of "model_player".

Pictogram comment.png Note: You may get issues with HLMV saying it can't find a directory. To fix this, navigate to \Steam\steamapps\common\Team Fortress 2\tf\models and create the folders that are needed to get to the model you are attempting to get to

Weapons
The locations for weapon models are as follows:
  • w_models – holds world models for the Stock weapons.
  • v_models – holds view models for the Stock weapons.
  • c_models – holds models for most newer weapons.

Pictogram comment.png Note: A number of the stock weapons have switched over to use the c_model format, and have been removed from the w_models and v_models folders.
Pictogram comment.png Note: There are some discrepancies regarding c_, v_ and w_ models. Previously, all weapons had a world model and a view model that were kept separately. Most newer unlockable weapons use a single model file (c_model), which is used for both the player's viewpoint and for what other players see you holding.
Pictogram comment.png Note: Some weapons, such as the older Festive weapons and the Botkiller weapons have parts of them in odd locations. For example, the older Festive weapons have the attached lights in \models\player\items, and the Botkiller weapons have the attached heads in the \models\player\items\mvm_loot.

Hats and Miscellaneous items
Most of models of any Hats and Miscellaneous items that were added before the Robotic Boogaloo update are located in \models\player\items. Any Hats and Miscellaneous items that were added in or after that update are located in \models\workshop\player\items.
Tools
The Crate, Paint Can, and Name Tag models are not present in the game files. Efforts to reproduce them in a model form are ongoing.
Player models
Player models are stored in the directory of \models\player. There are HWM models (or hardware morphs) stored in \models\player\hwm. These models are higher-poly versions of the standard models and were used in the creation of the Meet the Team series. For more information about them, see this thread on the Steam Users' Forums.

Registry

HLMV stores model positionings and settings inside the Template:W in separate keys. You can open the registry editor by going to Start > Run and typing in "regedit.exe". HLMV's directory is "HKEY_CURRENT_USER\Software\Valve\hlmv".

Pictogram comment.png Note: Changes made to values in the registry editor will be overwritten if the model is open while the changes are made. You will need to either close HLMV or load a different model while editing values. The values can also be updated while viewing by refreshing the registry editor ('View' > 'Refresh' or 'F5').

Key values

Inside each key are several values, and their uses are listed below:

Value Description Type Default
aColor Ambient color (0.3 0.3 0.3 0) #4C4C4C
bgColor Background color (0.25 0.25 0.25 0) #3F3F3F
cclanguageid Integer 0
enablenormalmapping Normal map Integer 0
gColor Ground color (0.85 0.85 0.69 0) #D8D8AF
lColor Light color (1 1 1 0) (white)
lightrot Positioning of the light source (X Y Z) (0 180 0)
merge0 – merge3 Attached weapons
overlaySequence0 – overlaySequence3 ?
overlayWeight0 – overlayWeight3 ?
playsounds Toggle sounds being played Integer 1
Rot Model's rotation in the world view (X Y Z) Model dependant
sequence Animation sequence Model dependant (most commonly idle or ref)
showbackground Integer 1
showground Integer 1
showillumpos Integer 1
showshadow Integer 1
speechapiindex Integer 1
speedscale 1
thumbnailsize Integer 128
thumbnailsizeanim Integer 128
Trans Template:W of the model (X Y Z) Model dependant
viewermode Integer 0

Program limitations

Fire texture
HLMV applies a fire overlay material to most models. Although not noticeable under most circumstances, it can become particularly apparent when working with models that have dark or black textures.
There are two methods to remove this effect:
  1. The more preferred option is to download this texture replacement and save it under \Steam\steamapps\common\Team Fortress 2\tf\custom\folder\materials\effects\tiledfire (create the folders if needed). This will replace the default file texture with a 512x512 black material, effectively nullifying the effect for all models.
  2. Alternatively, setting $detailblendfactor in the individual model's texture file(s) to .00 will achieve to the same end; however, this setting must be enabled manually per model.
That setting is to be changed in the VMT texture file, not the VTF texture file.

See also

External links

Tools

Resources