This article's documentation is for anything that uses the Source engine. Click here for more information.

$body: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Removing deprecated Category)
 
(36 intermediate revisions by 12 users not shown)
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.
{{LanguageBar|title=$body}}{{tabsBar|main=gs|base=$body}}
{{this is a|QC command|name=$body}}
It is used to add a [[reference mesh]] to a model. Without at least one <code>$body</code>, {{ent|$bodygroup}}, or {{ent|$model (QC)|alt=$model}}, the model will be invisible.


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.
{{note|All {{code|$body}} meshes will display simultaneously. Toggleable reference meshes can be handled with a {{ent|$bodygroup}}.
{{tip|The order in which {{code|$body}} meshes are defined in the QC determines the order in which the meshes are rendered. This can be used to prevent z-fighting on transclucent decals or overlays.}}
}}


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


== Options ==
$body <name> <reference mesh [[Studiomdl Data|SMD]]> [reverse] [scale <[[int]]>]


$body <name> <reference SMD>
== Example ==
 
;<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==


  [[$modelname]] "weapons/shell.mdl"
  [[$modelname]] "weapons/shell.mdl"
  [[$cdmaterials]] "models/weapons/"
  [[$cdmaterials]] "models/weapons/"
  '''[[$body]] shell "shell-ref.smd"'''
  '''[[$body]] shell "shell_ref"'''
  [[$sequence]] idle "shell-idle.smd"
  [[$sequence]] idle "shell_idle"


== See also ==
== See also ==
 
*[[Reference mesh]]
*[[$model (QC)|$model]]
*{{ent|$lod}}, for lowering detail at a distance
 
*{{ent|$bodygroup}}, for managing toggleable meshes
[[Category:QC Commands]]
*{{ent|$model (QC)|alt=$model}}, for facial animation

Latest revision as of 21:09, 16 July 2025

English (en)한국어 (ko)Русский (ru)Translate (Translate)

$body is a QC command available in all Source Source games. It is used to add a reference mesh to a model. Without at least one $body, $bodygroup, or $model, the model will be invisible.

Note.pngNote:All $body meshes will display simultaneously. Toggleable reference meshes can be handled with a $bodygroup.
Tip.pngTip:The order in which $body meshes are defined in the QC determines the order in which the meshes are rendered. This can be used to prevent z-fighting on transclucent decals or overlays.

Syntax

$body	<name> <reference mesh SMD> [reverse] [scale <int>]

Example

$modelname		"weapons/shell.mdl"
$cdmaterials		"models/weapons/"
$body		shell	"shell_ref"
$sequence	idle	"shell_idle"

See also