This article's documentation is for the "GoldSrc" engine. Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

Half-Life Model Viewer

From Valve Developer Community
(Redirected from HLMV)
Jump to: navigation, search

Split-arrows.png Split

It has been suggested that this article or section be split into multiple articles: Half-Life Model Viewer (GoldSrc) and Half-Life Model Viewer (Source). (Discuss)

English (en)русский (ru)
Edit
A screenshot of Source version of HLMV.

HLMV Half-Life Model Viewer (HLMV) is the program originally created by chUmbaLum sOft for the GoldSrc engine, then later (possibly) licensed by Valve, to port HLMV for the Source engine. It is used to preview 3D models created for Source Source, and previously GoldSrc GoldSrc, specifically MDL files. It can be also used by modelers to refine a QC file by finding the exact origin and physics constraints and generating a QC with the right values. You can preview and, in some cases, edit many aspects of your 3D model from within HLMV. The Source version of HLMV is accessible through the Source SDK.

Half-Life Model Viewer for GoldSrc

Up until 1999, HLMV was developed by chUmbaLum sOft for previewing GoldSrc GoldSrc models. The latest version at that time was 1.25, but only 1.24 was released as a binary.

Jed's Half-Life Model Viewer

Development of HLMV was continued by Neil "Jed" Jedrzejewski, who started a new branch with the original authors blessing, building on the 1.25 code using version numbers 1.0 to 1.36. This version is widely known as "Jed's HLMV" or "JHLMV".

The primary motivation for the branch was to add support for 1-bit transparent textures when previewing models. During development of JHLMV features such as wire-frame overlays, viewing and exporting of UV maps, view-model weapon origin view, previewing animation events and loading files from GCF archives were added. Supports was added for models created for the PS2 version of Goldsrc. Private/experimental versions of JHLMV also include support for models for the Dreamcast version of Goldsrc and ragdoll physics.

JHLMV is no longer updated. Users should use Half-Life Asset Manager Half-Life Asset Manager or Solokiller's HLMV Standalone instead.

Half-Life Asset Manager

Half-Life Asset Manager Half-Life Asset Manager (HLAM) is an actively developed successor to Jed's HLMV. In addition to increased stability and reduced RAM usage, HLAM adds several additional features such as hitbox editing and the ability to replace textures with ones of a different resolution, without recompiling.

Half-Life Model Viewer for Source

Valve ship their own version of HLMV with the Source SDK specifically for viewing models created for the Source engine. It appears to be based on the original HLMV 1.22 codebase but re-worked to use Source's own 3D viewport and material system.

It's unclear under what license it is used/distributed but Source HLMV still provides a credit and link to chUmbaLum sOft in its About menu. Several features of the Source HLMV have been copied from JHLMV.

Each iteration of the Source engine has a slightly updated version of the model viewer giving access to newer or enhanced features of the respective engine.

For the Source HLMV settings such as rendering options and background color is saved in the Windows registry and stored on a per model basis (Registry PathHKEY_CURRENT_USER\Software\Valve\hlmv). Unfortunately, there doesn't appear to be a way to set the standard options.

Note.pngNote:The Model Viewer can no longer be started from the Source SDK laucher after the SteamPipe update. However it can be launched manually (For example, it is usually located under "\steam\steamapps\common\half-life 2\bin", launch HLMV.bat to start HLMV.)

Source HLMV Features

  • Normal mapping
  • Specular mapping
  • Generating QC code for Hitboxes, Physics, Attachments, IKRule, Event
  • Visually displaying vertex weighting.
  • Animation blending
  • Pose parameters
  • LOD models
Clarify: Which games have it?
  • Flex animations

Keybinds

  • LMB drag in the center of the viewport will orbit the camera.
  • LMB drag on the edge of the viewport will roll the camera.
  • Ctrl+LMB drag will orbit the light source.
  • RMB drag will dolly the camera back/forward.
  • Shift+LMB drag with pan the camera left/right up/down.
  • F5 will refresh the textures if they have been recompiled.
  • U will toggle UV chart view
  • T will toggle textured view.
    Note.pngNote:Normal mapping for textures is not checked on by default.

Launch Options

Argument Description
-screenshot Takes a screenshot of the given model and writes it to a TGA file, requires the path of the model to be given
Icon-Bug.pngBug:Only seems to produce full files when HLMV is run in Windows 8 compatibility mode
-dump Writes to the console (stdout) specifying if the model is translucent or has material proxies
-noSteamdDialog [sic] Removes the old File Explorer browser when trying to open a file from the 'File' menu.
-tempcontent Attempts to add modname_tempcontent as a search path (e.g. hl2_tempcontent)
-olddialogs Adds the file explorer browser back to the 'File' menu, only works on versions that have it disabled by default.
-basedir Sets where to search for the dlls, only for Xbox 360
-novconfig Don't launch vconfig if no game was found

Usage

If you are starting from scratch, you can use HLMV to create a base set of hitboxes, and then modify them to fit your models needs. This page will take you step by step through the process.

