$model (QC)
$model
is a QC command available in all Source games.
Not to be confused with Model (a three-dimensional object) or $model (VMT) (a VMT parameter).
This QC command specifies a reference SMD, DMX, OBJ, or FBX file to be used as part of a complex model. Simple models (including all those with $staticprop
) should use $body
.
Contents
QC Syntax
$model "<name>" "<filepath>/<reference_model>"
<name>
- A unique identifier for this model.
<filepath>/<reference_model>
- Filepath (relative to the QC file's current directory) and filename of the reference model, including extension.
Example
$modelname "weapons/shell.mdl" $cdmaterials "models/weapons/" $model Shell "shell" $sequence idle "shell"
Options
eyeball
See
Eyeball
.eyelid
- Tells any NPCs using this model how to close their eyes (e.g., to blink).
<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_name>.vta
- The name of the file to find the morph targets.
lowerer <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. neutral <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. 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.
dmxeyelid
- The same as eyelid, but loads morph targets from .dmx instead of .vta.
- Syntax
dmxeyelid <upper|lower> <DMX File> lowerer <delta> <pos> neutral <delta> <pos> raiser <delta> <pos> righteyeball <righteye> lefteyeball <lefteye>
- Example
dmxeyelid upper $file$ lowerer "EM64U" -0.23 neutral "AU0" 0.15 raiser "EM63U" 0.28 righteyeball "righteye" lefteyeball "lefteye"
dmxeyelid lower $file$ lowerer "EM64D" -0.32 neutral "AU0" -0.24 raiser "EM63D" -0.06 righteyeball "righteye" lefteyeball "lefteye"
- where:
- "AU0", "EM63U", "EM63D", "EM64U", and "EM64D" - are all delta shape names.
- "righteye" and "lefteye" - are the same <name> used by right and left
Eyeball
Flex options
- See Flex animation for detailed information.
NoAutoDMXRules
-
- Remove any flexcontrollers already created.
defaultflex frame <frame>
-
- Define which VTA frame is the baseline shape.
flexpair <name> <options>
-
- Define flex split in right and left, with the said name and bind <R|L> postfix to the right shape.
flexcontroller <group> <options>
-
- Define a controller used by Faceposer and KeyValues gestures.
mouth
mouth (int|mouth number) (flex controller name) (bone name) (float|X) (float|Y) (float|Z)
- Defines a mouth. Mouth number is sequentially numbered starting from 0, i.e., the first mouth should be mouth 0. X, Y, and Z indicate the forward vector (the direction the mouth faces?)[Clarify]
spherenormals
spherenormals (material name) (float|X) (float|Y) (float|Z)
- material name
- The parts of the model with this material (mesh) will be effected
- X, Y, Z
- Coordinates to the sphere center
- This option will change the normals of the indicated mesh to point to (or from) the vector specified using X, Y, Z. Faces that are facing away from the vector will have normals pointing away from vector. All other faces, including coplanar faces, will have normals pointing towards the vector. In effect, shading will be done as though all the faces are parts of a sphere centered at vector.
vcafile
See Vertex animation.
Complex Example
From sourcesdk_content\hl2\modelsrc\humans_sdk\Male_sdk\Male_06_sdk.qc
:
$model male_06 "male_06_reference"{ eyeball righteye "ValveBiped.Bip01_Head1" -1.2711 -4.2197 67.5593 "eyeball_r" 1 4 "pupil_r" 0.63 eyeball lefteye "ValveBiped.Bip01_Head1" 1.3572 -4.2197 67.5514 "eyeball_l" 1 -4 "pupil_l" 0.63 eyelid upper_right "male_06_expressions" lowerer 1 -0.2621 neutral 0 0.1287 raiser 2 0.2467 split 0.1 eyeball righteye eyelid lower_right "male_06_expressions" lowerer 3 -0.3409 neutral 0 -0.2156 raiser 4 -0.0736 split 0.1 eyeball righteye eyelid upper_left "male_06_expressions" lowerer 1 -0.2621 neutral 0 0.1287 raiser 2 0.2467 split -0.1 eyeball lefteye eyelid lower_left "male_06_expressions" lowerer 3 -0.3409 neutral 0 -0.2156 raiser 4 -0.0736 split -0.1 eyeball lefteye mouth 0 "mouth" "ValveBiped.Bip01_Head1" 0 1 0 // mouth illumination flexfile "male_06_expressions" { $include "../standardflex_xsi.qci" } $include "../facerules_xsi.qci" $include "../bodyrules_xsi.qci" }