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
m (comments in diff)
(Removing deprecated Category)
 
(20 intermediate revisions by 11 users not shown)
Line 1: Line 1:
The [[$body]] [[QC command]] is used to include a [[reference mesh]] [[Studiomdl Data|SMD]] in a model. Without at least one $body the model will not be rendered.
{{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.


{{tip|Models with [[facial animation]] use <code>[[$model (QC)|$model]]</code>.}}
{{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|Multiple reference meshes can be handled with a [[$bodygroup]].}}
<!--
// I would collapse this into one tip :
{{tip|See also: For including additional sub-meshes see [[$bodygroup]]. For models with [[facial animation]]s see <code>[[$model (QC)|$model]]</code>.}}
-->
== Syntax ==
== Syntax ==


  $body <name> "<reference mesh SMD>"
  $body <name> <reference mesh [[Studiomdl Data|SMD]]> [reverse] [scale <[[int]]>]
<!-- // lol no :-) ...
$body <body_mesh> "<reference.smd>"
-->
where :
 
;<code><name></code>
:A label for this $body to distinguish it from other reference meshes (if there are any).
<!--
// there can only be 1 "reference" mesh, but any number of sub-meshes. how about: ...
;<code><body_mesh></code>
:An arbitrary label to distinguish the [[reference mesh]] from any [[$bodygroup]] sub-meshes.
-->
;<code><reference smd></code>
:Path to and name of the 'reference' (sometimes 'model') SMD relative to the QC file's current directory. The <code>.smd</code> extension is optional, but helps make the QC file easier to read.


== Example ==
== Example ==
Line 30: Line 15:
  [[$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]]
*[[Reference mesh]]
*[[$lod]] "replacemodel"
*{{ent|$lod}}, for lowering detail at a distance
*[[$bodygroup]]
*{{ent|$bodygroup}}, for managing toggleable meshes
*[[$model (QC)|$model]]
*{{ent|$model (QC)|alt=$model}}, for facial animation
<!-- // arguably: re-listing links here that are/should be explained above is unnecessary clutter? -->
 
[[Category:QC Commands|body]]

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