$model

From Valve Developer Community
Revision as of 08:19, 31 March 2008 by Beeswax (talk | contribs) (clean up)
Jump to navigation Jump to search

VMT $model

The VMT command $model flags this material for use on models rather than brushwork. It is necessary for all materials applied to models.

  • Remember that the shader type for models is always VertexLitGeneric, but UnlitGeneric, Refract and some other shaders should work too.
  • Note that VMTs for models should be placed in the game_directory/materials/models folder relative to game_directory/models/your.mdl.
It's also good form to throw your .TGA in there as well, to make it easier for modders to create new skins for your model.
  • Try to keep the skin for each model entirely in one texture; using multiple textures on a model is a resource hog.
  • See also Materials for models

VMT syntax

"$model" 1

QC $model

The QC command $model specifies a reference SMD file to be used as part of this model.

  • Used mainly for characters when the model needs complex parameters like eyes, flexes etc. In other cases, use $body.
  • See also: Qc eyes (helpful SDK tool) and Eye Position Setup.

QC syntax

$model "<name>" "<reference_model>.smd"

where

<name>
can be any thing as it is only used in HLMV.
<reference_model>
is the path to a reference.smd, relative to the current path.

QC example

$modelname "weapons/shell.mdl"
$cdmaterials "models/weapons/"
$model "Shell" "shell.smd"
$sequence "idle" "shell.smd"

QC $model options

Stub

This article or section is a stub. You can help by expanding it.

eyeball "<name>" "<bone_name>" <X> <Y> <Z> "<material_name>" <diameter> <angle> "<iris_material>" <pupil_scale>
  • <name> Name of eyeball, used to match eyelid rules.
  • <bone_name> Name of bone that the eye is parented to, typically the head.
  • <X> <Y> <Z> World location of the center of the ball of the eye.
  • <material_name> Material name to use when searching for vertices to consider as the "white" of the eye <used in dynamically texture mapping the iris and cornea onto the eye>.
  • <diameter> Diameter of the ball of the eye.
  • <angle> Default yaw offset from "forward" for iris. Humans are typically 2-4 degrees wall-eyed. Not setting this correctly will result in either your characters appearing cross-eyed, or if you've compensated by misplacing the ball of the eye, them not tracking side to side. <iris material>Material to use as the iris texture.
  • <pupil_scale> World scale of the iris texture.
eyelid "<name>" "<expression_file>" lowerer/neutral/raiser <frame> <height> split <distance> eyeball "<eyeball_name>"
  • <name> Base name of the eyelid flexcontroller. This is combined with the "lowerer", "neutral", and "raiser" options to build the piecewise blend positions of the eyelid.
  • <expression_file> The name of the file to find the morph targets.
  • lowerer/neutral/raiser <frame> <height> One of the three options, the frame number in the <expression_file>, and the distance above or below the center of the pupil that polygon edge of the eyelid crosses the white of the eye.
  • split <distance> Where to start, on the opposite side of the "0" line, for finding vertices that belong to this eyelid morph target.
  • eyeball <eyeball_name> Name of the eyeball that will drive this eyelid's flexcontroller.
flex <name> <expression_file>
frame <frame> position split <distance>
defaultflex
flexfile <expression_file>
localvar <name> <name>
mouth <flexcontroller_name> <bone_name>
spherenormals <material_name> <X> <Y> <Z>