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

$staticprop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(35 intermediate revisions by 16 users not shown)
Line 1: Line 1:
The [[$staticprop]] [[QC command]] specifies that the model being compiled does not have any moving parts.  
{{LanguageBar}}
{{note|Despite the name, a model compiled with [[$staticprop]] does ''not'' always need to be used as [[prop_static]]. It may be placed as [[prop_static]] entity, or as [[prop_physics]] (if it also has [[propdata]] and a [[$collisionmodel]]).}}
{{this is a|QC command|name=$staticprop}} It tells the model compiler that this model is not intended to have any moving parts. This will cause the compiler to strip away the skeleton & animations to just a single, unmoving bone named <code>static_prop</code>.


* [[$staticprop]] does apply several useful optimisations to the model, so it should be used whenever possible:
A model flagged with <code>$staticprop</code> is ''not'' necessarily limited to just being used with the <code>[[prop_static]]</code> [[point entity]]. <code>[[prop_static]]</code> will not function unless the model was compiled with this command. This command is also recommended for [[physics prop]]s, since physics props have animation forcibly disabled.
** It ''collapses all bones'' in the model into a single, rigid bone; so do not use for models with skeletal animation or ragdoll behavior.
** [[Vrad|VRAD]] will use the object's Collisionmodel when generating its Lightmap Shadows. <!-- surely this only applies when model is used as prop_static ? -->
** {{todo|Other?}}


== QC syntax example==
{{bug|If the model being compiled has a bone named <code>static_prop</code> already, it can cause the physics model for the prop to be misaligned, should the bone not be oriented how the model compiler expects it to be.}}


[[$modelname]] "weapons/shell.mdl"
{{bug|[[$bodygroup|Bodygroups]] do not play well with this command. <code>prop_static</code> does not actually support bodygroups anyway, and therefore always defaults to whatever the default bodygroup state is.
'''$staticprop'''
* The <code>blank</code> keyword will outright fail compilation with an EXCEPTION_ACCESS_VIOLATION error.
[[$cdmaterials]] "models/weapons/"
* If used as a prop_static, VRAD will generate lightmaps for each bodygroup, if they're present, even though this is entirely useless.
[[$body]] shell "shell-ref.smd"
Bodygroups can still be reliably used with $staticprop on entities other than prop_static, as long as none of the bodies are blank.}}
[[$sequence]] idle "shell-idle.smd" ''// A default animation is still required''


Note how the command does not accept any parameters.
==Example==
$modelname props_junk/metal_paintcan001a.mdl
$staticprop
$body body metal_paintcan001a_lod0
[...]


[[Category:QC Commands]]
==See also==
* [[prop_static]]
* [[prop_physics]]
 
[[Category:Modeling]]
[[Category:Source]]

Latest revision as of 17:52, 3 August 2025

English (en)Русский (ru)Translate (Translate)

$staticprop is a QC command available in all Source Source games. It tells the model compiler that this model is not intended to have any moving parts. This will cause the compiler to strip away the skeleton & animations to just a single, unmoving bone named static_prop.

A model flagged with $staticprop is not necessarily limited to just being used with the prop_static point entity. prop_static will not function unless the model was compiled with this command. This command is also recommended for physics props, since physics props have animation forcibly disabled.

Icon-Bug.pngBug:If the model being compiled has a bone named static_prop already, it can cause the physics model for the prop to be misaligned, should the bone not be oriented how the model compiler expects it to be.  [todo tested in ?]
Icon-Bug.pngBug:Bodygroups do not play well with this command. prop_static does not actually support bodygroups anyway, and therefore always defaults to whatever the default bodygroup state is.
  • The blank keyword will outright fail compilation with an EXCEPTION_ACCESS_VIOLATION error.
  • If used as a prop_static, VRAD will generate lightmaps for each bodygroup, if they're present, even though this is entirely useless.
Bodygroups can still be reliably used with $staticprop on entities other than prop_static, as long as none of the bodies are blank.  [todo tested in ?]

Example

$modelname props_junk/metal_paintcan001a.mdl
$staticprop
$body body metal_paintcan001a_lod0
[...]

See also