Difference between revisions of "$staticprop"

From Valve Developer Community
Jump to: navigation, search
m
(Page re-write; added information about $bodygroup issues.)
 
Line 1: Line 1:
{{otherlang2
+
{{otherlang2|ru=$staticprop:ru}}
|ru=$staticprop:ru
 
}}
 
The [[QC command]] <code>[[$staticprop]]</code> specifies that the model being compiled does not have any moving parts. Despite the name, it does ''not'' limit the model to use with [[prop_static]].
 
  
The command:
+
The [[QC command]] <code>'''[[$staticprop]]'''</code> specifies that the model being compiled does not have any moving parts.
  
* Removes all bones except the root. Obviously do not use for ragdolls or animated models.
+
== Intended Usage ==
* Permits [[Vrad|VRAD]] to use the object's [[collision mesh]] to calculate [[lightmap]] shadows.
 
* Performs several other complex optimisations.
 
  
== Example==
+
Using the command is primarily meant to optimize props meant for ''maps'', as it provides benefits to [[lightmap]] shadows during [[VRAD]] compiles and the commands for it such as <code>-staticproplighting</code> or <code>-staticproppolys</code> commands.
 +
 
 +
It will also allow the prop to be used as a <code>[[prop_static]]</code> [[point entity]] in maps, as using props without the flag on standard compilers will remove it when [[VBSP]] is run.
 +
 
 +
=== Caveats ===
 +
 
 +
Using the static flag command will cause issues in certain circumstances.
 +
 
 +
It will remove all bones, and replace all weighted vertices' weights to a new "dummy" bone created during compile named <code>static_prop</code>. If used on a model that has multiple [[$animation|animations]] or [[$sequence|sequences]], it will remove all of them. Be aware of this if the prop is intended to be animated, and use <code>[[prop_dynamic]]</code> instead.
 +
 
 +
Using the static flag will also cause models to be error prone at times. Models with large numbers of [[$bodygroup|body groups]] will potentially crash the game, throw an error when compiled, and break the <code>blank</code> command in body groups.
  
[[$modelname]] "weapons/shell.mdl"
+
Essentially, ''do not'' use <code>$staticprop</code> unless the model is meant for a map or otherwise static prop, as it can cause issues when used on a prop meant to be used in-game.
'''$staticprop'''
 
[[$cdmaterials]] "models/weapons/"
 
[[$body]] shell "shell-ref.smd"
 
[[$sequence]] idle "shell-idle.smd" ''// A default animation is still required''
 
[[$collisionmodel]]      "shell_PHYS.smd"
 
  
Note the absence of a value.
+
== Example==
  
 +
<source lang=qc>
 +
$staticprop
 +
</source>
  
 
[[Category:QC Commands|s]]
 
[[Category:QC Commands|s]]

Latest revision as of 10:00, 26 August 2019

Русский

The QC command $staticprop specifies that the model being compiled does not have any moving parts.

Intended Usage

Using the command is primarily meant to optimize props meant for maps, as it provides benefits to lightmap shadows during VRAD compiles and the commands for it such as -staticproplighting or -staticproppolys commands.

It will also allow the prop to be used as a prop_static point entity in maps, as using props without the flag on standard compilers will remove it when VBSP is run.

Caveats

Using the static flag command will cause issues in certain circumstances.

It will remove all bones, and replace all weighted vertices' weights to a new "dummy" bone created during compile named static_prop. If used on a model that has multiple animations or sequences, it will remove all of them. Be aware of this if the prop is intended to be animated, and use prop_dynamic instead.

Using the static flag will also cause models to be error prone at times. Models with large numbers of body groups will potentially crash the game, throw an error when compiled, and break the blank command in body groups.

Essentially, do not use $staticprop unless the model is meant for a map or otherwise static prop, as it can cause issues when used on a prop meant to be used in-game.

Example

$staticprop