Difference between revisions of "Half-Life Model Viewer/en"

From Valve Developer Community
Jump to: navigation, search
(Delete)
m (Replaced content with "{{Delete|reason=deprecated|It has been split into GoldSrc and Source pages.}}")
(Tag: Replaced)
 
Line 1: Line 1:
 
{{Delete|reason=deprecated|It has been split into [[Half-Life Model Viewer (GoldSrc)|GoldSrc]] and [[Half-Life Model Viewer (Source)|Source]] pages.}}
 
{{Delete|reason=deprecated|It has been split into [[Half-Life Model Viewer (GoldSrc)|GoldSrc]] and [[Half-Life Model Viewer (Source)|Source]] pages.}}
[[File:Screenshot-HLMV-Source.png|thumb|250px|A screenshot of {{src|3}} version of HLMV.]]
 
{{hlmv|4|nt=1}} ({{hlmv|3}}) is the program originally created by chUmbaLum sOft for the {{gldsrc|1}} engine, then later (possibly) licensed by Valve, to port HLMV for the {{src|1}} engine. It is used to preview 3D models created for {{src|2}}, and previously {{gldsrc|2}}, specifically [[MDL]] files. It can be also used by modelers to refine a [[qc|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 {{gldsrc|2}} models. The latest version at that time was <tt>1.25</tt>, but only <code>1.24</code> was released as a binary.
 
 
=== Jed's Half-Life Model Viewer ===
 
Development of HLMV was continued by [[User:Wunderboy|Neil "Jed" Jedrzejewski]], who started a new branch with the original authors blessing, building on the 1.25 code using version numbers <code>1.0</code> to <code>1.36</code>. 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 {{hlam|2}} or Solokiller's HLMV Standalone instead.
 
 
=== [[Half-Life Asset Manager]] ===
 
{{hlam|4.1}} ({{hlam|3.1|nt=0}}) 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 ({{path|HKEY_CURRENT_USER\Software\Valve\hlmv|icon=reg}}). Unfortunately, there doesn't appear to be a way to set the standard options.
 
{{note|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
 
* [[w:Level of detail (computer graphics)|LOD]] models
 
:{{clarify|Which games have it?}}
 
* Flex animations
 
 
== Keybinds ==
 
* {{key|LMB}} drag in the center of the viewport will orbit the camera.
 
* {{key|LMB}} drag on the edge of the viewport will roll the camera.
 
* {{key|Ctrl|LMB}} drag will orbit the light source.
 
* {{key|RMB}} drag will dolly the camera back/forward.
 
* {{key|Shift|LMB}} drag with pan the camera left/right up/down.
 
* {{key|F5}} will refresh the textures if they have been recompiled.
 
* {{key|U}} will toggle UV chart view
 
* {{key|T}} will toggle textured view. {{Note|Normal mapping for textures is not checked on by default.}}
 
 
== Launch Options ==
 
{| class="wikitable"
 
|-
 
! 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 {{Bug| 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|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|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.
 
 
#Open HLMV and load your model.  From the Render tab press <code>CTRL+H</code> or select the <code>Hit Boxes</code> checkbox to view the hitboxes {{clr}} [[File:Hlmv_hitboxes_01.jpg]]
 
#Select the <code>Bones</code> tab. If you did not create hitboxes in your <code>.qc/.qci</code> file(s) then the <code>Auto-Generate Hitboxes</code> checkbox should be ON.  If you have specified some hitboxes, turning on the auto-generation will do nothing. {{clr}} [[File:Hlmv_hitboxes_02.jpg]]
 
#With the auto-generated hitboxes visible, click <code>Generate QC</code> button.  This will copy the .qc commands needed to create the auto-generated hitboxes into your clipboard. {{clr}} [[File:Hlmv_hitboxes_03.jpg]]
 
#Open your model's <code>.qc</code> or create a new <code>hitbox.qci</code> file with your favorite text editor. <code>CTRL+V</code> 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:
 
<syntaxhighlight lang="cpp">
 
// .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.
 
</syntaxhighlight>
 
 
=== 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.
 
 
<p>You can create a new hitbox set by adding <code>$hboxset "your_set_name_here"</code> and then cut/copy & pasting the .qc commands for an existing hitbox below.</p>
 
 
<p>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.
 
 
#Open your model in HLMV, turn the hitboxes on, flip over to the <code>Bones</code> tab {{clr}} [[File:Hlmv_hitboxes_04.jpg]]
 
#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|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 <code>size</code> and <code>origin</code>, or offset if you will, in relation to the bone's pivot.}} <br>[[File:Hlmv_hitboxes_05.jpg]]
 
#Edit the <code>Origin</code> and <code>Size</code> blocks and press the <code>Update Hitbox</code> button to see your changes. <br>[[File:Hlmv_hitboxes_06.jpg]]
 
#Repeat until all of the hitboxes in all of your sets are looking good.
 
#Click <code>Generate QC</code> 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 <code>materials/hlmv/</code> (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 <code>.jpg</code> 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 <code>File -> (Steam) Load model...</code> 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_Create_empty_folders|PowerShell script to create missing folders]]
 
 
== See also ==
 
* [[:Category:World Models|Prop Gallery]]
 
* [[:Category:Modeling|Modeling]]
 
* {{hlmvpp|4.1}} - an alternative to HLMV for several Source games. It also adds a number of brand new quality of life fixes and features.
 
 
== External links ==
 
* [http://www.chumba.ch/chumbalum-soft/hlmv/index.html chUmbaLum sOft's HLMV]
 
* [http://www.milkshape3d.com/hlmv/index.html Mete Ciragan's Half-Life Model Viewer]
 
* [http://www.wunderboy.org/apps/jhlmv.php Jed's Half-Life Model Viewer (Jed's HLMV)]
 
* [https://github.com/SamVanheer/HL_Tools/releases Half-Life Asset Manager (HLAM)]
 
* [https://gamebanana.com/gamefiles/3293 Fix for hlmv.exe (Steam) Load Model... - Empty Folder structure for Counter-Strike: Source]
 
* [https://github.com/gabrielwoj/hlmv-resources/raw/main/VPKs%20-%20ZIPs%20-Releases/HLMV%20-%20Missing%20Folders%20Fix.zip Fix for hlmv.exe (Steam) Load Model... - Empty Folder structure for Team Fortress 2 (extract to tf/custom)]
 

Latest revision as of 10:29, 15 April 2024

Warning icon.png
This article has been marked as a candidate for speedy deletion because it has been deprecated for the following reason:
It has been split into GoldSrc and Source pages.
If you object to this decision, then please discuss why hereIf this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators - Remember to check if anything links here and the page history (last edit) before deleting.