$body: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:
It is used to add a [[reference mesh]] to a model. Without at least one <code>$body</code> the model will be invisible (exception: models with [[facial animation]] use <code>[[$model (QC)|$model]]</code> instead).
It is used to add a [[reference mesh]] to a model. Without at least one <code>$body</code> the model will be invisible (exception: models with [[facial animation]] use <code>[[$model (QC)|$model]]</code> instead).


{{tip|All {{code|$body}} meshes will display simultaneously. Toggleable reference meshes can be handled with a {{ent|$bodygroup}}.}}
{{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.}}
}}


== Syntax ==
== Syntax ==
Line 18: Line 20:
*[[Reference mesh]]
*[[Reference mesh]]
*{{ent|$lod}}, for lowering detail at a distance
*{{ent|$lod}}, for lowering detail at a distance
*{{ent|$bodygroup}}, for managing multiple <code>$body</code>s
*{{ent|$bodygroup}}, for managing toggleable meshes
*<code>[[$model (QC)|$model]]</code>, for facial animation
*{{ent|$model (QC)|alt=$model}}, for facial animation

Revision as of 11:44, 25 March 2024

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

It is used to add a reference mesh to a model. Without at least one $body the model will be invisible (exception: models with facial animation use $model instead).

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.smd"
$sequence	idle	"shell_idle.smd"

See also