$model (QC)
The QC command $model specifies a reference SMD file to be used as part of a complex model. Simple models (including all $staticprops) should use $body.

QC syntax
$model "<name>" "<filpath>/<reference_model>.smd"
<name>
- A unique identifier for this model.
<filepath>/<reference_model>.smd
- Filepath (relative to the QC file's current directory) and Filename of a reference.smd.
Example
$modelname "weapons/shell.mdl" $cdmaterials "models/weapons/" $model "Shell" "shell.smd" $sequence "idle" "shell.smd"
Options
eyeball
<name>
- Name of eyeball, used to match eyelid rules. For humans, use
righteye
: andlefteye
:. <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.
$model "female_01" "female_01_reference_RE.smd" { eyeball righteye ValveBiped.Bip01_Head1 -1.261 -3.702 64.974 eyeball_r 1.000 4.000 pupil_r 0.660 }
eyelid
<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.
$model "female_01" "female_01_reference_RE.smd" { eyelid upper_right "mdldecompiler_expressions.vta" lowerer 4 0.000000 neutral 0 0.000000 raiser 0 0.000000 split 0.1 eyeball righteye }
flexfile
"<expression_file_name>.vta"
$model "female_01" "female_01_reference_RE.smd" { flexfile "mdldecompiler_expressions.vta" { flexpair "AU1" 1.0 frame 5 flex "AU12AU25" frame 10 } }
flex
flex (flexname) [frame (frame #)] [position (controller value)] [split (distance)] [decay (amount)]
A flex is a set of animated vertices and normals, otherwise known as a morph target.
frame (number)
is the frame number in the vta file where the flex can be found.position (controller value)
is for setting piecewise flexes.split (distance)
pulls just one side of a flex, in units from the center line. Positive numbers starting on the right side at 0% at the specified distance growing to 100% on the negative side. Negative numbers do the opposite.decay (amount)
This specifies how "fleshy" the decay looks. By default, within each flex, the vertices that move the most move the fastest, with the shortest movements moving only 20% of their total distance each frame - about 0.7 seconds to reach 99% of their target. The(amount)
scales the decay, with 0 being even the smallest movements are instant, and values larger then 1 being even the longest movements are delayed.
flexpair
flexpair (flexname) (split distance) [options....]
Same options as flex, but automatically creates two flexes with a split, with "R" and "L" appended to their name.
flexcontroller
flexcontroller (group name) [range (min) (max)] [default (val)] (controller name) [(controller name) ... ]
This defines a named input into the flex system. These normally just show up as sliders in Face Poser, and are used as the inputs into the set of equations that actually drive the flexes.
If you specify two names on the line, and the first is named right_...
and the second left_...
, then Face Poser will turn them into a single slider with right/left control. Internally they're still stored and processed as independent right and left flexcontrollers, but the UI will show them as one.
$model "female_01" "female_01_reference_RE.smd" { flexcontroller eyelid right_lid_raiser "range" 0.000 1.000 }
localvar
<name>
- to do
<definition>
- to do
$model "female_01" "female_01_reference_RE.smd" { localvar upper_right_raiser %upper_right_raiser = ( right_lid_raiser * (( 1.000 - ( right_lid_droop * 0.800)) * (( 1.000 - right_lid_closer) * ( 1.000 - blink)))) }
mouth
mouth (int|mouth number) (flex controller name) (bone name) (float|X) (Y) (Z)
This defines a mouth. Mouth number is sequentially numbered starting from 0. ie. The first mouth should be mouth 0. X, Y, and Z indicate the forward vector (the direction the mouth faces?)
$model "female_01" "female_01_reference_RE.smd" { mouth 0 "mouth" ValveBiped.Bip01_Head1 0.000 1.000 0.000 }
defaultflex
translates to:
flex "default" [options]
Options are the same as for flex.
frame
<frame>
- to do
position
- to do
split <distance>
- to do
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. Source: http://code.google.com/p/modderation/source/browse/trunk/codebases/from-source/utils/studiomdl/studiomdl.cpp
Complex example
From sourcesdk_content\hl2\modelsrc\humans_sdk\Male_sdk\Male_06_sdk.qc
:
$model male_06 "male_06_reference.smd"{ 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" }