$model

From Valve Developer Community
Jump to: navigation, search
English한국어
Not to be confused with Model (a three-dimensional object) or $model (VMT) (a VMT parameter).

The QC command $model specifies a reference SMD, DMX, or FBX file to be used as part of a complex model. Simple models (including all those with $staticprop) should use $body.

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.smd"
$sequence "idle" "shell.smd"

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> <source|shapename> lowerer <delta> <-0.20 neutral F00 0.19 raiser F02 0.28 righteyeball righteye lefteyeball lefteye
Example
   dmxeyelid  upper $REFERENCEfile$ lowerer 1 -0.23 neutral 0 0.15 raiser 2 0.28 righteyeball righteye lefteyeball lefteye
   dmxeyelid  lower $REFERENCEfile$ lowerer 3 -0.32 neutral 0 -0.24 raiser 4 -0.06 righteyeball righteye lefteyeball lefteye
where F00 and F02 - are shape names. In lowerer 1 and raiser 2 bits 1 and 2 - are also shape names.
flexfile
flex
flexpair
defaultflex
flexcontroller
localvar
See Flex animation.
mouth
mouth (int|mouth number) (flex controller name) (bone name) (float|X) (Y) (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?)
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.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"

}

See Also