Warning.pngWarning:you will need a model that compiles properly and has a least 1 bone that the geometry is skinned to.

Auto Generating hitboxes

The first thing we'll do is get HLMV to create a set of hitboxes for us. When it does this it will create a hitbox for every bone that has geometry skinned to it, and will fit the hitbox around that geometry.

  1. Open HLMV and load your model. From the Render tab press CTRL+H or select the Hit Boxes checkbox to view the hitboxes
    Hlmv hitboxes 01.jpg
  2. Select the Bones tab. If you did not create hitboxes in your .qc/.qci file(s) then the Auto-Generate Hitboxes checkbox should be ON. If you have specified some hitboxes, turning on the auto-generation will do nothing.
    Hlmv hitboxes 02.jpg
  3. With the auto-generated hitboxes visible, click Generate QC button. This will copy the .qc commands needed to create the auto-generated hitboxes into your clipboard.
    Hlmv hitboxes 03.jpg
  4. Open your model's .qc or create a new hitbox.qci file with your favorite text editor. CTRL+V to paste the autogenerated .qc lines into the file, save it, and recompile your model. It's a good idea to format the pasted commands into something more legible, especially if you plan on modifying the hitboxes. It should look something like this:
// .qc block generated by HLMV begins.
$surfaceprop "default"
$hboxset "default"
$hbox 0 "head"	   -14.83  -11.24  -23.58    32.59   11.24    9.46 "head"
$hbox 0 "spine1"	   -33.32  -20.38  -40.78    33.32   20.38   40.78 "spine1"
// .qc block generated by HLMV ends.

Creating new hitboxes and hitbox sets

The easiest way to create new hitboxes or hitbox sets is to simply cut/copy & paste the lines in the .qc that refer to a hitbox on the bone you'd like to add the hitbox to.

You can create a new hitbox set by adding $hboxset "your_set_name_here" and then cut/copy & pasting the .qc commands for an existing hitbox below.

Once you've finished adding the all the hitboxes and sets you need, save the file and recompile the model.

Modifying your hitboxes with HLMV

Once you have all of your hitboxes and sets added, it's much faster to use HLMV to edit the scale and position of them. You can do it directly in the .qc file, but it will require recompiling the model many times to review your changes and thus is a much more inefficient way of accomplishing the same thing.

  1. Open your model in HLMV, turn the hitboxes on, flip over to the Bones tab
    Hlmv hitboxes 04.jpg
  2. Select the set that contains the hitbox you would like to edit, and then the joint it is attached to. You'll see the boxes describing the hitboxes' position and size fill out.
    Note.pngNote:While this info represents what is defined in the .qc, it is presented differently. The .qc script defines the 2 opposite corners of the hitbox in relation to the bones pivot. HLMV converts that info into a more user friendly size and origin, or offset if you will, in relation to the bone's pivot.

    Hlmv hitboxes 05.jpg
  3. Edit the Origin and Size blocks and press the Update Hitbox button to see your changes.
    Hlmv hitboxes 06.jpg
  4. Repeat until all of the hitboxes in all of your sets are looking good.
  5. Click Generate QC to copy these new settings into your clipboard again and then replace your old hitbox info with it. Recompile your model. High-five someone.

Issues

  • If you find that HLMV is missing textures, such as floor, background, and cubemap, extract a set from a working SDK. Find them at materials/hlmv/ (e.g., in hl2_misc_dir.vpk for example).
  • HLMV has had a very wobbly history. Without warning it sometimes no longer works because of changes/updates done to the Source SDK.
  • Any .jpg model thumbnail made using Photoshop or ImageReady will crash HLMV. JPGs must use progressive encoding.
  • The normal map flag can be tricky to switch on depending on your graphic card.
  • Wireframe mode was broken shortly since after the release of the Source SDK, rendering the default texture (purple/black squares) over the model. To add injury to the insult, the flat shaded mode that provided some of the same functionality, was removed between Episodes One and Two. In later engine builds, the issues with wireframe mode has been resolved.
  • When selecting a submodel category, the second submodel is displayed in the 3D view, but the name of the first submodel is still being displayed as the selected in the dropdown menu (also present in Goldsrc versions).
  • When moving from folder to folder the scroll bar doesn't reset.
  • Texture resolution on models may be displayed at 1/4 of its actual resolution (Mipmap 1) on NVIDIA graphics cards.
  • When viewing models using materials that use "$cloakPassEnabled" "1" the triangle count will double what it actually is due to a calculation bug.
  • Using Options > Make Screenshot... doesn't seem to produce effective screenshots.
  • Since the Steampipe update, opening folders with the File -> (Steam) Load model... browser will give an error if the corresponding folder does not exist in the game's mod directory. A workaround for this is create the same folders in your game directory with the same structure as the game's VPK files.
  • Solution to above problem PowerShell script to create missing folders

See also

  • Prop Gallery
  • Modeling
  • HLMV++ HLMV++ - an alternative to HLMV for several Source games. It also adds a number of brand new quality of life fixes and features.

External links