$body: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
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.
The [[$body]] [[QC command]] is used to specify the ''reference.smd'' file that will become the [[$modelname]].mdl.


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.
* Use [[$body]] for all models unless you need to specify special animation parameters like eyes, flexes etc.; in which case use [[$model (QC)]] instead.


{{tip|More complex models with eyes, facial animation, etc. use <code>[[$model (QC)|$model]]</code> instead of $body.}}
== Parameters ==


== Options ==
  $body "<name>" "<reference>.smd"
 
  $body <name> <reference SMD>


;<code><name></code>
;<code><name></code>
:Can be any string value. Used to refer to the body in [[HLMV]] and C++.
:Can be anything you like. It is used as a convenient label by [[HLMV]] to distinguish the main mesh from other [[$bodygroup]] meshes.  
;<code><reference SMD></code>
;<code><reference SMD></code>
:Path to a 'reference' (aka 'model') SMD, relative to the QC file's current directory.
:Path to and name of the 'reference' SMD, relative to the QC file's current directory.


==QC syntax example==
==QC syntax example==
Line 18: Line 16:
  [[$modelname]] "weapons/shell.mdl"
  [[$modelname]] "weapons/shell.mdl"
  [[$cdmaterials]] "models/weapons/"
  [[$cdmaterials]] "models/weapons/"
  '''[[$body]] shell "shell-ref.smd"'''
  '''[[$body]] "Shell" "shell_ref.smd"'''
  [[$sequence]] idle "shell-idle.smd"
  [[$sequence]] idle "shell_idle.smd"
 
== See also ==


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


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

Revision as of 04:52, 26 April 2008

The $body QC command is used to specify the reference.smd file that will become the $modelname.mdl.

  • Use $body for all models unless you need to specify special animation parameters like eyes, flexes etc.; in which case use $model (QC) instead.

Parameters

$body	"<name>" "<reference>.smd"
<name>
Can be anything you like. It is used as a convenient label by HLMV to distinguish the main mesh from other $bodygroup meshes.
<reference SMD>
Path to and name of the 'reference' 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"