$model: Difference between revisions
Jump to navigation
Jump to search
m (typo & tidy ("listified" attributes, for an easier read)) |
|||
Line 1: | Line 1: | ||
=$model use in VMT file= | == $model use in VMT file == | ||
* Tells Source Engine that this material is intended for use on models rather than brushwork. | * Tells [[Source Engine]] that this material is intended for use on models rather than brushwork. | ||
: This flag is necessary for materials applied to models. | : This flag is necessary for materials applied to models. | ||
* Remember that the shader type for models is always [[VertexLitGeneric]], but [[UnlitGeneric]], [[Refract]] and some other shaders should work too. | * Remember that the shader type for models is always [[VertexLitGeneric]], but [[UnlitGeneric]], [[Refract]] and some other shaders should work too. | ||
* Note that | * Note that [[VMT]]s for models should be placed in the <code>game_directory/materials/models</code> folder relative to <code>game_directory/models/your.mdl</code>. | ||
: It's also good form to throw your.TGA in there | : 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. | * 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]] | * See also [[Materials for models]] | ||
==Syntax== | === Syntax === | ||
"$model" 1 | "$model" 1 | ||
=$model use in QC file= | == $model use in [[qc|QC]] file == | ||
* Specifies a reference SMD file to be used as part of this 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]]. | * 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]] | * See also: [[Qc eyes]] (helpful SDK tool) and [[Eye Position Setup]]. | ||
==Syntax== | ===Syntax=== | ||
$model "name" "smd" | $model "name" "smd" | ||
Line 23: | Line 23: | ||
* where '''<code>smd</code>''' is the path to a reference smd, relative to the [[$cd|current path]]. | * where '''<code>smd</code>''' is the path to a reference smd, relative to the [[$cd|current path]]. | ||
==Example== | === Example === | ||
$modelname "weapons/shell.mdl" | $modelname "weapons/shell.mdl" | ||
$cdmaterials "models/weapons/" | $cdmaterials "models/weapons/" | ||
Line 29: | Line 29: | ||
$sequence "idle" "shell.smd" | $sequence "idle" "shell.smd" | ||
==$model options== | === $model options === | ||
eyeball (name) (bone name) (X) (Y) (Z) (material name) (diameter) (angle) (iris material) (pupil scale) | 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 | * '''(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 [[Wikipedia:Strabismus|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 (name) | eyelid (name) (expression file) lowerer/neutral/raiser (frame) (height) split (distance) eyeball (name) | ||
* (name) Base name of the eyelid flexcontroller. This is combined with the "lowerer", "neutral", and "rasier" 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) that it can be found, 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 (name) Name of the eyeball that will drive this eyelid’s flexcontroller. | * '''(name)''' Base name of the eyelid flexcontroller. This is combined with the "lowerer", "neutral", and "rasier" 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) that it can be found, 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 (name)''' Name of the eyeball that will drive this eyelid’s flexcontroller. | |||
* flex (name) [(expression file)] | * flex (name) [(expression file)] |
Revision as of 15:52, 9 February 2008
$model use in VMT file
- Tells Source Engine that this material is intended for use on models rather than brushwork.
- This flag is necessary for 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 togame_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
Syntax
"$model" 1
$model use in QC file
- 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.
Syntax
$model "name" "smd"
- where
name
can be any thing as it is only used in HLMV. - where
smd
is the path to a reference smd, relative to the current path.
Example
$modelname "weapons/shell.mdl" $cdmaterials "models/weapons/" $model "Shell" "shell.smd" $sequence "idle" "shell.smd"
$model options
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 (name)
- (name) Base name of the eyelid flexcontroller. This is combined with the "lowerer", "neutral", and "rasier" 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) that it can be found, 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 (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)