$model (QC): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 17: Line 17:
{{stub}}
{{stub}}


; <code>eyeball</code>
===eyeball===
:'''<code>name</code>:''' Name of eyeball, used to match eyelid rules. For humans, use <code>righteye</code>: and <code>lefteye</code>:.
:'''<code><name></code>''' : Name of eyeball, used to match eyelid rules. For humans, use <code>righteye</code>: and <code>lefteye</code>:.
:'''<code>bone_name</code>:''' Name of bone that the eye is parented to, typically the head.
:'''<code><bone_name></code>''' : Name of bone that the eye is parented to, typically the head.
:'''<code>X Y Z</code>:''' World location of the center of the ball of the eye.
:'''<code><X> <Y> <Z></code>''' : World location of the center of the ball of the eye.
:'''<code>"material_name"</code>:''' 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.
:'''<code>"<material_name>"</code>''' : 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.
:'''<code>diameter</code>:''' Diameter of the ball of the eye.
:'''<code><diameter></code>''' : Diameter of the ball of the eye.
:'''<code>angle</code>:''' 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 materialMaterial to use as the iris texture.
:'''<code><angle></code>''' : 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 materialMaterial to use as the iris texture.
:'''<code>pupil_scale</code>:''' World scale of the iris texture.
:'''<code>pupil_scale</code>:''' World scale of the iris texture.
;<code>eyelid</code>
[[$model]] "female_01" "female_01_reference_RE.smd" {
:'''<code>name</code>:''' 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.
    '''[[eyeball]] righteye ValveBiped.Bip01_Head1 -1.261 -3.702 64.974 eyeball_r 1.000  4.000 pupil_r 0.660'''
:'''<code>expression_file</code>:''' The name of the file to find the morph targets.
}
:'''<code>lowerer/neutral/raiser <frame> <height></code>:''' One of the three options, the frame number in the <code>expression_file</code>, and the distance above or below the center of the pupil that polygon edge of the eyelid crosses the white of the eye.
 
:'''<code>split <distance></code>:''' Where to start, on the opposite side of the "0" line, for finding vertices that belong to this eyelid morph target.
===eyelid===
:'''<code>eyeball <eyeball_name></code>:''' Name of the eyeball that will drive this eyelid's flexcontroller.
:'''<code><name></code>''' : 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.
; flex <name> <expression_file>
:'''<code>"<expression_file_name>.vta"</code>''' : The name of the file to find the morph targets.
:Todo
:'''<code>lowerer <frame> <height></code>''' : One of the three options, the frame number in the <code>expression_file</code>, and the distance above or below the center of the pupil that polygon edge of the eyelid crosses the white of the eye.
; frame <frame> position split <distance>
:'''<code>neutral <frame> <height></code>''' : One of the three options, the frame number in the <code>expression_file</code>, and the distance above or below the center of the pupil that polygon edge of the eyelid crosses the white of the eye.
:Todo
:'''<code>raiser <frame> <height></code>''' : One of the three options, the frame number in the <code>expression_file</code>, and the distance above or below the center of the pupil that polygon edge of the eyelid crosses the white of the eye.
; defaultflex
:'''<code>split <distance></code>''' : Where to start, on the opposite side of the "0" line, for finding vertices that belong to this eyelid morph target.
:Todo
:'''<code>eyeball <eyeball_name></code>''' : Name of the eyeball that will drive this eyelid's flexcontroller.
; flexfile <expression_file>
[[$model]] "female_01" "female_01_reference_RE.smd" {
:Todo
    '''[[eyelid]]  upper_right "mdldecompiler_expressions.vta" lowerer 4 0.000000 neutral 0 0.000000 raiser 0 0.000000 split 0.1'''
; localvar <name> <name>
}
:Todo
===flexfile===
; mouth <flexcontroller_name> <bone_name>
:'''<code>"<expression_file_name>.vta"</code>''' :
:Todo
[[$model]] "female_01" "female_01_reference_RE.smd" {'''
; spherenormals <material_name> <X> <Y> <Z>
    '''[[flexfile]] "mdldecompiler_expressions.vta" {'''
:Todo
    '''[[flexpair]] "AU1" 1.0 frame 5'''
    '''[[flex]] "AU12AU25" frame 10'''
    '''}'''
}
 
===flexcontroller===
: to do
[[$model]] "female_01" "female_01_reference_RE.smd" {
    '''flexcontroller eyelid right_lid_raiser "range" 0.000 1.000'''
}
 
===localvar===
:'''<code><name></code>''' : to do
:'''<code><definition></code>''' : 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===
:'''<code><flexcontroller_name></code>''' : to do
:'''<code><bone_name></code>''' : to do
:'''<code><float> <float> <float></code>''' : to do
[[$model]] "female_01" "female_01_reference_RE.smd" {
    '''[[mouth]] 0 "mouth"  ValveBiped.Bip01_Head1 0.000 1.000 0.000'''
}
 
===defaultflex===
: to do
 
===frame===
:'''<code><frame></code>''' : to do
:'''<code>position</code>''' : to do
:'''<code>split <distance></code>''' : to do
 
 
===spherenormals===
:'''<code><material_name></code>''' :
:'''<code><X> <Y> <Z></code>''' :
: to do


== Complex example ==
== Complex example ==

Revision as of 10:50, 31 March 2008

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

Usage

$model <name> "<reference_model>.smd"
<name>
A unique identifier for this model.
<reference_model>
Path to a reference.smd, relative to $cd.

Simple example

$model "Shell" "shell.smd"

Options

Stub

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

eyeball

<name> : Name of eyeball, used to match eyelid rules. For humans, use righteye: and lefteye:.
<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 materialMaterial 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
}

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
   }
}

flexcontroller

to do
$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

<flexcontroller_name> : to do
<bone_name> : to do
<float> <float> <float> : to do
$model "female_01" "female_01_reference_RE.smd" {
   mouth 0 "mouth"  ValveBiped.Bip01_Head1 0.000 1.000 0.000
}

defaultflex

to do

frame

<frame> : to do
position : to do
split <distance> : to do


spherenormals

<material_name> :
<X> <Y> <Z> :
to do

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