$body: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
The [[$body]] [[QC command]] is used to specify the ''reference.smd'' file that will become the [[$modelname]].
The <code>[[$body]]</code> [[QC command]] is used to specify a 'reference' SMD that contains [[vertex]], [[UV map]], [[skeleton]] and [[envelope]] data for the model. Without it, the model has no physical appearance and there is no context for animation data.
* Use [[$body]] for all models unless you need to specify special animation parameters like eyes, flexes etc.; in which case use [[$model (QC)]] instead.
 
A name is given to a $body because it is possible for a model to have several - like the [[npc_metropolice|metrocop]], who has one with a [[npc_manhack|manhack]] attached and one without.
 
{{tip|More complex models with eyes, facial animation, etc. use <code>[[$model (QC)|$model]]</code> instead of $body.}}
 
== Options ==
 
$body <name> <reference SMD>
 
;<code><name></code>
:Can be any string value. Used to refer to the body in [[HLMV]] and [[C++]].
;<code><reference SMD></code>
:Path to a 'reference' (aka 'model') SMD, relative to the QC file's [[$cd|current directory]].


==QC syntax example==
==QC syntax example==
[[$modelname]] "weapons/shell.mdl"
[[$cdmaterials]] "models/weapons/"
[[$body]] '''"Shell" "shell.smd"'''
[[$sequence]] "idle" "shell.smd"


Where
[[$modelname]] "weapons/shell.mdl"
* <code>"Shell"</code> can be anything as it is only used as a label in [[HLMV]].
[[$cdmaterials]] "models/weapons/"
* <code>"shell.smd"</code> is the path to a ''reference.smd'' relative to the QC file's [[$cd|current directory]].
'''[[$body]] shell "shell-ref.smd"'''
[[$sequence]] idle "shell-idle.smd"


== See also ==


*[[$model (QC)|$model]]


[[Category:QC Commands]]
[[Category:QC Commands]]

Revision as of 00:25, 26 April 2008

The $body QC command is used to specify a 'reference' SMD that contains vertex, UV map, skeleton and envelope data for the model. Without it, the model has no physical appearance and there is no context for animation data.

A name is given to a $body because it is possible for a model to have several - like the metrocop, who has one with a manhack attached and one without.

Tip.pngTip:More complex models with eyes, facial animation, etc. use $model instead of $body.

Options

$body	<name>	<reference SMD>
<name>
Can be any string value. Used to refer to the body in HLMV and C++.
<reference SMD>
Path to a 'reference' (aka 'model') SMD, relative to the QC file's current directory.

QC syntax example

$modelname		"weapons/shell.mdl"
$cdmaterials		"models/weapons/"
$body		shell	"shell-ref.smd"
$sequence	idle	"shell-idle.smd"

See also